From: Rosen Xu <rosen.xu@intel.com>
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
Subject: [dpdk-dev] [PATCH] app/test-pmd: add and identify shaper profile parameters
Date: Mon, 13 Aug 2018 18:34:58 +0800 [thread overview]
Message-ID: <1534156498-57837-1-git-send-email-rosen.xu@intel.com> (raw)
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 <rosen.xu@intel.com>
Fixes: bddc2f40b594 ("app/testpmd: add commands for shaper and wred profiles")
Cc: jasvinder.singh@intel.com
---
app/test-pmd/cmdline_tm.c | 34 ++++++++++++++++++++++++----------
1 file changed, 24 insertions(+), 10 deletions(-)
diff --git a/app/test-pmd/cmdline_tm.c b/app/test-pmd/cmdline_tm.c
index 631f179..8ee2785 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,
},
--
1.8.3.1
next reply other threads:[~2018-08-13 10:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-13 10:34 Rosen Xu [this message]
2018-09-25 11:55 ` Singh, Jasvinder
2018-10-16 15:00 ` Dumitrescu, Cristian
2018-10-17 10:01 ` Xu, Rosen
2018-10-22 8:48 ` Xu, Rosen
2018-10-22 8:49 ` Xu, Rosen
2018-10-22 8:46 ` [dpdk-dev] [PATCH v2 0/2] Add " Rosen Xu
2018-10-22 8:46 ` [dpdk-dev] [PATCH v2 1/2] [PATCH v2 1/2] app/test-pmd: add " Rosen Xu
2018-10-22 8:46 ` [dpdk-dev] [PATCH v2 2/2] [PATCH v2 2/2] doc/guides/testpmd_app_ug: update documentation for added " Rosen Xu
2018-10-22 12:28 ` Kovacevic, Marko
2018-10-22 9:34 ` [dpdk-dev] [PATCH v2 0/2] Add and identify " Singh, Jasvinder
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=1534156498-57837-1-git-send-email-rosen.xu@intel.com \
--to=rosen.xu@intel.com \
--cc=cristian.dumitrescu@intel.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=jasvinder.singh@intel.com \
--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).