net/cxgbe: enable more RSS hash functions
authorRahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Fri, 29 Jun 2018 19:23:52 +0000 (00:53 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 4 Jul 2018 20:52:21 +0000 (22:52 +0200)
Enable RSS on IPv4 fragmented packets and IPv6 packets with extension
headers based on 2-tuple hash.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
drivers/net/cxgbe/cxgbe.h
drivers/net/cxgbe/cxgbe_ethdev.c
drivers/net/cxgbe/cxgbe_main.c

index 96a6a40..70f974f 100644 (file)
 #define CXGBE_LINK_STATUS_POLL_CNT 100 /* Max number of times to poll */
 
 #define CXGBE_DEFAULT_RSS_KEY_LEN     40 /* 320-bits */
-#define CXGBE_RSS_HF_ALL (ETH_RSS_IPV4 | ETH_RSS_IPV6 | \
-                         ETH_RSS_NONFRAG_IPV4_TCP | \
-                         ETH_RSS_NONFRAG_IPV4_UDP | \
-                         ETH_RSS_NONFRAG_IPV6_TCP | \
-                         ETH_RSS_NONFRAG_IPV6_UDP)
+#define CXGBE_RSS_HF_IPV4_MASK (ETH_RSS_IPV4 | ETH_RSS_FRAG_IPV4 | \
+                               ETH_RSS_NONFRAG_IPV4_OTHER)
+#define CXGBE_RSS_HF_IPV6_MASK (ETH_RSS_IPV6 | ETH_RSS_FRAG_IPV6 | \
+                               ETH_RSS_NONFRAG_IPV6_OTHER | \
+                               ETH_RSS_IPV6_EX)
+#define CXGBE_RSS_HF_TCP_IPV6_MASK (ETH_RSS_NONFRAG_IPV6_TCP | \
+                                   ETH_RSS_IPV6_TCP_EX)
+#define CXGBE_RSS_HF_UDP_IPV6_MASK (ETH_RSS_NONFRAG_IPV6_UDP | \
+                                   ETH_RSS_IPV6_UDP_EX)
+#define CXGBE_RSS_HF_ALL (ETH_RSS_IP | ETH_RSS_TCP | ETH_RSS_UDP)
 
 #define CXGBE_DEVARG_KEEP_OVLAN "keep_ovlan"
 #define CXGBE_DEVARG_FORCE_LINK_UP "force_link_up"
index 53ac7e2..f1ca89c 100644 (file)
@@ -867,13 +867,13 @@ static int cxgbe_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
                return err;
 
        if (flags & F_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN) {
-               rss_hf |= ETH_RSS_NONFRAG_IPV6_TCP;
+               rss_hf |= CXGBE_RSS_HF_TCP_IPV6_MASK;
                if (flags & F_FW_RSS_VI_CONFIG_CMD_UDPEN)
-                       rss_hf |= ETH_RSS_NONFRAG_IPV6_UDP;
+                       rss_hf |= CXGBE_RSS_HF_UDP_IPV6_MASK;
        }
 
        if (flags & F_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN)
-               rss_hf |= ETH_RSS_IPV6;
+               rss_hf |= CXGBE_RSS_HF_IPV6_MASK;
 
        if (flags & F_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN) {
                rss_hf |= ETH_RSS_NONFRAG_IPV4_TCP;
@@ -882,7 +882,7 @@ static int cxgbe_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
        }
 
        if (flags & F_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN)
-               rss_hf |= ETH_RSS_IPV4;
+               rss_hf |= CXGBE_RSS_HF_IPV4_MASK;
 
        rss_conf->rss_hf = rss_hf;
 
index c40a2d9..c3f0053 100644 (file)
@@ -1341,7 +1341,7 @@ int cxgbe_write_rss_conf(const struct port_info *pi, uint64_t rss_hf)
        if (rss_hf & ~CXGBE_RSS_HF_ALL)
                return -EINVAL;
 
-       if (rss_hf & ETH_RSS_IPV4)
+       if (rss_hf & CXGBE_RSS_HF_IPV4_MASK)
                flags |= F_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN;
 
        if (rss_hf & ETH_RSS_NONFRAG_IPV4_TCP)
@@ -1351,14 +1351,16 @@ int cxgbe_write_rss_conf(const struct port_info *pi, uint64_t rss_hf)
                flags |= F_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN |
                         F_FW_RSS_VI_CONFIG_CMD_UDPEN;
 
-       if (rss_hf & ETH_RSS_IPV6)
+       if (rss_hf & CXGBE_RSS_HF_IPV6_MASK)
                flags |= F_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN;
 
-       if (rss_hf & ETH_RSS_NONFRAG_IPV6_TCP)
-               flags |= F_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN;
+       if (rss_hf & CXGBE_RSS_HF_TCP_IPV6_MASK)
+               flags |= F_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN |
+                        F_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN;
 
-       if (rss_hf & ETH_RSS_NONFRAG_IPV6_UDP)
-               flags |= F_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN |
+       if (rss_hf & CXGBE_RSS_HF_UDP_IPV6_MASK)
+               flags |= F_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN |
+                        F_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN |
                         F_FW_RSS_VI_CONFIG_CMD_UDPEN;
 
        rxq = &adapter->sge.ethrxq[pi->first_qset];