From: Nikhil Rao <nikhil.rao@intel.com>
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 <nikhil.rao@intel.com>,
stable@dpdk.org
Subject: [dpdk-dev] [PATCH] app/testpmd: initialize WRED profile packet mode from cli
Date: Thu, 10 Jan 2019 18:20:45 +0530 [thread overview]
Message-ID: <1547124645-90122-1-git-send-email-nikhil.rao@intel.com> (raw)
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
next reply other threads:[~2019-01-10 12:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-10 12:50 Nikhil Rao [this message]
2019-02-14 2:03 ` Wu, Jingjing
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1547124645-90122-1-git-send-email-nikhil.rao@intel.com \
--to=nikhil.rao@intel.com \
--cc=bernard.iremonger@intel.com \
--cc=cristian.dumitrescu@intel.com \
--cc=dev@dpdk.org \
--cc=jasvinder.singh@intel.com \
--cc=jingjing.wu@intel.com \
--cc=stable@dpdk.org \
--cc=wenzhuo.lu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).