From: Raghav Roy <royra@vmware.com>
To: dev@dpdk.org
Cc: jbehrens@vmware.com
Subject: [PATCH] net/vmxnet3: added checks for TCP for RSS Configuration
Date: Tue, 20 Dec 2022 20:19:17 -0800 [thread overview]
Message-ID: <20221221041917.29569-1-royra@vmware.com> (raw)
Added checks for TCP in vmxnet3_rss_configure()
This check ensures the the hashType for RSS, when enabled just for UDP, is not NONE.
Signed-off-by: Raghav Roy <royra@vmware.com>
---
drivers/net/vmxnet3/vmxnet3_ethdev.h | 3 +++
drivers/net/vmxnet3/vmxnet3_rxtx.c | 9 ++++++++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.h b/drivers/net/vmxnet3/vmxnet3_ethdev.h
index 5a303717b1..95ce13dd76 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.h
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.h
@@ -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;
diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index a875ffec07..8f5a107169 100644
--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
@@ -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;
}
--
2.17.1
next reply other threads:[~2022-12-21 10:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-21 4:19 Raghav Roy [this message]
2022-12-22 8:24 ` [PATCH] net/vmxnet3: added checks for TCP for RSS Configuration Raghav Roy
2023-01-13 16:24 ` Ferruh Yigit
2023-01-13 22:03 ` Jochen Behrens
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=20221221041917.29569-1-royra@vmware.com \
--to=royra@vmware.com \
--cc=dev@dpdk.org \
--cc=jbehrens@vmware.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.