Skip to contentSkip to conversation

net/vmxnet3: added checks for TCP for RSS Configuration

PATCH New Raghav Roy 3 participants 4 messages Dec 21, 2022 – Jan 13, 2023

Subsystems (2)
lore
Share & tools
lore

Raghav Roy

author
#0 lore raw

PATCH 1/1 net/vmxnet3: added checks for TCP for RSS Configuration

Added checks for TCP in vmxnet3_rss_configure()
This check ensures the the hashType for RSS, when enabled just for UDP, is not NONE.

---
 drivers/net/vmxnet3/vmxnet3_ethdev.h | 3 +++
 drivers/net/vmxnet3/vmxnet3_rxtx.c   | 9 ++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)
drivers/net/vmxnet3/vmxnet3_ethdev.h +3 -0
index 5a303717b1..95ce13dd76 100644
@@ -45,6 +45,9 @@
 	RTE_ETH_RSS_NONFRAG_IPV4_TCP | \
 	RTE_ETH_RSS_NONFRAG_IPV6_TCP)
 
+#define VMXNET3_MANDATORY_RSS ( \
+	RTE_ETH_RSS_NONFRAG_IPV4_TCP | \
+	RTE_ETH_RSS_NONFRAG_IPV6_TCP)
 /* RSS configuration structure - shared with device through GPA */
 typedef struct VMXNET3_RSSConf {
 	uint16_t   hashType;
drivers/net/vmxnet3/vmxnet3_rxtx.c +8 -1
index a875ffec07..8f5a107169 100644
@@ -1412,6 +1412,13 @@ vmxnet3_rss_configure(struct rte_eth_dev *dev)
 	dev_rss_conf = hw->rss_conf;
 	port_rss_conf = &dev->data->dev_conf.rx_adv_conf.rss_conf;
 
+	if ((port_rss_conf->rss_hf & VMXNET3_MANDATORY_RSS) !=
+	   VMXNET3_MANDATORY_RSS) {
+		PMD_INIT_LOG(WARNING, "RSS: IPv4/6 TCP is required for vmxnet3 RSS, "
+			     "automatically setting it");
+		port_rss_conf->rss_hf |= VMXNET3_MANDATORY_RSS;
+	}
+
 	/* loading hashFunc */
 	dev_rss_conf->hashFunc = VMXNET3_RSS_HASH_FUNC_TOEPLITZ;
 	/* loading hashKeySize */
@@ -1419,6 +1426,7 @@ vmxnet3_rss_configure(struct rte_eth_dev *dev)
 	/* loading indTableSize: Must not exceed VMXNET3_RSS_MAX_IND_TABLE_SIZE (128)*/
 	dev_rss_conf->indTableSize = (uint16_t)((MAX_RX_QUEUES(hw)) * 4);
 
+
 	if (port_rss_conf->rss_key == NULL) {
 		/* Default hash key */
 		port_rss_conf->rss_key = rss_intel_key;
@@ -1446,6 +1454,5 @@ vmxnet3_rss_configure(struct rte_eth_dev *dev)
 		dev_rss_conf->hashType |= VMXNET3_RSS_HASH_TYPE_IPV6;
 	if (rss_hf & RTE_ETH_RSS_NONFRAG_IPV6_TCP)
 		dev_rss_conf->hashType |= VMXNET3_RSS_HASH_TYPE_TCP_IPV6;
-
 	return VMXNET3_SUCCESS;
 }
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH 1/1 net/vmxnet3: added checks for TCP for RSS Configuration

Added checks for TCP in vmxnet3_rss_configure() This check ensures the hashType for RSS, when enabled just for UDP, is not NONE.

---
 drivers/net/vmxnet3/vmxnet3_rxtx.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/net/vmxnet3/vmxnet3_rxtx.c +8 -1
index a875ffec07..e8407c9b2e 100644
@@ -1412,6 +1412,13 @@ vmxnet3_rss_configure(struct rte_eth_dev *dev)
 	dev_rss_conf = hw->rss_conf;
 	port_rss_conf = &dev->data->dev_conf.rx_adv_conf.rss_conf;
 
+	if ((port_rss_conf->rss_hf & VMXNET3_MANDATORY_V4_RSS) !=
+	   VMXNET3_MANDATORY_V4_RSS) {
+		PMD_INIT_LOG(WARNING, "RSS: IPv4/6 TCP is required for vmxnet3 RSS, "
+			     "automatically setting it");
+		port_rss_conf->rss_hf |= VMXNET3_MANDATORY_V4_RSS;
+	}
+
 	/* loading hashFunc */
 	dev_rss_conf->hashFunc = VMXNET3_RSS_HASH_FUNC_TOEPLITZ;
 	/* loading hashKeySize */
@@ -1419,6 +1426,7 @@ vmxnet3_rss_configure(struct rte_eth_dev *dev)
 	/* loading indTableSize: Must not exceed VMXNET3_RSS_MAX_IND_TABLE_SIZE (128)*/
 	dev_rss_conf->indTableSize = (uint16_t)((MAX_RX_QUEUES(hw)) * 4);
 
+
 	if (port_rss_conf->rss_key == NULL) {
 		/* Default hash key */
 		port_rss_conf->rss_key = rss_intel_key;
@@ -1446,6 +1454,5 @@ vmxnet3_rss_configure(struct rte_eth_dev *dev)
 		dev_rss_conf->hashType |= VMXNET3_RSS_HASH_TYPE_IPV6;
 	if (rss_hf & RTE_ETH_RSS_NONFRAG_IPV6_TCP)
 		dev_rss_conf->hashType |= VMXNET3_RSS_HASH_TYPE_TCP_IPV6;
-
 	return VMXNET3_SUCCESS;
 }
Signature · 1 line
2.17.1
#2 lore raw
Quoted 4 lines · Raghav Roy

Added checks for TCP in vmxnet3_rss_configure() This check ensures the hashType for RSS, when enabled just for UDP, is not NONE.

Mandatory hash functions for v4 already added in the past:
Commit 52ec00fd1474 ("net/vmxnet3: fix RSS setting on v4")

Now this commit adds it for all versions, why it was fine in the past but it is needed now?

@Jochen, can you please help reviewing this patch?

Quoted 10 lines
---
 drivers/net/vmxnet3/vmxnet3_rxtx.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/net/vmxnet3/vmxnet3_rxtx.c +0 -0
index a875ffec07..e8407c9b2e 100644

drivers/net/vmxnet3/vmxnet3_rxtx.c vmxnet3_rss_configure(struct rte_eth_dev *dev) · line 1421

Quoted 10 lines
drivers/net/vmxnet3/vmxnet3_rxtx.c +7 -0
@@ -1412,6 +1412,13 @@ vmxnet3_rss_configure(struct rte_eth_dev *dev)
 	dev_rss_conf = hw->rss_conf;
 	port_rss_conf = &dev->data->dev_conf.rx_adv_conf.rss_conf;
 
+	if ((port_rss_conf->rss_hf & VMXNET3_MANDATORY_V4_RSS) !=
+	   VMXNET3_MANDATORY_V4_RSS) {
+		PMD_INIT_LOG(WARNING, "RSS: IPv4/6 TCP is required for vmxnet3 RSS, "
+			     "automatically setting it");
+		port_rss_conf->rss_hf |= VMXNET3_MANDATORY_V4_RSS;
+	}
+

`

#define VMXNET3_MANDATORY_V4_RSS ( \
	RTE_ETH_RSS_NONFRAG_IPV4_TCP | \
	RTE_ETH_RSS_NONFRAG_IPV6_TCP)

`

Can you please describe why IPv4/6 TCP hash function is required for driver? And what is the impact, I mean what is the observed behavior without this patch, if RSS is failing without this change patch needs to be fix patch and please describe since when RSS is failing.

Quoted 12 lines
drivers/net/vmxnet3/vmxnet3_rxtx.c +1 -0
 	/* loading hashFunc */
 	dev_rss_conf->hashFunc = VMXNET3_RSS_HASH_FUNC_TOEPLITZ;
 	/* loading hashKeySize */
@@ -1419,6 +1426,7 @@ vmxnet3_rss_configure(struct rte_eth_dev *dev)
 	/* loading indTableSize: Must not exceed VMXNET3_RSS_MAX_IND_TABLE_SIZE (128)*/
 	dev_rss_conf->indTableSize = (uint16_t)((MAX_RX_QUEUES(hw)) * 4);
 
+
 	if (port_rss_conf->rss_key == NULL) {
 		/* Default hash key */
 		port_rss_conf->rss_key = rss_intel_key;

drivers/net/vmxnet3/vmxnet3_rxtx.c vmxnet3_rss_configure(struct rte_eth_dev *dev) · line 1449

Quoted 4 lines
drivers/net/vmxnet3/vmxnet3_rxtx.c +0 -1
@@ -1446,6 +1454,5 @@ vmxnet3_rss_configure(struct rte_eth_dev *dev)
 		dev_rss_conf->hashType |= VMXNET3_RSS_HASH_TYPE_IPV6;
 	if (rss_hf & RTE_ETH_RSS_NONFRAG_IPV6_TCP)
 		dev_rss_conf->hashType |= VMXNET3_RSS_HASH_TYPE_TCP_IPV6;
-

Please drop unrelated/unimportant syntax changes.

Quoted 2 lines
drivers/net/vmxnet3/vmxnet3_rxtx.c +0 -0
 	return VMXNET3_SUCCESS;
 }
#3 lore raw

The check is at an additional location. I agree, and pointed out to him offline earlier, that a check for the h/w version should be used with the additional code, too.

Jochen

From: Ferruh Yigit <[email protected]>
Date: Friday, January 13, 2023 at 8:24 AM
To: Raghav Roy <[email protected]>, [email protected] <[email protected]>
Cc: Jochen Behrens <[email protected]>
Subject: Re: [PATCH] net/vmxnet3: added checks for TCP for RSS Configuration !! External Email

Quoted 4 lines · Raghav Roy

Added checks for TCP in vmxnet3_rss_configure() This check ensures the hashType for RSS, when enabled just for UDP, is not NONE.

Mandatory hash functions for v4 already added in the past:
Commit 52ec00fd1474 ("net/vmxnet3: fix RSS setting on v4")

Now this commit adds it for all versions, why it was fine in the past but it is needed now?

@Jochen, can you please help reviewing this patch?

Quoted 10 lines
---
 drivers/net/vmxnet3/vmxnet3_rxtx.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/net/vmxnet3/vmxnet3_rxtx.c +0 -0
index a875ffec07..e8407c9b2e 100644

drivers/net/vmxnet3/vmxnet3_rxtx.c vmxnet3_rss_configure(struct rte_eth_dev *dev) · line 1421

Quoted 10 lines
drivers/net/vmxnet3/vmxnet3_rxtx.c +7 -0
@@ -1412,6 +1412,13 @@ vmxnet3_rss_configure(struct rte_eth_dev *dev)
      dev_rss_conf = hw->rss_conf;
      port_rss_conf = &dev->data->dev_conf.rx_adv_conf.rss_conf;
 
+     if ((port_rss_conf->rss_hf & VMXNET3_MANDATORY_V4_RSS) !=
+        VMXNET3_MANDATORY_V4_RSS) {
+             PMD_INIT_LOG(WARNING, "RSS: IPv4/6 TCP is required for vmxnet3 RSS, "
+                          "automatically setting it");
+             port_rss_conf->rss_hf |= VMXNET3_MANDATORY_V4_RSS;
+     }
+

`

#define VMXNET3_MANDATORY_V4_RSS ( \
        RTE_ETH_RSS_NONFRAG_IPV4_TCP | \
        RTE_ETH_RSS_NONFRAG_IPV6_TCP)

`

Can you please describe why IPv4/6 TCP hash function is required for driver? And what is the impact, I mean what is the observed behavior without this patch, if RSS is failing without this change patch needs to be fix patch and please describe since when RSS is failing.

Quoted 12 lines
drivers/net/vmxnet3/vmxnet3_rxtx.c +1 -0
      /* loading hashFunc */
      dev_rss_conf->hashFunc = VMXNET3_RSS_HASH_FUNC_TOEPLITZ;
      /* loading hashKeySize */
@@ -1419,6 +1426,7 @@ vmxnet3_rss_configure(struct rte_eth_dev *dev)
      /* loading indTableSize: Must not exceed VMXNET3_RSS_MAX_IND_TABLE_SIZE (128)*/
      dev_rss_conf->indTableSize = (uint16_t)((MAX_RX_QUEUES(hw)) * 4);
 
+
      if (port_rss_conf->rss_key == NULL) {
              /* Default hash key */
              port_rss_conf->rss_key = rss_intel_key;

drivers/net/vmxnet3/vmxnet3_rxtx.c vmxnet3_rss_configure(struct rte_eth_dev *dev) · line 1449

Quoted 4 lines
drivers/net/vmxnet3/vmxnet3_rxtx.c +0 -1
@@ -1446,6 +1454,5 @@ vmxnet3_rss_configure(struct rte_eth_dev *dev)
              dev_rss_conf->hashType |= VMXNET3_RSS_HASH_TYPE_IPV6;
      if (rss_hf & RTE_ETH_RSS_NONFRAG_IPV6_TCP)
              dev_rss_conf->hashType |= VMXNET3_RSS_HASH_TYPE_TCP_IPV6;
-

Please drop unrelated/unimportant syntax changes.

drivers/net/vmxnet3/vmxnet3_rxtx.c vmxnet3_rss_configure(struct rte_eth_dev *dev) · line 1458

Quoted 2 lines
drivers/net/vmxnet3/vmxnet3_rxtx.c +0 -0
      return VMXNET3_SUCCESS;
 }

!! External Email: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender.