DPDK patches and discussions
 help / color / mirror / Atom feed
From: Helin Zhang <helin.zhang@intel.com>
To: dev@dpdk.org
Cc: yulong.pei@intel.com
Subject: [dpdk-dev] [PATCH 2/2] app/testpmd: add test commands for RSS granularity
Date: Tue, 22 Sep 2015 14:32:27 +0800	[thread overview]
Message-ID: <1442903547-18198-3-git-send-email-helin.zhang@intel.com> (raw)
In-Reply-To: <1442903547-18198-1-git-send-email-helin.zhang@intel.com>

Test commands are added to support clearing input set, or setting
with new input set per different pctype.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Signed-off-by: Andrey Chilikin <andrey.chilikin@intel.com>
---
 app/test-pmd/cmdline.c | 106 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 106 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 0f8f48f..80098e6 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -8851,6 +8851,111 @@ cmdline_parse_inst_t cmd_set_hash_global_config = {
 	},
 };
 
+/**/
+struct cmd_set_hash_input_set_result {
+	cmdline_fixed_string_t set_hash_input_set;
+	uint8_t port_id;
+	cmdline_fixed_string_t flow_type;
+	cmdline_fixed_string_t inset_field;
+	cmdline_fixed_string_t enable;
+};
+
+static enum rte_eth_input_set_field
+str2inset(char *string)
+{
+	uint16_t i;
+
+	static const struct {
+		char str[32];
+		enum rte_eth_input_set_field inset;
+	} inset_table[] = {
+		{"src-ipv4", RTE_ETH_INPUT_SET_L3_SRC_IP4},
+		{"dst-ipv4", RTE_ETH_INPUT_SET_L3_DST_IP4},
+		{"src-ipv6", RTE_ETH_INPUT_SET_L3_SRC_IP6},
+		{"dst-ipv6", RTE_ETH_INPUT_SET_L3_DST_IP6},
+		{"udp-src-port", RTE_ETH_INPUT_SET_L4_UDP_SRC_PORT},
+		{"udp-dst-port", RTE_ETH_INPUT_SET_L4_UDP_DST_PORT},
+		{"tcp-src-port", RTE_ETH_INPUT_SET_L4_TCP_SRC_PORT},
+		{"tcp-dst-port", RTE_ETH_INPUT_SET_L4_TCP_DST_PORT},
+		{"sctp-src-port", RTE_ETH_INPUT_SET_L4_SCTP_SRC_PORT},
+		{"sctp-dst-port", RTE_ETH_INPUT_SET_L4_SCTP_DST_PORT},
+		{"sctp-veri-tag", RTE_ETH_INPUT_SET_L4_SCTP_VERIFICATION_TAG},
+		{"fld-1st", RTE_ETH_INPUT_SET_FLEX_PAYLOAD_1ST_WORD},
+		{"fld-2nd", RTE_ETH_INPUT_SET_FLEX_PAYLOAD_2ND_WORD},
+		{"fld-3rd", RTE_ETH_INPUT_SET_FLEX_PAYLOAD_3RD_WORD},
+		{"fld-4th", RTE_ETH_INPUT_SET_FLEX_PAYLOAD_4TH_WORD},
+		{"fld-5th", RTE_ETH_INPUT_SET_FLEX_PAYLOAD_5TH_WORD},
+		{"fld-6th", RTE_ETH_INPUT_SET_FLEX_PAYLOAD_6TH_WORD},
+		{"fld-7th", RTE_ETH_INPUT_SET_FLEX_PAYLOAD_7TH_WORD},
+		{"fld-8th", RTE_ETH_INPUT_SET_FLEX_PAYLOAD_8TH_WORD},
+		{"all", RTE_ETH_INPUT_SET_ALL},
+	};
+
+	for (i = 0; i < RTE_DIM(inset_table); i++) {
+		if (!strcmp(string, inset_table[i].str))
+			return inset_table[i].inset;
+	}
+
+	return RTE_ETH_INPUT_SET_UNKNOWN;
+}
+
+static void
+cmd_set_hash_input_set_parsed(void *parsed_result,
+			      __rte_unused struct cmdline *cl,
+			      __rte_unused void *data)
+{
+	struct cmd_set_hash_input_set_result *res = parsed_result;
+	struct rte_eth_hash_filter_info info;
+
+	memset(&info, 0, sizeof(info));
+	info.info_type = RTE_ETH_HASH_FILTER_INPUT_SET_SELECT;
+	info.info.input_set_conf.flow_type = str2flowtype(res->flow_type);
+	info.info.input_set_conf.field[0] = str2inset(res->inset_field);
+	info.info.input_set_conf.inset_size = 1;
+	if (!strcmp(res->enable, "enable"))
+		info.info.input_set_conf.enable = 1;
+	else
+		info.info.input_set_conf.enable = 0;
+	rte_eth_dev_filter_ctrl(res->port_id, RTE_ETH_FILTER_HASH,
+				RTE_ETH_FILTER_SET, &info);
+}
+
+cmdline_parse_token_string_t cmd_set_hash_input_set_cmd =
+	TOKEN_STRING_INITIALIZER(struct cmd_set_hash_input_set_result,
+		set_hash_input_set, "set_hash_input_set");
+cmdline_parse_token_num_t cmd_set_hash_input_set_port_id =
+	TOKEN_NUM_INITIALIZER(struct cmd_set_hash_input_set_result,
+		port_id, UINT8);
+cmdline_parse_token_string_t cmd_set_hash_input_set_flow_type =
+	TOKEN_STRING_INITIALIZER(struct cmd_set_hash_input_set_result,
+		flow_type,
+		"ipv4#ipv4-frag#ipv4-tcp#ipv4-udp#ipv4-sctp#ipv4-other#ipv6#"
+		"ipv6-frag#ipv6-tcp#ipv6-udp#ipv6-sctp#ipv6-other#l2_payload");
+cmdline_parse_token_string_t cmd_set_hash_input_set_field =
+	TOKEN_STRING_INITIALIZER(struct cmd_set_hash_input_set_result,
+		inset_field,
+		"src-ipv4#dst-ipv4#src-ipv6#dst-ipv6#udp-src-port#"
+		"udp-dst-port#tcp-src-port#tcp-dst-port#sctp-src-port#"
+		"sctp-dst-port#sctp-veri-tag#fld-1st#fld-2nd#fld-3rd#fld-4th#"
+		"fld-5th#fld-6th#fld-7th#fld-8th#all");
+cmdline_parse_token_string_t cmd_set_hash_input_set_enable =
+	TOKEN_STRING_INITIALIZER(struct cmd_set_hash_input_set_result,
+		enable, "enable#disable");
+
+cmdline_parse_inst_t cmd_set_hash_input_set = {
+	.f = cmd_set_hash_input_set_parsed,
+	.data = NULL,
+	.help_str = "ssss",
+	.tokens = {
+		(void *)&cmd_set_hash_input_set_cmd,
+		(void *)&cmd_set_hash_input_set_port_id,
+		(void *)&cmd_set_hash_input_set_flow_type,
+		(void *)&cmd_set_hash_input_set_field,
+		(void *)&cmd_set_hash_input_set_enable,
+		NULL,
+	},
+};
+
 /* *** ADD/REMOVE A MULTICAST MAC ADDRESS TO/FROM A PORT *** */
 struct cmd_mcast_addr_result {
 	cmdline_fixed_string_t mcast_addr_cmd;
@@ -9033,6 +9138,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_set_sym_hash_ena_per_port,
 	(cmdline_parse_inst_t *)&cmd_get_hash_global_config,
 	(cmdline_parse_inst_t *)&cmd_set_hash_global_config,
+	(cmdline_parse_inst_t *)&cmd_set_hash_input_set,
 	(cmdline_parse_inst_t *)&cmd_mcast_addr,
 	NULL,
 };
-- 
1.9.3

  parent reply	other threads:[~2015-09-22  6:32 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-22  6:32 [dpdk-dev] [PATCH 0/2] i40e: RSS granularity configuration Helin Zhang
2015-09-22  6:32 ` [dpdk-dev] [PATCH 1/2] i40e: add " Helin Zhang
2015-09-22  6:32 ` Helin Zhang [this message]
2015-09-22  7:26 ` [dpdk-dev] [PATCH v2 0/2] i40e: " Helin Zhang
2015-09-22  7:26   ` [dpdk-dev] [PATCH v2 1/2] i40e: add " Helin Zhang
2015-09-22  7:26   ` [dpdk-dev] [PATCH v2 2/2] app/testpmd: add test commands for RSS granularity Helin Zhang
2015-09-24  7:08   ` [dpdk-dev] [PATCH v3 0/2] i40e: RSS granularity configuration Helin Zhang
2015-09-24  7:08     ` [dpdk-dev] [PATCH v3 1/2] i40e: add " Helin Zhang
2015-09-24  7:08     ` [dpdk-dev] [PATCH v3 2/2] app/testpmd: add test commands for RSS granularity Helin Zhang
2015-10-20  3:42     ` [dpdk-dev] [PATCH v4 0/2] i40e: RSS/FD granularity configuration Helin Zhang
2015-10-20  3:42       ` [dpdk-dev] [PATCH v4 1/2] " Helin Zhang
2015-10-20  3:42       ` [dpdk-dev] [PATCH v4 2/2] app/testpmd: add test commands for RSS/FD granularity Helin Zhang
2015-10-29  4:09       ` [dpdk-dev] [PATCH v5 0/2] i40e: RSS/FD granularity configuration Helin Zhang
2015-10-29  4:09         ` [dpdk-dev] [PATCH v5 1/2] " Helin Zhang
2015-10-29  4:09         ` [dpdk-dev] [PATCH v5 2/2] app/testpmd: add test commands for RSS/FD granularity Helin Zhang
2015-10-29  6:02         ` [dpdk-dev] [PATCH v6 0/3] i40e: RSS/FD granularity configuration Helin Zhang
2015-10-29  6:02           ` [dpdk-dev] [PATCH v6 1/3] " Helin Zhang
2015-10-29  9:38             ` Bruce Richardson
2015-10-30  1:58               ` Zhang, Helin
2015-10-29  6:02           ` [dpdk-dev] [PATCH v6 2/3] app/testpmd: add test commands for RSS/FD granularity Helin Zhang
2015-10-29  6:02           ` [dpdk-dev] [PATCH v6 3/3] doc: update release notes and testpmd guide Helin Zhang
2015-10-30  3:11           ` [dpdk-dev] [PATCH v7 0/2] i40e: RSS/FD granularity configuration Helin Zhang
2015-10-30  3:11             ` [dpdk-dev] [PATCH v7 1/2] " Helin Zhang
2015-10-30 13:46               ` Thomas Monjalon
2015-11-02  2:11                 ` Zhang, Helin
2015-11-02  7:27                   ` Thomas Monjalon
2015-11-02  7:59                     ` Zhang, Helin
2015-11-02  8:23                       ` Thomas Monjalon
2015-10-30  3:11             ` [dpdk-dev] [PATCH v7 2/2] app/testpmd: add test commands for RSS/FD granularity Helin Zhang
2015-10-30  7:59             ` [dpdk-dev] [PATCH v7 0/2] i40e: RSS/FD granularity configuration Wu, Jingjing
2015-11-02 14:32             ` [dpdk-dev] [PATCH v8 " Helin Zhang
2015-11-02 14:32               ` [dpdk-dev] [PATCH v8 1/2] " Helin Zhang
2015-11-02 14:32               ` [dpdk-dev] [PATCH v8 2/2] app/testpmd: add test commands for RSS/FD granularity Helin Zhang
2015-11-03 16:07               ` [dpdk-dev] [PATCH v9 0/2] i40e: RSS/FD granularity configuration Helin Zhang
2015-11-03 16:07                 ` [dpdk-dev] [PATCH v9 1/2] " Helin Zhang
2015-11-03 16:07                 ` [dpdk-dev] [PATCH v9 2/2] app/testpmd: add test commands for RSS/FD granularity Helin Zhang
2015-11-03 23:25                 ` [dpdk-dev] [PATCH v9 0/2] i40e: RSS/FD granularity configuration Thomas Monjalon

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=1442903547-18198-3-git-send-email-helin.zhang@intel.com \
    --to=helin.zhang@intel.com \
    --cc=dev@dpdk.org \
    --cc=yulong.pei@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).