DPDK patches and discussions
 help / color / mirror / Atom feed
From: Wenzhuo Lu <wenzhuo.lu@intel.com>
To: dev@dpdk.org
Cc: Wenzhuo Lu <wenzhuo.lu@intel.com>
Subject: [dpdk-dev] [PATCH 8/8] app/testpmd: set TC strict link priority mode
Date: Fri, 24 Feb 2017 11:24:35 +0800	[thread overview]
Message-ID: <1487906675-54260-9-git-send-email-wenzhuo.lu@intel.com> (raw)
In-Reply-To: <1487906675-54260-1-git-send-email-wenzhuo.lu@intel.com>

Add a CLI to set some TCs' strict link priority mode
on a physical port.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
 app/test-pmd/cmdline.c                      | 62 +++++++++++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 ++++
 2 files changed, 69 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 0cf509a..a2d4c00 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -324,6 +324,9 @@ static void cmd_help_long_parsed(void *parsed_result,
 			"set vf tc tx max-bandwidth (port_id) (vf_id) (tc_no) (bandwidth)\n"
 			"    Set a TC's max bandwidth(Mbps) on a VF.\n\n"
 
+			"set tx strict-link-priority (port_id) (tc_bitmap)\n"
+			"    Set some TCs' strict link priority mode on a physical port.\n\n"
+
 			"vlan set filter (on|off) (port_id)\n"
 			"    Set the VLAN filter on a port.\n\n"
 
@@ -12412,11 +12415,13 @@ struct cmd_vf_tc_bw_result {
 	cmdline_fixed_string_t tx;
 	cmdline_fixed_string_t min_bw;
 	cmdline_fixed_string_t max_bw;
+	cmdline_fixed_string_t strict_link_prio;
 	uint8_t port_id;
 	uint16_t vf_id;
 	uint8_t tc_no;
 	uint32_t bw;
 	cmdline_fixed_string_t bw_list;
+	uint8_t tc_map;
 };
 
 cmdline_parse_token_string_t cmd_vf_tc_bw_set =
@@ -12435,6 +12440,10 @@ struct cmd_vf_tc_bw_result {
 	TOKEN_STRING_INITIALIZER
 		(struct cmd_vf_tc_bw_result,
 		 tx, "tx");
+cmdline_parse_token_string_t cmd_vf_tc_bw_strict_link_prio =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_tc_bw_result,
+		 strict_link_prio, "strict-link-priority");
 cmdline_parse_token_string_t cmd_vf_tc_bw_min_bw =
 	TOKEN_STRING_INITIALIZER
 		(struct cmd_vf_tc_bw_result,
@@ -12463,6 +12472,10 @@ struct cmd_vf_tc_bw_result {
 	TOKEN_STRING_INITIALIZER
 		(struct cmd_vf_tc_bw_result,
 		 bw_list, NULL);
+cmdline_parse_token_num_t cmd_vf_tc_bw_tc_map =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_tc_bw_result,
+		 tc_map, UINT8);
 
 /* VF max bandwidth setting */
 static void
@@ -12672,6 +12685,54 @@ struct cmd_vf_tc_bw_result {
 	},
 };
 
+/* Strict link priority scheduling mode setting */
+static void
+cmd_strict_link_prio_parsed(
+	void *parsed_result,
+	__attribute__((unused)) struct cmdline *cl,
+	__attribute__((unused)) void *data)
+{
+	struct cmd_vf_tc_bw_result *res = parsed_result;
+	int ret = -ENOTSUP;
+
+	if (port_id_is_invalid(res->port_id, ENABLED_WARN))
+		return;
+
+#ifdef RTE_LIBRTE_I40E_PMD
+	ret = rte_pmd_i40e_set_tc_strict_prio(res->port_id, res->tc_map);
+#endif
+
+	switch (ret) {
+	case 0:
+		break;
+	case -EINVAL:
+		printf("invalid tc_bitmap 0x%x\n", res->tc_map);
+		break;
+	case -ENODEV:
+		printf("invalid port_id %d\n", res->port_id);
+		break;
+	case -ENOTSUP:
+		printf("function not implemented\n");
+		break;
+	default:
+		printf("programming error: (%s)\n", strerror(-ret));
+	}
+}
+
+cmdline_parse_inst_t cmd_strict_link_prio = {
+	.f = cmd_strict_link_prio_parsed,
+	.data = NULL,
+	.help_str = "set tx strict-link-priority <port_id> <tc_bitmap>",
+	.tokens = {
+		(void *)&cmd_vf_tc_bw_set,
+		(void *)&cmd_vf_tc_bw_tx,
+		(void *)&cmd_vf_tc_bw_strict_link_prio,
+		(void *)&cmd_vf_tc_bw_port_id,
+		(void *)&cmd_vf_tc_bw_tc_map,
+		NULL,
+	},
+};
+
 
 /* ******************************************************************************** */
 
@@ -12851,6 +12912,7 @@ struct cmd_vf_tc_bw_result {
 	(cmdline_parse_inst_t *)&cmd_vf_max_bw,
 	(cmdline_parse_inst_t *)&cmd_vf_tc_min_bw,
 	(cmdline_parse_inst_t *)&cmd_vf_tc_max_bw,
+	(cmdline_parse_inst_t *)&cmd_strict_link_prio,
 	NULL,
 };
 
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 7d965e2..de4e8a5 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -907,6 +907,13 @@ Set a TC's TX max absolute bandwidth (Mbps) for a VF from PF::
 
    testpmd> set vf tc tx max-bandwidth (port_id) (vf_id) (tc_no) (max_bandwidth)
 
+set tc strict link priority mode
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set some TCs' strict link priority mode on a physical port::
+
+   testpmd> set tx strict-link-priority (port_id) (tc_bitmap)
+
 set flow_ctrl rx
 ~~~~~~~~~~~~~~~~
 
-- 
1.9.3

  parent reply	other threads:[~2017-02-24  3:24 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-24  3:24 [dpdk-dev] [PATCH 0/8] QoS features on i40e Wenzhuo Lu
2017-02-24  3:24 ` [dpdk-dev] [PATCH 1/8] net/i40e: set VF max bandwidth from PF Wenzhuo Lu
2017-03-24  5:01   ` Wu, Jingjing
2017-02-24  3:24 ` [dpdk-dev] [PATCH 2/8] net/i40e: allocate VF TC " Wenzhuo Lu
2017-03-24  5:10   ` Wu, Jingjing
2017-02-24  3:24 ` [dpdk-dev] [PATCH 3/8] net/i40e: set VF TC max " Wenzhuo Lu
2017-03-24  5:15   ` Wu, Jingjing
2017-02-24  3:24 ` [dpdk-dev] [PATCH 4/8] net/i40e: set TC strict priority mode Wenzhuo Lu
2017-03-24  5:19   ` Wu, Jingjing
2017-03-24  7:07     ` Lu, Wenzhuo
2017-03-24  9:34       ` Wu, Jingjing
2017-02-24  3:24 ` [dpdk-dev] [PATCH 5/8] app/testpmd: set VF TX max bandwidth Wenzhuo Lu
2017-03-24  5:21   ` Wu, Jingjing
2017-02-24  3:24 ` [dpdk-dev] [PATCH 6/8] app/testpmd: set VF TC TX min bandwidth Wenzhuo Lu
2017-03-24  5:22   ` Wu, Jingjing
2017-02-24  3:24 ` [dpdk-dev] [PATCH 7/8] app/testpmd: set VF TC TX max bandwidth Wenzhuo Lu
2017-03-24  5:22   ` Wu, Jingjing
2017-02-24  3:24 ` Wenzhuo Lu [this message]
2017-03-24  5:23   ` [dpdk-dev] [PATCH 8/8] app/testpmd: set TC strict link priority mode Wu, Jingjing
2017-02-24  6:55 ` [dpdk-dev] [PATCH 0/8] QoS features on i40e Stephen Hemminger
2017-02-24  7:23   ` Lu, Wenzhuo
2017-02-24  9:14     ` [dpdk-dev] [PATCH 0/8] QoS features on i40e - Linux kernel divergence Vincent JARDIN
2017-02-28  5:04       ` Lu, Wenzhuo
2017-03-27 15:13 ` [dpdk-dev] [PATCH 0/8] QoS features on i40e Ferruh Yigit

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=1487906675-54260-9-git-send-email-wenzhuo.lu@intel.com \
    --to=wenzhuo.lu@intel.com \
    --cc=dev@dpdk.org \
    /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).