From patchwork Mon Oct 22 08:46:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xu, Rosen" X-Patchwork-Id: 47111 X-Patchwork-Delegate: cristian.dumitrescu@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 653184D27; Mon, 22 Oct 2018 10:46:35 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 3F7E14CC3 for ; Mon, 22 Oct 2018 10:46:32 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Oct 2018 01:46:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,411,1534834800"; d="scan'208";a="273346970" Received: from dpdkx8602.sh.intel.com ([10.67.110.200]) by fmsmga005.fm.intel.com with ESMTP; 22 Oct 2018 01:46:30 -0700 From: Rosen Xu To: dev@dpdk.org Cc: cristian.dumitrescu@intel.com, wenzhuo.lu@intel.com, jasvinder.singh@intel.com, rosen.xu@intel.com, ferruh.yigit@intel.com Date: Mon, 22 Oct 2018 16:46:40 +0800 Message-Id: <1540198001-127116-2-git-send-email-rosen.xu@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1540198001-127116-1-git-send-email-rosen.xu@intel.com> References: <1534156498-57837-1-git-send-email-rosen.xu@intel.com> <1540198001-127116-1-git-send-email-rosen.xu@intel.com> Subject: [dpdk-dev] [PATCH v2 1/2] [PATCH v2 1/2] app/test-pmd: add and identify shaper profile parameters X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" As struct rte_tm_shaper_params defined, the command line of test-pmd should include committed and peak parameters, but right now the command line doesn't identify whether it's committed or peak parameter. This patch identifies and adds the clarify definition Signed-off-by: Rosen Xu iFixes: bddc2f40b594 ("app/testpmd: add commands for shaper and wred profiles") Cc: jasvinder.singh@intel.com --- app/test-pmd/cmdline.c | 3 ++- app/test-pmd/cmdline_tm.c | 34 ++++++++++++++++++++++++---------- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 3b469ac..eda13fa 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -725,7 +725,8 @@ static void cmd_help_long_parsed(void *parsed_result, " show all queue region related configuration info\n\n" "add port tm node shaper profile (port_id) (shaper_profile_id)" - " (tb_rate) (tb_size) (packet_length_adjust)\n" + " (cmit_tb_rate) (cmit_tb_size) (peak_tb_rate) (peak_tb_size)" + " (packet_length_adjust)\n" " Add port tm node private shaper profile.\n\n" "del port tm node shaper profile (port_id) (shaper_profile_id)\n" diff --git a/app/test-pmd/cmdline_tm.c b/app/test-pmd/cmdline_tm.c index b430797..4c76348 100644 --- a/app/test-pmd/cmdline_tm.c +++ b/app/test-pmd/cmdline_tm.c @@ -771,8 +771,10 @@ struct cmd_add_port_tm_node_shaper_profile_result { cmdline_fixed_string_t profile; uint16_t port_id; uint32_t shaper_id; - uint64_t tb_rate; - uint64_t tb_size; + uint64_t cmit_tb_rate; + uint64_t cmit_tb_size; + uint64_t peak_tb_rate; + uint64_t peak_tb_size; uint32_t pktlen_adjust; }; @@ -807,14 +809,22 @@ struct cmd_add_port_tm_node_shaper_profile_result { TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_shaper_profile_result, shaper_id, UINT32); -cmdline_parse_token_num_t cmd_add_port_tm_node_shaper_profile_tb_rate = +cmdline_parse_token_num_t cmd_add_port_tm_node_shaper_profile_cmit_tb_rate = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_shaper_profile_result, - tb_rate, UINT64); -cmdline_parse_token_num_t cmd_add_port_tm_node_shaper_profile_tb_size = + cmit_tb_rate, UINT64); +cmdline_parse_token_num_t cmd_add_port_tm_node_shaper_profile_cmit_tb_size = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_shaper_profile_result, - tb_size, UINT64); + cmit_tb_size, UINT64); +cmdline_parse_token_num_t cmd_add_port_tm_node_shaper_profile_peak_tb_rate = + TOKEN_NUM_INITIALIZER( + struct cmd_add_port_tm_node_shaper_profile_result, + peak_tb_rate, UINT64); +cmdline_parse_token_num_t cmd_add_port_tm_node_shaper_profile_peak_tb_size = + TOKEN_NUM_INITIALIZER( + struct cmd_add_port_tm_node_shaper_profile_result, + peak_tb_size, UINT64); cmdline_parse_token_num_t cmd_add_port_tm_node_shaper_profile_pktlen_adjust = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_shaper_profile_result, @@ -838,8 +848,10 @@ static void cmd_add_port_tm_node_shaper_profile_parsed(void *parsed_result, /* Private shaper profile params */ memset(&sp, 0, sizeof(struct rte_tm_shaper_params)); memset(&error, 0, sizeof(struct rte_tm_error)); - sp.peak.rate = res->tb_rate; - sp.peak.size = res->tb_size; + sp.committed.rate = res->cmit_tb_rate; + sp.committed.size = res->cmit_tb_size; + sp.peak.rate = res->peak_tb_rate; + sp.peak.size = res->peak_tb_size; sp.pkt_length_adjust = pkt_len_adjust; ret = rte_tm_shaper_profile_add(port_id, shaper_id, &sp, &error); @@ -862,8 +874,10 @@ static void cmd_add_port_tm_node_shaper_profile_parsed(void *parsed_result, (void *)&cmd_add_port_tm_node_shaper_profile_profile, (void *)&cmd_add_port_tm_node_shaper_profile_port_id, (void *)&cmd_add_port_tm_node_shaper_profile_shaper_id, - (void *)&cmd_add_port_tm_node_shaper_profile_tb_rate, - (void *)&cmd_add_port_tm_node_shaper_profile_tb_size, + (void *)&cmd_add_port_tm_node_shaper_profile_cmit_tb_rate, + (void *)&cmd_add_port_tm_node_shaper_profile_cmit_tb_size, + (void *)&cmd_add_port_tm_node_shaper_profile_peak_tb_rate, + (void *)&cmd_add_port_tm_node_shaper_profile_peak_tb_size, (void *)&cmd_add_port_tm_node_shaper_profile_pktlen_adjust, NULL, },