From patchwork Thu Jan 10 12:50:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rao, Nikhil" X-Patchwork-Id: 49580 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 C8CF01B616; Thu, 10 Jan 2019 13:51:34 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 58BD92965; Thu, 10 Jan 2019 13:51:32 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jan 2019 04:51:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,461,1539673200"; d="scan'208";a="137076367" Received: from unknown (HELO broadwell-dev-4.localdomain) ([10.224.122.193]) by fmsmga001.fm.intel.com with ESMTP; 10 Jan 2019 04:51:28 -0800 From: Nikhil Rao To: wenzhuo.lu@intel.com, jingjing.wu@intel.com, bernard.iremonger@intel.com Cc: dev@dpdk.org, cristian.dumitrescu@intel.com, jasvinder.singh@intel.com, Nikhil Rao , stable@dpdk.org Date: Thu, 10 Jan 2019 18:20:45 +0530 Message-Id: <1547124645-90122-1-git-send-email-nikhil.rao@intel.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] app/testpmd: initialize WRED profile packet mode from cli 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" Add struct rte_tm_wred_params::packet_mode to the "add port tm node wred profile" cli command. Fixes: 2fcf2f104fa2 ("ethdev: support WRED thresholds in bytes") Cc: stable@dpdk.org Signed-off-by: Nikhil Rao Acked-by: Jingjing Wu --- app/test-pmd/cmdline_tm.c | 8 ++++++++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/cmdline_tm.c b/app/test-pmd/cmdline_tm.c index 1012084..70203f3 100644 --- a/app/test-pmd/cmdline_tm.c +++ b/app/test-pmd/cmdline_tm.c @@ -1154,6 +1154,7 @@ struct cmd_add_port_tm_node_wred_profile_result { cmdline_fixed_string_t wred; cmdline_fixed_string_t profile; uint16_t port_id; + int packet_mode; uint32_t wred_profile_id; cmdline_fixed_string_t color_g; uint64_t min_th_g; @@ -1199,6 +1200,10 @@ struct cmd_add_port_tm_node_wred_profile_result { TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_wred_profile_result, wred_profile_id, UINT32); +cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_packet_mode = + TOKEN_NUM_INITIALIZER( + struct cmd_add_port_tm_node_wred_profile_result, + packet_mode, INT32); cmdline_parse_token_string_t cmd_add_port_tm_node_wred_profile_color_g = TOKEN_STRING_INITIALIZER( struct cmd_add_port_tm_node_wred_profile_result, @@ -1279,6 +1284,8 @@ static void cmd_add_port_tm_node_wred_profile_parsed(void *parsed_result, memset(&wp, 0, sizeof(struct rte_tm_wred_params)); memset(&error, 0, sizeof(struct rte_tm_error)); + wp.packet_mode = res->packet_mode; + /* WRED Params (Green Color)*/ color = RTE_TM_GREEN; wp.red_params[color].min_th = res->min_th_g; @@ -1321,6 +1328,7 @@ static void cmd_add_port_tm_node_wred_profile_parsed(void *parsed_result, (void *)&cmd_add_port_tm_node_wred_profile_profile, (void *)&cmd_add_port_tm_node_wred_profile_port_id, (void *)&cmd_add_port_tm_node_wred_profile_wred_profile_id, + (void *)&cmd_add_port_tm_node_wred_profile_packet_mode, (void *)&cmd_add_port_tm_node_wred_profile_color_g, (void *)&cmd_add_port_tm_node_wred_profile_min_th_g, (void *)&cmd_add_port_tm_node_wred_profile_max_th_g, diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index cbf23e9..e10487c 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -2666,7 +2666,7 @@ Add port traffic management WRED profile Create a new WRED profile:: - testpmd> add port tm node wred profile (port_id) (wred_profile_id) \ + testpmd> add port tm node wred profile (port_id) (wred_profile_id) (packet_mode) \ (color_g) (min_th_g) (max_th_g) (maxp_inv_g) (wq_log2_g) \ (color_y) (min_th_y) (max_th_y) (maxp_inv_y) (wq_log2_y) \ (color_r) (min_th_r) (max_th_r) (maxp_inv_r) (wq_log2_r) @@ -2674,6 +2674,8 @@ Create a new WRED profile:: where: * ``wred_profile id``: Identifier for the newly create WRED profile +* ``packet_mode``: WRED profile mode. If non-zero, min_th/max_th are specified + in packets, else, min_th/max_th are specified in bytes * ``color_g``: Packet color (green) * ``min_th_g``: Minimum queue threshold for packet with green color * ``max_th_g``: Minimum queue threshold for packet with green color