Skip to contentSkip to conversation

examples/vmdq: fix RSS configuration

PATCH Superseded Junyu Jiang 6 participants 15 messages Mar 3, 2020 – Apr 22, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 examples/vmdq: fix RSS configuration

In order that all queues of pools can receive packets, add enable-rss argument to change rss configuration.

Fixes 6bb97df521aa ("examples/vmdq: new app")
---
 examples/vmdq/main.c | 39 ++++++++++++++++++++++++++++++++++-----
 1 file changed, 34 insertions(+), 5 deletions(-)
examples/vmdq/main.c +34 -5
index 011110920..98032e6a3 100644
@@ -59,6 +59,7 @@ static uint32_t enabled_port_mask;
 /* number of pools (if user does not specify any, 8 by default */
 static uint32_t num_queues = 8;
 static uint32_t num_pools = 8;
+static uint8_t rss_enable;
 
 /* empty vmdq configuration structure. Filled in programatically */
 static const struct rte_eth_conf vmdq_conf_default = {
@@ -143,6 +144,13 @@ get_eth_conf(struct rte_eth_conf *eth_conf, uint32_t num_pools)
 	(void)(rte_memcpy(eth_conf, &vmdq_conf_default, sizeof(*eth_conf)));
 	(void)(rte_memcpy(&eth_conf->rx_adv_conf.vmdq_rx_conf, &conf,
 		   sizeof(eth_conf->rx_adv_conf.vmdq_rx_conf)));
+	if (rss_enable) {
+		eth_conf->rxmode.mq_mode = ETH_MQ_RX_VMDQ_RSS;
+		eth_conf->rx_adv_conf.rss_conf.rss_hf = ETH_RSS_IP |
+							ETH_RSS_UDP |
+							ETH_RSS_TCP |
+							ETH_RSS_SCTP;
+	}
 	return 0;
 }
 
@@ -164,6 +172,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 	uint16_t q;
 	uint16_t queues_per_pool;
 	uint32_t max_nb_pools;
+	uint64_t rss_hf_tmp;
 
 	/*
 	 * The max pool number from dev_info will be used to validate the pool
@@ -209,6 +218,17 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 	if (!rte_eth_dev_is_valid_port(port))
 		return -1;
 
+	rss_hf_tmp = port_conf.rx_adv_conf.rss_conf.rss_hf;
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf != rss_hf_tmp) {
+		printf("Port %u modified RSS hash function based on hardware support,"
+			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
+			port,
+			rss_hf_tmp,
+			port_conf.rx_adv_conf.rss_conf.rss_hf);
+	}
+
 	/*
 	 * Though in this example, we only receive packets from the first queue
 	 * of each pool and send packets through first rte_lcore_count() tx
@@ -363,7 +383,8 @@ static void
 vmdq_usage(const char *prgname)
 {
 	printf("%s [EAL options] -- -p PORTMASK]\n"
-	"  --nb-pools NP: number of pools\n",
+	"  --nb-pools NP: number of pools\n"
+	"  --enable-rss: enable RSS (disabled by default)\n",
 	       prgname);
 }
 
@@ -377,6 +398,7 @@ vmdq_parse_args(int argc, char **argv)
 	const char *prgname = argv[0];
 	static struct option long_option[] = {
 		{"nb-pools", required_argument, NULL, 0},
+		{"enable-rss", 0, NULL, 0},
 		{NULL, 0, 0, 0}
 	};
 
@@ -394,11 +416,18 @@ vmdq_parse_args(int argc, char **argv)
 			}
 			break;
 		case 0:
-			if (vmdq_parse_num_pools(optarg) == -1) {
-				printf("invalid number of pools\n");
-				vmdq_usage(prgname);
-				return -1;
+			if (!strcmp(long_option[option_index].name,
+			    "nb-pools")) {
+				if (vmdq_parse_num_pools(optarg) == -1) {
+					printf("invalid number of pools\n");
+					vmdq_usage(prgname);
+					return -1;
+				}
 			}
+
+			if (!strcmp(long_option[option_index].name,
+			    "enable-rss"))
+				rss_enable = 1;
 			break;
 
 		default:
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines

-----Original Message-----
From: Jiang, JunyuX
Sent: Tuesday, March 3, 2020 17:16
To: [email protected]
Cc: Li, Xiaoyun <[email protected]>; Yang, Qiming <[email protected]>; Jiang, JunyuX <[email protected]>; [email protected]
Subject: [PATCH] examples/vmdq: fix RSS configuration

Quoted 8 lines

In order that all queues of pools can receive packets, add enable-rss argument to change rss configuration.

Fixes 6bb97df521aa ("examples/vmdq: new app")

---

Tested-by Acked-by Xiaoyun Li
#2 lore raw

BRs,
Yingya
-----Original Message-----
From: stable <[email protected]> On Behalf Of Li, Xiaoyun
Sent: Thursday, March 5, 2020 10:03 AM
To: Jiang, JunyuX <[email protected]>; [email protected]
Cc: Yang, Qiming <[email protected]>; [email protected]
Subject: Re: [dpdk-stable] [PATCH] examples/vmdq: fix RSS configuration

Quoted 9 lines

-----Original Message-----
From: Jiang, JunyuX
Sent: Tuesday, March 3, 2020 17:16
To: [email protected]
Cc: Li, Xiaoyun <[email protected]>; Yang, Qiming <[email protected]>; Jiang, JunyuX <[email protected]>; [email protected]
Subject: [PATCH] examples/vmdq: fix RSS configuration

Quoted 8 lines

In order that all queues of pools can receive packets, add enable-rss argument to change rss configuration.

Fixes 6bb97df521aa ("examples/vmdq: new app")

---

#3 lore raw
In reply to Junyu Jiang
Quoted 7 lines · Junyu Jiang

In order that all queues of pools can receive packets, add enable-rss argument to change rss configuration.

Fixes 6bb97df521aa ("examples/vmdq: new app")

Hi Junyu,

I was about to ask to document new 'enable-rss' argument in the sample app documentation, but it seems there is no documentation for it, if I am not missing anything.

Would it be possible to add some documentation for it, later update the documentation with new 'enable-rss' argument in this patch?

Thanks,
ferruh

#4 lore raw

v2 cover examples/vmdq: fix RSS configuration

In reply to Junyu Jiang

This patch set fixed a bug of vmdq example,
and added a documentation for it.

*** BLURB HERE ***

Junyu Jiang (2):
doc: add user guide for VMDq
examples/vmdq: fix RSS configuration

 MAINTAINERS                                  |   1 +
 doc/guides/sample_app_ug/index.rst           |   1 +
 doc/guides/sample_app_ug/vmdq_forwarding.rst | 208 +++++++++++++++++++
 examples/vmdq/main.c                         |  39 +++-
 4 files changed, 244 insertions(+), 5 deletions(-)
 create mode 100644 doc/guides/sample_app_ug/vmdq_forwarding.rst
Signature · 1 line
2.17.1
#5 lore raw

PATCH v2 1/2 doc: add user guide for VMDq

currently, there is no documentation for vmdq example, this path added the user guide for vmdq.

---
 MAINTAINERS                                  |   1 +
 doc/guides/sample_app_ug/index.rst           |   1 +
 doc/guides/sample_app_ug/vmdq_forwarding.rst | 208 +++++++++++++++++++
 3 files changed, 210 insertions(+)
 create mode 100644 doc/guides/sample_app_ug/vmdq_forwarding.rst
MAINTAINERS +1 -0
index c3785554f..1802356b0 100644
@@ -1599,5 +1599,6 @@ M: Xiaoyun Li <[email protected]>
 F: examples/tep_termination/
 
 F: examples/vmdq/
+F: doc/guides/sample_app_ug/vmdq_forwarding.rst
 F: examples/vmdq_dcb/
 F: doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst
doc/guides/sample_app_ug/index.rst +1 -0
index ac3445147..4b16dd161 100644
@@ -40,6 +40,7 @@ Sample Applications User Guides
     timer
     packet_ordering
     vmdq_dcb_forwarding
+    vmdq_forwarding
     vhost
     vhost_blk
     vhost_crypto
doc/guides/sample_app_ug/vmdq_forwarding.rst new file +208 -0

208 lines not on this page · raw message

Signature · 1 line
2.17.1
Reviewed-by on v2 1/2
#6 lore raw

Re: [dpdk-dev] [PATCH v2 1/2] doc: add user guide for VMDq

Quoted 10 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Junyu Jiang
Sent: Wednesday, March 25, 2020 2:33 PM
To: [email protected]
Cc: Yang, Qiming <[email protected]>; Yigit, Ferruh <[email protected]>; Jiang, JunyuX <[email protected]>
Subject: [dpdk-dev] [PATCH v2 1/2] doc: add user guide for VMDq

Quoted 4 lines

currently, there is no documentation for vmdq example, this path added the user guide for vmdq.

#7 lore raw

PATCH v2 2/2 examples/vmdq: fix RSS configuration

In reply to Junyu Jiang

In order that all queues of pools can receive packets, add enable-rss argument to change rss configuration.

Fixes 6bb97df521aa ("examples/vmdq: new app")
---
 doc/guides/sample_app_ug/vmdq_forwarding.rst |  6 +--
 examples/vmdq/main.c                         | 39 +++++++++++++++++---
 2 files changed, 37 insertions(+), 8 deletions(-)
doc/guides/sample_app_ug/vmdq_forwarding.rst +3 -3
index df23043d6..658d6742d 100644
@@ -26,13 +26,13 @@ The Intel® 82599 10 Gigabit Ethernet Controller NIC also supports the splitting
 While the Intel® X710 or XL710 Ethernet Controller NICs support many configurations of VMDQ pools of 4 or 8 queues each.
 And queues numbers for each VMDQ pool can be changed by setting CONFIG_RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM
 in config/common_* file.
-The nb-pools parameter can be passed on the command line, after the EAL parameters:
+The nb-pools and enable-rss parameters can be passed on the command line, after the EAL parameters:
 
 .. code-block:: console
 
-    ./build/vmdq_app [EAL options] -- -p PORTMASK --nb-pools NP
+    ./build/vmdq_app [EAL options] -- -p PORTMASK --nb-pools NP --enable-rss
 
-where, NP can be 8, 16 or 32.
+where, NP can be 8, 16 or 32, rss is disabled by default.
 
 In Linux* user space, the application can display statistics with the number of packets received on each queue.
 To have the application display the statistics, send a SIGHUP signal to the running application process.
examples/vmdq/main.c +34 -5
index 011110920..98032e6a3 100644
@@ -59,6 +59,7 @@ static uint32_t enabled_port_mask;
 /* number of pools (if user does not specify any, 8 by default */
 static uint32_t num_queues = 8;
 static uint32_t num_pools = 8;
+static uint8_t rss_enable;
 
 /* empty vmdq configuration structure. Filled in programatically */
 static const struct rte_eth_conf vmdq_conf_default = {
@@ -143,6 +144,13 @@ get_eth_conf(struct rte_eth_conf *eth_conf, uint32_t num_pools)
 	(void)(rte_memcpy(eth_conf, &vmdq_conf_default, sizeof(*eth_conf)));
 	(void)(rte_memcpy(&eth_conf->rx_adv_conf.vmdq_rx_conf, &conf,
 		   sizeof(eth_conf->rx_adv_conf.vmdq_rx_conf)));
+	if (rss_enable) {
+		eth_conf->rxmode.mq_mode = ETH_MQ_RX_VMDQ_RSS;
+		eth_conf->rx_adv_conf.rss_conf.rss_hf = ETH_RSS_IP |
+							ETH_RSS_UDP |
+							ETH_RSS_TCP |
+							ETH_RSS_SCTP;
+	}
 	return 0;
 }
 
@@ -164,6 +172,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 	uint16_t q;
 	uint16_t queues_per_pool;
 	uint32_t max_nb_pools;
+	uint64_t rss_hf_tmp;
 
 	/*
 	 * The max pool number from dev_info will be used to validate the pool
@@ -209,6 +218,17 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 	if (!rte_eth_dev_is_valid_port(port))
 		return -1;
 
+	rss_hf_tmp = port_conf.rx_adv_conf.rss_conf.rss_hf;
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf != rss_hf_tmp) {
+		printf("Port %u modified RSS hash function based on hardware support,"
+			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
+			port,
+			rss_hf_tmp,
+			port_conf.rx_adv_conf.rss_conf.rss_hf);
+	}
+
 	/*
 	 * Though in this example, we only receive packets from the first queue
 	 * of each pool and send packets through first rte_lcore_count() tx
@@ -363,7 +383,8 @@ static void
 vmdq_usage(const char *prgname)
 {
 	printf("%s [EAL options] -- -p PORTMASK]\n"
-	"  --nb-pools NP: number of pools\n",
+	"  --nb-pools NP: number of pools\n"
+	"  --enable-rss: enable RSS (disabled by default)\n",
 	       prgname);
 }
 
@@ -377,6 +398,7 @@ vmdq_parse_args(int argc, char **argv)
 	const char *prgname = argv[0];
 	static struct option long_option[] = {
 		{"nb-pools", required_argument, NULL, 0},
+		{"enable-rss", 0, NULL, 0},
 		{NULL, 0, 0, 0}
 	};
 
@@ -394,11 +416,18 @@ vmdq_parse_args(int argc, char **argv)
 			}
 			break;
 		case 0:
-			if (vmdq_parse_num_pools(optarg) == -1) {
-				printf("invalid number of pools\n");
-				vmdq_usage(prgname);
-				return -1;
+			if (!strcmp(long_option[option_index].name,
+			    "nb-pools")) {
+				if (vmdq_parse_num_pools(optarg) == -1) {
+					printf("invalid number of pools\n");
+					vmdq_usage(prgname);
+					return -1;
+				}
 			}
+
+			if (!strcmp(long_option[option_index].name,
+			    "enable-rss"))
+				rss_enable = 1;
 			break;
 
 		default:
Signature · 1 line
2.17.1
Tested-by Acked-by Xiaoyun Li on v2 2/2
#8 lore raw

BRs,
Yingya

-----Original Message-----
From: dev <[email protected]> On Behalf Of Junyu Jiang
Sent: Wednesday, March 25, 2020 2:33 PM
To: [email protected]
Cc: Yang, Qiming <[email protected]>; Yigit, Ferruh <[email protected]>; Jiang, JunyuX <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH v2 2/2] examples/vmdq: fix RSS configuration

In order that all queues of pools can receive packets, add enable-rss argument to change rss configuration.

Fixes 6bb97df521aa ("examples/vmdq: new app")
---
 doc/guides/sample_app_ug/vmdq_forwarding.rst |  6 +--
 examples/vmdq/main.c                         | 39 +++++++++++++++++---
 2 files changed, 37 insertions(+), 8 deletions(-)
doc/guides/sample_app_ug/vmdq_forwarding.rst +4 -3
index df23043d6..658d6742d 100644
@@ -26,13 +26,13 @@ The Intel® 82599 10 Gigabit Ethernet Controller NIC also supports the splitting  While the Intel® X710 or XL710 Ethernet Controller NICs support many configurations of VMDQ pools of 4 or 8 queues each.
 And queues numbers for each VMDQ pool can be changed by setting CONFIG_RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM
 in config/common_* file.
-The nb-pools parameter can be passed on the command line, after the EAL parameters:
+The nb-pools and enable-rss parameters can be passed on the command line, after the EAL parameters:
 
 .. code-block:: console
 
-    ./build/vmdq_app [EAL options] -- -p PORTMASK --nb-pools NP
+    ./build/vmdq_app [EAL options] -- -p PORTMASK --nb-pools NP 
+ --enable-rss
 
-where, NP can be 8, 16 or 32.
+where, NP can be 8, 16 or 32, rss is disabled by default.
 
 In Linux* user space, the application can display statistics with the number of packets received on each queue.
 To have the application display the statistics, send a SIGHUP signal to the running application process.
examples/vmdq/main.c +1 -0
@@ -59,6 +59,7 @@ static uint32_t enabled_port_mask;
 /* number of pools (if user does not specify any, 8 by default */  static uint32_t num_queues = 8;  static uint32_t num_pools = 8;
+static uint8_t rss_enable;
 
 /* empty vmdq configuration structure. Filled in programatically */  static const struct rte_eth_conf vmdq_conf_default = { @@ -143,6 +144,13 @@ get_eth_conf(struct rte_eth_conf *eth_conf, uint32_t num_pools)
 	(void)(rte_memcpy(eth_conf, &vmdq_conf_default, sizeof(*eth_conf)));
 	(void)(rte_memcpy(&eth_conf->rx_adv_conf.vmdq_rx_conf, &conf,
 		   sizeof(eth_conf->rx_adv_conf.vmdq_rx_conf)));

+ if (rss_enable) {
+ eth_conf->rxmode.mq_mode = ETH_MQ_RX_VMDQ_RSS;
+ eth_conf->rx_adv_conf.rss_conf.rss_hf = ETH_RSS_IP |
+ ETH_RSS_UDP |
+ ETH_RSS_TCP |
+ ETH_RSS_SCTP;
+ }
return 0;
}

@@ -164,6 +172,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
uint16_t q;
uint16_t queues_per_pool;
uint32_t max_nb_pools;
+ uint64_t rss_hf_tmp;

/*
* The max pool number from dev_info will be used to validate the pool @@ -209,6 +218,17 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
if (!rte_eth_dev_is_valid_port(port))
return -1;

+ rss_hf_tmp = port_conf.rx_adv_conf.rss_conf.rss_hf;
+ port_conf.rx_adv_conf.rss_conf.rss_hf &=
+ dev_info.flow_type_rss_offloads;
+ if (port_conf.rx_adv_conf.rss_conf.rss_hf != rss_hf_tmp) {
+ printf("Port %u modified RSS hash function based on hardware support,"
+ "requested:%#"PRIx64" configured:%#"PRIx64"\n",
+ port,
+ rss_hf_tmp,
+ port_conf.rx_adv_conf.rss_conf.rss_hf);
+ }
+
/*
* Though in this example, we only receive packets from the first queue
* of each pool and send packets through first rte_lcore_count() tx @@ -363,7 +383,8 @@ static void vmdq_usage(const char *prgname) {
printf("%s [EAL options] -- -p PORTMASK]\n"

-	"  --nb-pools NP: number of pools\n",
+	"  --nb-pools NP: number of pools\n"
+	"  --enable-rss: enable RSS (disabled by default)\n",

prgname);
}

@@ -377,6 +398,7 @@ vmdq_parse_args(int argc, char **argv)
const char *prgname = argv[0];
static struct option long_option[] = {
{"nb-pools", required_argument, NULL, 0},
+ {"enable-rss", 0, NULL, 0},
{NULL, 0, 0, 0}
};

@@ -394,11 +416,18 @@ vmdq_parse_args(int argc, char **argv)
}
break;
case 0:
- if (vmdq_parse_num_pools(optarg) == -1) {
- printf("invalid number of pools\n");
- vmdq_usage(prgname);
- return -1;
+ if (!strcmp(long_option[option_index].name,
+ "nb-pools")) {
+ if (vmdq_parse_num_pools(optarg) == -1) {
+ printf("invalid number of pools\n");
+ vmdq_usage(prgname);
+ return -1;
+ }
}
+
+ if (!strcmp(long_option[option_index].name,
+ "enable-rss"))
+ rss_enable = 1;
break;

default:
--
2.17.1

#9 lore raw
In reply to Junyu Jiang
Quoted 87 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Junyu Jiang
Sent: Wednesday, March 25, 2020 2:33 PM
To: [email protected]
Cc: Yang, Qiming <[email protected]>; Yigit, Ferruh <[email protected]>; Jiang, JunyuX <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH v2 2/2] examples/vmdq: fix RSS configuration

In order that all queues of pools can receive packets, add enable-rss argument to change rss configuration.

Fixes 6bb97df521aa ("examples/vmdq: new app")
---
 doc/guides/sample_app_ug/vmdq_forwarding.rst |  6 +--
 examples/vmdq/main.c                         | 39 +++++++++++++++++---
 2 files changed, 37 insertions(+), 8 deletions(-)
doc/guides/sample_app_ug/vmdq_forwarding.rst +0 -0
index df23043d6..658d6742d 100644
@@ -26,13 +26,13 @@ The Intel® 82599 10 Gigabit Ethernet Controller NIC also supports

the splitting
While the Intel® X710 or XL710 Ethernet Controller NICs support many configurations of
VMDQ pools of 4 or 8 queues each.
And queues numbers for each VMDQ pool can be changed by setting
CONFIG_RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM
in config/common_* file.

doc/guides/sample_app_ug/vmdq_forwarding.rst +1 -1
-The nb-pools parameter can be passed on the command line, after the EAL parameters:
+The nb-pools and enable-rss parameters can be passed on the command line, after the

EAL parameters:

.. code-block:: console

doc/guides/sample_app_ug/vmdq_forwarding.rst +2 -2
-    ./build/vmdq_app [EAL options] -- -p PORTMASK --nb-pools NP
+    ./build/vmdq_app [EAL options] -- -p PORTMASK --nb-pools NP --enable-rss
 
-where, NP can be 8, 16 or 32.
+where, NP can be 8, 16 or 32, rss is disabled by default.
 
 In Linux* user space, the application can display statistics with the number of packets

received on each queue.
To have the application display the statistics, send a SIGHUP signal to the running
application process.

examples/vmdq/main.c +9 -0
index 011110920..98032e6a3 100644
@@ -59,6 +59,7 @@ static uint32_t enabled_port_mask;
 /* number of pools (if user does not specify any, 8 by default */
 static uint32_t num_queues = 8;
 static uint32_t num_pools = 8;
+static uint8_t rss_enable;
 
 /* empty vmdq configuration structure. Filled in programatically */
 static const struct rte_eth_conf vmdq_conf_default = {
@@ -143,6 +144,13 @@ get_eth_conf(struct rte_eth_conf *eth_conf, uint32_t
 num_pools)
 	(void)(rte_memcpy(eth_conf, &vmdq_conf_default, sizeof(*eth_conf)));
 	(void)(rte_memcpy(&eth_conf->rx_adv_conf.vmdq_rx_conf, &conf,
 		   sizeof(eth_conf->rx_adv_conf.vmdq_rx_conf)));
+	if (rss_enable) {
+		eth_conf->rxmode.mq_mode = ETH_MQ_RX_VMDQ_RSS;
+		eth_conf->rx_adv_conf.rss_conf.rss_hf = ETH_RSS_IP |
+							ETH_RSS_UDP |
+							ETH_RSS_TCP |
+							ETH_RSS_SCTP;
+	}
 	return 0;
 }
@@ -164,6 +172,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 	uint16_t q;
 	uint16_t queues_per_pool;
 	uint32_t max_nb_pools;
+	uint64_t rss_hf_tmp;
 
 	/*
 	 * The max pool number from dev_info will be used to validate the pool

examples/vmdq/main.c port_init(uint16_t port, struct rte_mempool *mbuf_pool) · line 225

Quoted 8 lines
examples/vmdq/main.c +5 -0
@@ -209,6 +218,17 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 	if (!rte_eth_dev_is_valid_port(port))
 		return -1;
 
+	rss_hf_tmp = port_conf.rx_adv_conf.rss_conf.rss_hf;
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf != rss_hf_tmp) {
+		printf("Port %u modified RSS hash function based on hardware support,"

This is RSS offload type but not hash function.

#10 lore raw
Quoted 108 lines

-----Original Message-----
From: stable <[email protected]> On Behalf Of Wu, Jingjing
Sent: Friday, April 3, 2020 08:08
To: Jiang, JunyuX <[email protected]>; [email protected]
Cc: Yang, Qiming <[email protected]>; Yigit, Ferruh <[email protected]>; Jiang, JunyuX <[email protected]>; [email protected]
Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v2 2/2] examples/vmdq: fix RSS configuration

Quoted 29 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Junyu Jiang
Sent: Wednesday, March 25, 2020 2:33 PM
To: [email protected]
Cc: Yang, Qiming <[email protected]>; Yigit, Ferruh <[email protected]>; Jiang, JunyuX <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH v2 2/2] examples/vmdq: fix RSS configuration

In order that all queues of pools can receive packets, add enable-rss argument to change rss configuration.

Fixes 6bb97df521aa ("examples/vmdq: new app")
---
 doc/guides/sample_app_ug/vmdq_forwarding.rst |  6 +--
 examples/vmdq/main.c                         | 39 +++++++++++++++++---
 2 files changed, 37 insertions(+), 8 deletions(-)
doc/guides/sample_app_ug/vmdq_forwarding.rst +0 -0
index df23043d6..658d6742d 100644
@@ -26,13 +26,13 @@ The Intel® 82599 10 Gigabit Ethernet Controller
Quoted 7 lines

NIC also supports the splitting While the Intel® X710 or XL710 Ethernet Controller NICs support many configurations of VMDQ pools of 4 or 8 queues each.
And queues numbers for each VMDQ pool can be changed by setting
CONFIG_RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM
in config/common_* file.
-The nb-pools parameter can be passed on the command line, after the EAL

parameters:

examples/vmdq/main.c port_init(uint16_t port, struct rte_mempool

Quoted 44 lines
doc/guides/sample_app_ug/vmdq_forwarding.rst +2 -0
+The nb-pools and enable-rss parameters can be passed on the command
+line, after the

EAL parameters:

.. code-block:: console

doc/guides/sample_app_ug/vmdq_forwarding.rst +3 -2
-    ./build/vmdq_app [EAL options] -- -p PORTMASK --nb-pools NP
+    ./build/vmdq_app [EAL options] -- -p PORTMASK --nb-pools NP
+ --enable-rss
 
-where, NP can be 8, 16 or 32.
+where, NP can be 8, 16 or 32, rss is disabled by default.
 
 In Linux* user space, the application can display statistics with the

number of packets received on each queue.
To have the application display the statistics, send a SIGHUP signal
to the running application process.

examples/vmdq/main.c index renamed from examples/vmdq/main.c +0 -0

011110920..98032e6a3 100644

examples/vmdq/main.c +1 -0
@@ -59,6 +59,7 @@ static uint32_t enabled_port_mask;
 /* number of pools (if user does not specify any, 8 by default */
 static uint32_t num_queues = 8;  static uint32_t num_pools = 8;
+static uint8_t rss_enable;
 
 /* empty vmdq configuration structure. Filled in programatically */

static const struct rte_eth_conf vmdq_conf_default = { @@ -143,6 +144,13 @@ get_eth_conf(struct rte_eth_conf *eth_conf, uint32_t num_pools)

examples/vmdq/main.c +7 -0
 	(void)(rte_memcpy(eth_conf, &vmdq_conf_default, sizeof(*eth_conf)));
 	(void)(rte_memcpy(&eth_conf->rx_adv_conf.vmdq_rx_conf, &conf,
 		   sizeof(eth_conf->rx_adv_conf.vmdq_rx_conf)));
+	if (rss_enable) {
+		eth_conf->rxmode.mq_mode = ETH_MQ_RX_VMDQ_RSS;
+		eth_conf->rx_adv_conf.rss_conf.rss_hf = ETH_RSS_IP |
+							ETH_RSS_UDP |
+							ETH_RSS_TCP |
+							ETH_RSS_SCTP;
+	}
 	return 0;
 }
@@ -164,6 +172,7 @@ port_init(uint16_t port, struct rte_mempool

*mbuf_pool)

Quoted 8 lines
examples/vmdq/main.c +1 -0
 	uint16_t q;
 	uint16_t queues_per_pool;
 	uint32_t max_nb_pools;
+	uint64_t rss_hf_tmp;
 
 	/*
 	 * The max pool number from dev_info will be used to validate the

pool @@ -209,6 +218,17 @@ port_init(uint16_t port, struct rte_mempool

*mbuf_pool)

Quoted 3 lines
examples/vmdq/main.c +0 -0
 	if (!rte_eth_dev_is_valid_port(port))
 		return -1;
Quoted 8 lines

examples/vmdq/main.c port_init(uint16_t port, struct rte_mempool *mbuf_pool)

Quoted 5 lines
examples/vmdq/main.c +5 -0
+	rss_hf_tmp = port_conf.rx_adv_conf.rss_conf.rss_hf;
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf != rss_hf_tmp) {
+		printf("Port %u modified RSS hash function based on hardware

support,"

This is RSS offload type but not hash function.

* The *rss_hf* field of the *rss_conf* structure indicates the different
* types of IPv4/IPv6 packets to which the RSS hashing must be applied.
* Supplying an *rss_hf* equal to zero disables the RSS feature.

And in testpmd, it's the same.
port->dev_conf.rx_adv_conf.rss_conf.rss_hf =

				rss_hf & port->dev_info.flow_type_rss_offloads;
#11 lore raw
Quoted 9 lines
Quoted 8 lines

examples/vmdq/main.c port_init(uint16_t port, struct rte_mempool *mbuf_pool)

Quoted 5 lines
examples/vmdq/main.c +5 -0
+	rss_hf_tmp = port_conf.rx_adv_conf.rss_conf.rss_hf;
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf != rss_hf_tmp) {
+		printf("Port %u modified RSS hash function based on hardware

support,"

This is RSS offload type but not hash function.

Quoted 7 lines

* The *rss_hf* field of the *rss_conf* structure indicates the different
* types of IPv4/IPv6 packets to which the RSS hashing must be applied.
* Supplying an *rss_hf* equal to zero disables the RSS feature.

And in testpmd, it's the same.
port->dev_conf.rx_adv_conf.rss_conf.rss_hf =

				rss_hf & port->dev_info.flow_type_rss_offloads;

OK. I got, the definition of rss_hf at the beginning might be hash function which also the same as RSS offload type. Ignore my comments then.

BTW hash function is also indicating TOEPLITZ/XOR... in somewhere.

Thanks
Jingjng

Tested-by on the v2 series
#12 lore raw
In reply to Junyu Jiang

-----Original Message-----
From: dev <[email protected]> On Behalf Of Junyu Jiang
Sent: Wednesday, March 25, 2020 2:33 PM
To: [email protected]
Cc: Yang, Qiming <[email protected]>; Yigit, Ferruh <[email protected]>; Jiang, JunyuX <[email protected]>
Subject: [dpdk-dev] [PATCH v2 0/2] examples/vmdq: fix RSS configuration

This patch set fixed a bug of vmdq example, and added a documentation for it.

*** BLURB HERE ***

Junyu Jiang (2):
doc: add user guide for VMDq
examples/vmdq: fix RSS configuration

 MAINTAINERS                                  |   1 +
 doc/guides/sample_app_ug/index.rst           |   1 +
 doc/guides/sample_app_ug/vmdq_forwarding.rst | 208 +++++++++++++++++++
 examples/vmdq/main.c                         |  39 +++-
 4 files changed, 244 insertions(+), 5 deletions(-)  create mode 100644 doc/guides/sample_app_ug/vmdq_forwarding.rst

--
2.17.1

#13 lore raw
In reply to Junyu Jiang
Quoted 9 lines · Junyu Jiang

This patch set fixed a bug of vmdq example,
and added a documentation for it.

*** BLURB HERE ***

Junyu Jiang (2):
doc: add user guide for VMDq
examples/vmdq: fix RSS configuration

Hi Junyu,

Thanks for introducing VMDq user guide, appreciated.

Series applied to dpdk-next-net/master, thanks.

#14 lore raw
In reply to Junyu Jiang

25/03/2020 07:32, Junyu Jiang:

Quoted 2 lines

This patch set fixed a bug of vmdq example,
and added a documentation for it.

We have 2 directories for VMDq:
examples/vmdq/
examples/vmdq_dcb/
Please, would it be possible to merge them in a single one?

Another related question: is VMDq a feature we want to keep in future? I thought it could be deprecated. Am I wrong? What are the devices supporting VMDq?