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

Signed-off-by: Raghav Roy <ro...@vmware.com>
---
 drivers/net/vmxnet3/vmxnet3_rxtx.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c 
b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index a875ffec07..e8407c9b2e 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_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;
 }
-- 
2.17.1

Reply via email to