From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id DD7DCA059F; Sat, 11 Apr 2020 13:45:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 882B61C1B1; Sat, 11 Apr 2020 13:44:53 +0200 (CEST) Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by dpdk.org (Postfix) with ESMTP id 97C8B1C1B1 for ; Sat, 11 Apr 2020 13:44:51 +0200 (CEST) Received: by mail-pg1-f196.google.com with SMTP id g32so2141087pgb.6 for ; Sat, 11 Apr 2020 04:44:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=T1ZQW599WhJbGUqDYfUXusIfKNhLdEcrph/IYTxjQxs=; b=Y6yb4BHo+XekU32bDZDGEWMC5WBBBr4Z/566SgGy6rVvcffAjkcGXkgEQbK8ivrDm5 UP+l/Fxks5c/fwI2zAae48ycffdt2PQZmLSrv79nfW+fVnA2pqe84wNQ1G6deY3EwQ8S ygLxwb5Ntk043REpOVLFCTqfxJgFEPkklvcCzTirfmHlIgbYfLpZxzENI+WtILnT9zIU TJoJ17UaGgFuWnsLpS/Mf+44pBDZy+desAz3wqD6rIo2g8+xgwmHuiS8vNx+lVOngcmt DXSh8To15ZItAIm3/02/vW20PNR8N27GOr4N8hgaB9qMfBKtBGxo0nFlichLjhM+edmE QU2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=T1ZQW599WhJbGUqDYfUXusIfKNhLdEcrph/IYTxjQxs=; b=RD3dAs/tc2FRIwwoJd5rIxMjNEv+jw+7Mhuz83Vsk5aAZTWyaNrPz3AvYrAcHJDBIn QpufwoDF+sBfE0K8LDghy1u4ZuQAtvHQJsszJzsVLVZDjX50mDFOXM8GVV3N3piFisYm t5ku9yn8i8msdkjbdz406L1I+G+05dB5kVTZ/izlxOBdTSIYw6wLbbQV87TdQ+tOrDex umCd5pwfPCjMtcuOTO3Sj47h+/pMEXyXRev5lvSSTu5N4uERfTMB6wABFOinF05NMQ2M oP4EJpmYS9MdYfI/JjY0TSiWQwQYPi2+q/CrGZhjhaFymFHo7U6+pn+8Xb1PZ/RPFVq2 aHEQ== X-Gm-Message-State: AGi0PuZWFLeKbJ0ghEDM3tKOTZgy4Cd9O50JTN35gwdSCRkvTiOeUzyp zOoyB5xdY2ko210+EqhiafQ= X-Google-Smtp-Source: APiQypJfVM0RNJrAVBDI1AyyOgfsDfGv70YbBBqNJSu/ygufknQHPrZdabfKVhnBjo9u4qviUc2YLg== X-Received: by 2002:a63:6e43:: with SMTP id j64mr8380609pgc.41.1586605490658; Sat, 11 Apr 2020 04:44:50 -0700 (PDT) Received: from hyd1588t430.marvell.com ([115.113.156.2]) by smtp.gmail.com with ESMTPSA id mg20sm4004793pjb.12.2020.04.11.04.44.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 11 Apr 2020 04:44:50 -0700 (PDT) From: Nithin Dabilpuram To: Wenzhuo Lu , Jingjing Wu , Bernard Iremonger , John McNamara , Marko Kovacevic Cc: dev@dpdk.org, jerinj@marvell.com, kkanas@marvell.com, Nithin Dabilpuram Date: Sat, 11 Apr 2020 17:14:29 +0530 Message-Id: <20200411114430.18506-3-nithind1988@gmail.com> X-Mailer: git-send-email 2.8.4 In-Reply-To: <20200411114430.18506-1-nithind1988@gmail.com> References: <20200330160019.29674-1-ndabilpuram@marvell.com> <20200411114430.18506-1-nithind1988@gmail.com> Subject: [dpdk-dev] [PATCH v2 3/4] app/testpmd: add tm cmd for non leaf and shaper pktmode 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" From: Nithin Dabilpuram Add TM command to enable packet mode for all SP children in non leaf node. This is a new command as "add tm nonleaf node pktmode". Also add support to shaper profile add command to take packet mode parameter used to setup shaper in packet mode. This adds an extra argument "packet_mode" to shaper profile add command "add port tm node shaper profile" as last argument. This patch also dumps new tm port/level/node capabilities sched_wfq_packet_mode_supported, sched_wfq_byte_mode_supported, shaper_private_packet_mode_supported, shaper_private_byte_mode_supported, shaper_shared_packet_mode_supported, shaper_shared_byte_mode_supported. Signed-off-by: Nithin Dabilpuram --- v1..v2: - Update tm capability show cmd to dump lastest pktmode/bytemode fields of v2. - Update existing shaper profile add command to take last argument as pkt_mode and update struct rte_tm_shaper_params:packet_mode with the same. - Update documentation with latest command changes. app/test-pmd/cmdline.c | 9 +- app/test-pmd/cmdline_tm.c | 206 ++++++++++++++++++++++++++++ app/test-pmd/cmdline_tm.h | 1 + doc/guides/testpmd_app_ug/testpmd_funcs.rst | 40 +++++- 4 files changed, 250 insertions(+), 6 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 863b567..af90242 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -1189,7 +1189,7 @@ static void cmd_help_long_parsed(void *parsed_result, "add port tm node shaper profile (port_id) (shaper_profile_id)" " (cmit_tb_rate) (cmit_tb_size) (peak_tb_rate) (peak_tb_size)" - " (packet_length_adjust)\n" + " (packet_length_adjust) (packet_mode)\n" " Add port tm node private shaper profile.\n\n" "del port tm node shaper profile (port_id) (shaper_profile_id)\n" @@ -1221,6 +1221,12 @@ static void cmd_help_long_parsed(void *parsed_result, " [(shared_shaper_id_0) (shared_shaper_id_1)...]\n" " Add port tm nonleaf node.\n\n" + "add port tm nonleaf node pktmode (port_id) (node_id) (parent_node_id)" + " (priority) (weight) (level_id) (shaper_profile_id)" + " (n_sp_priorities) (stats_mask) (n_shared_shapers)" + " [(shared_shaper_id_0) (shared_shaper_id_1)...]\n" + " Add port tm nonleaf node with pkt mode enabled.\n\n" + "add port tm leaf node (port_id) (node_id) (parent_node_id)" " (priority) (weight) (level_id) (shaper_profile_id)" " (cman_mode) (wred_profile_id) (stats_mask) (n_shared_shapers)" @@ -19636,6 +19642,7 @@ cmdline_parse_ctx_t main_ctx[] = { (cmdline_parse_inst_t *)&cmd_del_port_tm_node_wred_profile, (cmdline_parse_inst_t *)&cmd_set_port_tm_node_shaper_profile, (cmdline_parse_inst_t *)&cmd_add_port_tm_nonleaf_node, + (cmdline_parse_inst_t *)&cmd_add_port_tm_nonleaf_node_pmode, (cmdline_parse_inst_t *)&cmd_add_port_tm_leaf_node, (cmdline_parse_inst_t *)&cmd_del_port_tm_node, (cmdline_parse_inst_t *)&cmd_set_port_tm_node_parent, diff --git a/app/test-pmd/cmdline_tm.c b/app/test-pmd/cmdline_tm.c index d62a4f5..c9a2813 100644 --- a/app/test-pmd/cmdline_tm.c +++ b/app/test-pmd/cmdline_tm.c @@ -257,6 +257,10 @@ static void cmd_show_port_tm_cap_parsed(void *parsed_result, cap.shaper_private_rate_min); printf("cap.shaper_private_rate_max %" PRIu64 "\n", cap.shaper_private_rate_max); + printf("cap.shaper_private_packet_mode_supported %" PRId32 "\n", + cap.shaper_private_packet_mode_supported); + printf("cap.shaper_private_byte_mode_supported %" PRId32 "\n", + cap.shaper_private_byte_mode_supported); printf("cap.shaper_shared_n_max %" PRIu32 "\n", cap.shaper_shared_n_max); printf("cap.shaper_shared_n_nodes_per_shaper_max %" PRIu32 "\n", @@ -269,6 +273,10 @@ static void cmd_show_port_tm_cap_parsed(void *parsed_result, cap.shaper_shared_rate_min); printf("cap.shaper_shared_rate_max %" PRIu64 "\n", cap.shaper_shared_rate_max); + printf("cap.shaper_shared_packet_mode_supported %" PRId32 "\n", + cap.shaper_shared_packet_mode_supported); + printf("cap.shaper_shared_byte_mode_supported %" PRId32 "\n", + cap.shaper_shared_byte_mode_supported); printf("cap.shaper_pkt_length_adjust_min %" PRId32 "\n", cap.shaper_pkt_length_adjust_min); printf("cap.shaper_pkt_length_adjust_max %" PRId32 "\n", @@ -283,6 +291,10 @@ static void cmd_show_port_tm_cap_parsed(void *parsed_result, cap.sched_wfq_n_groups_max); printf("cap.sched_wfq_weight_max %" PRIu32 "\n", cap.sched_wfq_weight_max); + printf("cap.sched_wfq_packet_mode_supported %" PRId32 "\n", + cap.sched_wfq_packet_mode_supported); + printf("cap.sched_wfq_byte_mode_supported %" PRId32 "\n", + cap.sched_wfq_byte_mode_supported); printf("cap.cman_head_drop_supported %" PRId32 "\n", cap.cman_head_drop_supported); printf("cap.cman_wred_context_n_max %" PRIu32 "\n", @@ -401,6 +413,11 @@ static void cmd_show_port_tm_level_cap_parsed(void *parsed_result, lcap.nonleaf.shaper_private_rate_min); printf("cap.nonleaf.shaper_private_rate_max %" PRIu64 "\n", lcap.nonleaf.shaper_private_rate_max); + printf("cap.nonleaf.shaper_private_packet_mode_supported %" + PRId32 "\n", + lcap.nonleaf.shaper_private_packet_mode_supported); + printf("cap.nonleaf.shaper_private_byte_mode_supported %" PRId32 + "\n", lcap.nonleaf.shaper_private_byte_mode_supported); printf("cap.nonleaf.shaper_shared_n_max %" PRIu32 "\n", lcap.nonleaf.shaper_shared_n_max); printf("cap.nonleaf.sched_n_children_max %" PRIu32 "\n", @@ -413,6 +430,10 @@ static void cmd_show_port_tm_level_cap_parsed(void *parsed_result, lcap.nonleaf.sched_wfq_n_groups_max); printf("cap.nonleaf.sched_wfq_weight_max %" PRIu32 "\n", lcap.nonleaf.sched_wfq_weight_max); + printf("cap.nonleaf.sched_wfq_packet_mode_supported %" PRId32 "\n", + lcap.nonleaf.sched_wfq_packet_mode_supported); + printf("cap.nonleaf.sched_wfq_byte_mode_supported %" PRId32 + "\n", lcap.nonleaf.sched_wfq_byte_mode_supported); printf("cap.nonleaf.stats_mask %" PRIx64 "\n", lcap.nonleaf.stats_mask); } else { @@ -424,6 +445,10 @@ static void cmd_show_port_tm_level_cap_parsed(void *parsed_result, lcap.leaf.shaper_private_rate_min); printf("cap.leaf.shaper_private_rate_max %" PRIu64 "\n", lcap.leaf.shaper_private_rate_max); + printf("cap.leaf.shaper_private_packet_mode_supported %" PRId32 + "\n", lcap.leaf.shaper_private_packet_mode_supported); + printf("cap.leaf.shaper_private_byte_mode_supported %" PRId32 "\n", + lcap.leaf.shaper_private_byte_mode_supported); printf("cap.leaf.shaper_shared_n_max %" PRIu32 "\n", lcap.leaf.shaper_shared_n_max); printf("cap.leaf.cman_head_drop_supported %" PRId32 "\n", @@ -524,6 +549,10 @@ static void cmd_show_port_tm_node_cap_parsed(void *parsed_result, ncap.shaper_private_rate_min); printf("cap.shaper_private_rate_max %" PRIu64 "\n", ncap.shaper_private_rate_max); + printf("cap.shaper_private_packet_mode_supported %" PRId32 "\n", + ncap.shaper_private_packet_mode_supported); + printf("cap.shaper_private_byte_mode_supported %" PRId32 "\n", + ncap.shaper_private_byte_mode_supported); printf("cap.shaper_shared_n_max %" PRIu32 "\n", ncap.shaper_shared_n_max); if (!is_leaf) { @@ -537,6 +566,10 @@ static void cmd_show_port_tm_node_cap_parsed(void *parsed_result, ncap.nonleaf.sched_wfq_n_groups_max); printf("cap.nonleaf.sched_wfq_weight_max %" PRIu32 "\n", ncap.nonleaf.sched_wfq_weight_max); + printf("cap.nonleaf.sched_wfq_packet_mode_supported %" PRId32 "\n", + ncap.nonleaf.sched_wfq_packet_mode_supported); + printf("cap.nonleaf.sched_wfq_byte_mode_supported %" PRId32 "\n", + ncap.nonleaf.sched_wfq_byte_mode_supported); } else { printf("cap.leaf.cman_head_drop_supported %" PRId32 "\n", ncap.leaf.cman_head_drop_supported); @@ -776,6 +809,7 @@ struct cmd_add_port_tm_node_shaper_profile_result { uint64_t peak_tb_rate; uint64_t peak_tb_size; uint32_t pktlen_adjust; + int pkt_mode; }; cmdline_parse_token_string_t cmd_add_port_tm_node_shaper_profile_add = @@ -829,6 +863,10 @@ 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, pktlen_adjust, UINT32); +cmdline_parse_token_num_t cmd_add_port_tm_node_shaper_profile_packet_mode = + TOKEN_NUM_INITIALIZER( + struct cmd_add_port_tm_node_shaper_profile_result, + pkt_mode, UINT32); static void cmd_add_port_tm_node_shaper_profile_parsed(void *parsed_result, __attribute__((unused)) struct cmdline *cl, @@ -853,6 +891,7 @@ static void cmd_add_port_tm_node_shaper_profile_parsed(void *parsed_result, sp.peak.rate = res->peak_tb_rate; sp.peak.size = res->peak_tb_size; sp.pkt_length_adjust = pkt_len_adjust; + sp.packet_mode = res->pkt_mode; ret = rte_tm_shaper_profile_add(port_id, shaper_id, &sp, &error); if (ret != 0) { @@ -879,6 +918,7 @@ cmdline_parse_inst_t cmd_add_port_tm_node_shaper_profile = { (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, + (void *)&cmd_add_port_tm_node_shaper_profile_packet_mode, NULL, }, }; @@ -1671,6 +1711,172 @@ cmdline_parse_inst_t cmd_add_port_tm_nonleaf_node = { }, }; +/* *** Add Port TM nonleaf node pkt mode *** */ +struct cmd_add_port_tm_nonleaf_node_pmode_result { + cmdline_fixed_string_t add; + cmdline_fixed_string_t port; + cmdline_fixed_string_t tm; + cmdline_fixed_string_t nonleaf; + cmdline_fixed_string_t node; + uint16_t port_id; + uint32_t node_id; + int32_t parent_node_id; + uint32_t priority; + uint32_t weight; + uint32_t level_id; + int32_t shaper_profile_id; + uint32_t n_sp_priorities; + uint64_t stats_mask; + cmdline_multi_string_t multi_shared_shaper_id; +}; + +cmdline_parse_token_string_t cmd_add_port_tm_nonleaf_node_pmode_add = + TOKEN_STRING_INITIALIZER( + struct cmd_add_port_tm_nonleaf_node_pmode_result, add, "add"); +cmdline_parse_token_string_t cmd_add_port_tm_nonleaf_node_pmode_port = + TOKEN_STRING_INITIALIZER( + struct cmd_add_port_tm_nonleaf_node_pmode_result, port, "port"); +cmdline_parse_token_string_t cmd_add_port_tm_nonleaf_node_pmode_tm = + TOKEN_STRING_INITIALIZER( + struct cmd_add_port_tm_nonleaf_node_pmode_result, tm, "tm"); +cmdline_parse_token_string_t cmd_add_port_tm_nonleaf_node_pmode_nonleaf = + TOKEN_STRING_INITIALIZER( + struct cmd_add_port_tm_nonleaf_node_pmode_result, nonleaf, "nonleaf"); +cmdline_parse_token_string_t cmd_add_port_tm_nonleaf_node_pmode_node = + TOKEN_STRING_INITIALIZER( + struct cmd_add_port_tm_nonleaf_node_pmode_result, node, "node"); +cmdline_parse_token_string_t cmd_add_port_tm_nonleaf_node_pmode_pktmode = + TOKEN_STRING_INITIALIZER( + struct cmd_add_port_tm_nonleaf_node_pmode_result, node, "pktmode"); +cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_pmode_port_id = + TOKEN_NUM_INITIALIZER( + struct cmd_add_port_tm_nonleaf_node_pmode_result, + port_id, UINT16); +cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_pmode_node_id = + TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_pmode_result, + node_id, UINT32); +cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_pmode_parent_node_id = + TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_pmode_result, + parent_node_id, INT32); +cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_pmode_priority = + TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_pmode_result, + priority, UINT32); +cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_pmode_weight = + TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_pmode_result, + weight, UINT32); +cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_pmode_level_id = + TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_pmode_result, + level_id, UINT32); +cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_pmode_shaper_profile_id = + TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_pmode_result, + shaper_profile_id, INT32); +cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_pmode_n_sp_priorities = + TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_pmode_result, + n_sp_priorities, UINT32); +cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_pmode_stats_mask = + TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_pmode_result, + stats_mask, UINT64); +cmdline_parse_token_string_t + cmd_add_port_tm_nonleaf_node_pmode_multi_shrd_shpr_id = + TOKEN_STRING_INITIALIZER( + struct cmd_add_port_tm_nonleaf_node_pmode_result, + multi_shared_shaper_id, TOKEN_STRING_MULTI); + +static void cmd_add_port_tm_nonleaf_node_pmode_parsed(void *parsed_result, + __attribute__((unused)) struct cmdline *cl, + __attribute__((unused)) void *data) +{ + struct cmd_add_port_tm_nonleaf_node_pmode_result *res = parsed_result; + uint32_t parent_node_id, n_shared_shapers = 0; + char *s_str = res->multi_shared_shaper_id; + portid_t port_id = res->port_id; + struct rte_tm_node_params np; + int *wfq_weight_mode = NULL; + uint32_t *shared_shaper_id; + struct rte_tm_error error; + int ret; + + if (port_id_is_invalid(port_id, ENABLED_WARN)) + return; + + memset(&np, 0, sizeof(struct rte_tm_node_params)); + memset(&error, 0, sizeof(struct rte_tm_error)); + + /* Node parameters */ + if (res->parent_node_id < 0) + parent_node_id = UINT32_MAX; + else + parent_node_id = res->parent_node_id; + + shared_shaper_id = (uint32_t *)malloc(MAX_NUM_SHARED_SHAPERS * + sizeof(uint32_t)); + if (shared_shaper_id == NULL) { + printf(" Memory not allocated for shared shapers (error)\n"); + return; + } + + /* Parse multi shared shaper id string */ + ret = parse_multi_ss_id_str(s_str, &n_shared_shapers, shared_shaper_id); + if (ret) { + printf(" Shared shapers params string parse error\n"); + free(shared_shaper_id); + return; + } + + if (res->shaper_profile_id < 0) + np.shaper_profile_id = UINT32_MAX; + else + np.shaper_profile_id = res->shaper_profile_id; + + np.n_shared_shapers = n_shared_shapers; + if (np.n_shared_shapers) { + np.shared_shaper_id = &shared_shaper_id[0]; + } else { + free(shared_shaper_id); + shared_shaper_id = NULL; + } + + if (res->n_sp_priorities) + wfq_weight_mode = calloc(res->n_sp_priorities, sizeof(int)); + np.nonleaf.n_sp_priorities = res->n_sp_priorities; + np.stats_mask = res->stats_mask; + np.nonleaf.wfq_weight_mode = wfq_weight_mode; + + ret = rte_tm_node_add(port_id, res->node_id, parent_node_id, + res->priority, res->weight, res->level_id, + &np, &error); + if (ret != 0) { + print_err_msg(&error); + free(shared_shaper_id); + free(wfq_weight_mode); + return; + } +} + +cmdline_parse_inst_t cmd_add_port_tm_nonleaf_node_pmode = { + .f = cmd_add_port_tm_nonleaf_node_pmode_parsed, + .data = NULL, + .help_str = "Add port tm nonleaf node pktmode", + .tokens = { + (void *)&cmd_add_port_tm_nonleaf_node_pmode_add, + (void *)&cmd_add_port_tm_nonleaf_node_pmode_port, + (void *)&cmd_add_port_tm_nonleaf_node_pmode_tm, + (void *)&cmd_add_port_tm_nonleaf_node_pmode_nonleaf, + (void *)&cmd_add_port_tm_nonleaf_node_pmode_node, + (void *)&cmd_add_port_tm_nonleaf_node_pmode_pktmode, + (void *)&cmd_add_port_tm_nonleaf_node_pmode_port_id, + (void *)&cmd_add_port_tm_nonleaf_node_pmode_node_id, + (void *)&cmd_add_port_tm_nonleaf_node_pmode_parent_node_id, + (void *)&cmd_add_port_tm_nonleaf_node_pmode_priority, + (void *)&cmd_add_port_tm_nonleaf_node_pmode_weight, + (void *)&cmd_add_port_tm_nonleaf_node_pmode_level_id, + (void *)&cmd_add_port_tm_nonleaf_node_pmode_shaper_profile_id, + (void *)&cmd_add_port_tm_nonleaf_node_pmode_n_sp_priorities, + (void *)&cmd_add_port_tm_nonleaf_node_pmode_stats_mask, + (void *)&cmd_add_port_tm_nonleaf_node_pmode_multi_shrd_shpr_id, + NULL, + }, +}; /* *** Add Port TM leaf node *** */ struct cmd_add_port_tm_leaf_node_result { cmdline_fixed_string_t add; diff --git a/app/test-pmd/cmdline_tm.h b/app/test-pmd/cmdline_tm.h index 950cb75..e59c15c 100644 --- a/app/test-pmd/cmdline_tm.h +++ b/app/test-pmd/cmdline_tm.h @@ -19,6 +19,7 @@ extern cmdline_parse_inst_t cmd_add_port_tm_node_wred_profile; extern cmdline_parse_inst_t cmd_del_port_tm_node_wred_profile; extern cmdline_parse_inst_t cmd_set_port_tm_node_shaper_profile; extern cmdline_parse_inst_t cmd_add_port_tm_nonleaf_node; +extern cmdline_parse_inst_t cmd_add_port_tm_nonleaf_node_pmode; extern cmdline_parse_inst_t cmd_add_port_tm_leaf_node; extern cmdline_parse_inst_t cmd_del_port_tm_node; extern cmdline_parse_inst_t cmd_set_port_tm_node_parent; diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index dcee5de..a058f75 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -2840,19 +2840,22 @@ Add the port traffic management private shaper profile:: testpmd> add port tm node shaper profile (port_id) (shaper_profile_id) \ (cmit_tb_rate) (cmit_tb_size) (peak_tb_rate) (peak_tb_size) \ - (packet_length_adjust) + (packet_length_adjust) (packet_mode) where: * ``shaper_profile id``: Shaper profile ID for the new profile. -* ``cmit_tb_rate``: Committed token bucket rate (bytes per second). -* ``cmit_tb_size``: Committed token bucket size (bytes). -* ``peak_tb_rate``: Peak token bucket rate (bytes per second). -* ``peak_tb_size``: Peak token bucket size (bytes). +* ``cmit_tb_rate``: Committed token bucket rate (bytes per second or packets per second). +* ``cmit_tb_size``: Committed token bucket size (bytes or packets). +* ``peak_tb_rate``: Peak token bucket rate (bytes per second or packets per second). +* ``peak_tb_size``: Peak token bucket size (bytes or packets). * ``packet_length_adjust``: The value (bytes) to be added to the length of each packet for the purpose of shaping. This parameter value can be used to correct the packet length with the framing overhead bytes that are consumed on the wire. +* ``packet_mode``: Shaper configured in packet mode. This parameter value if + zero, configures shaper in byte mode and if non-zero configures it in packet + mode. Delete port traffic management private shaper profile ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2977,6 +2980,33 @@ where: * ``n_shared_shapers``: Number of shared shapers. * ``shared_shaper_id``: Shared shaper id. +Add port traffic management hierarchy nonleaf node with packet mode +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Add nonleaf node with packet mode to port traffic management hierarchy:: + + testpmd> add port tm nonleaf node pktmode (port_id) (node_id) (parent_node_id) \ + (priority) (weight) (level_id) (shaper_profile_id) \ + (n_sp_priorities) (stats_mask) (n_shared_shapers) \ + [(shared_shaper_0) (shared_shaper_1) ...] \ + +where: + +* ``parent_node_id``: Node ID of the parent. +* ``priority``: Node priority (highest node priority is zero). This is used by + the SP algorithm running on the parent node for scheduling this node. +* ``weight``: Node weight (lowest weight is one). The node weight is relative + to the weight sum of all siblings that have the same priority. It is used by + the WFQ algorithm running on the parent node for scheduling this node. +* ``level_id``: Hierarchy level of the node. +* ``shaper_profile_id``: Shaper profile ID of the private shaper to be used by + the node. +* ``n_sp_priorities``: Number of strict priorities. Packet mode is enabled on + all of them. +* ``stats_mask``: Mask of statistics counter types to be enabled for this node. +* ``n_shared_shapers``: Number of shared shapers. +* ``shared_shaper_id``: Shared shaper id. + Add port traffic management hierarchy leaf node ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- 2.8.4