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: sta...@dpdk.org Signed-off-by: Nikhil Rao <nikhil....@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