DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/testpmd: initialize WRED profile packet mode from cli
@ 2019-01-10 12:50 Nikhil Rao
  2019-02-14  2:03 ` Wu, Jingjing
  0 siblings, 1 reply; 2+ messages in thread
From: Nikhil Rao @ 2019-01-10 12:50 UTC (permalink / raw)
  To: wenzhuo.lu, jingjing.wu, bernard.iremonger
  Cc: dev, cristian.dumitrescu, jasvinder.singh, Nikhil Rao, stable

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 <nikhil.rao@intel.com>
---
 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
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: initialize WRED profile packet mode from cli
  2019-01-10 12:50 [dpdk-dev] [PATCH] app/testpmd: initialize WRED profile packet mode from cli Nikhil Rao
@ 2019-02-14  2:03 ` Wu, Jingjing
  0 siblings, 0 replies; 2+ messages in thread
From: Wu, Jingjing @ 2019-02-14  2:03 UTC (permalink / raw)
  To: Rao, Nikhil, Lu, Wenzhuo, Iremonger, Bernard
  Cc: dev, Dumitrescu, Cristian, Singh, Jasvinder, stable



> -----Original Message-----
> From: Rao, Nikhil
> Sent: Thursday, January 10, 2019 8:51 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>;
> Iremonger, Bernard <bernard.iremonger@intel.com>
> Cc: dev@dpdk.org; Dumitrescu, Cristian <cristian.dumitrescu@intel.com>; Singh,
> Jasvinder <jasvinder.singh@intel.com>; Rao, Nikhil <nikhil.rao@intel.com>;
> stable@dpdk.org
> Subject: [PATCH] app/testpmd: initialize WRED profile packet mode from cli
> 
> 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 <nikhil.rao@intel.com>

Acked-by: Jingjing Wu <jingjing.wu@intel.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-02-14  2:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-10 12:50 [dpdk-dev] [PATCH] app/testpmd: initialize WRED profile packet mode from cli Nikhil Rao
2019-02-14  2:03 ` Wu, Jingjing

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).