net/octeontx2: support VLAN based RSS hash
authorKiran Kumar K <kirankumark@marvell.com>
Thu, 13 Aug 2020 07:22:49 +0000 (12:52 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 30 Sep 2020 17:19:11 +0000 (19:19 +0200)
Adding support for VLAN based RSS hash. Two bytes of TCI field
will be considered for hashing.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
drivers/common/octeontx2/otx2_mbox.h
drivers/net/octeontx2/otx2_ethdev.h
drivers/net/octeontx2/otx2_rss.c

index 5d66cae..78de432 100644 (file)
@@ -969,6 +969,8 @@ struct nix_rss_flowkey_cfg {
 #define FLOW_KEY_TYPE_INNR_SCTP     BIT(16)
 #define FLOW_KEY_TYPE_INNR_ETH_DMAC BIT(17)
 #define FLOW_KEY_TYPE_CH_LEN_90B       BIT(18)
+#define FLOW_KEY_TYPE_CUSTOM0          BIT(19)
+#define FLOW_KEY_TYPE_VLAN             BIT(20)
 #define FLOW_KEY_TYPE_L4_DST BIT(28)
 #define FLOW_KEY_TYPE_L4_SRC BIT(29)
 #define FLOW_KEY_TYPE_L3_DST BIT(30)
index 8e6e70d..b20f399 100644 (file)
 #define NIX_RSS_OFFLOAD                (ETH_RSS_PORT | ETH_RSS_IP | ETH_RSS_UDP |\
                                 ETH_RSS_TCP | ETH_RSS_SCTP | \
                                 ETH_RSS_TUNNEL | ETH_RSS_L2_PAYLOAD | \
-                                NIX_RSS_L3_L4_SRC_DST | ETH_RSS_LEVEL_MASK)
+                                NIX_RSS_L3_L4_SRC_DST | ETH_RSS_LEVEL_MASK | \
+                                ETH_RSS_C_VLAN)
 
 #define NIX_TX_OFFLOAD_CAPA ( \
        DEV_TX_OFFLOAD_MBUF_FAST_FREE   | \
index 03f7bc7..3ba2366 100644 (file)
@@ -238,6 +238,9 @@ otx2_rss_ethdev_to_nix(struct otx2_eth_dev *dev, uint64_t ethdev_rss,
                flowkey_cfg |= FLOW_KEY_TYPE_CH_LEN_90B;
        }
 
+       if (ethdev_rss & ETH_RSS_C_VLAN)
+               flowkey_cfg |= FLOW_KEY_TYPE_VLAN;
+
        if (ethdev_rss & ETH_RSS_L3_SRC_ONLY)
                flowkey_cfg |= FLOW_KEY_TYPE_L3_SRC;