From 80e6d636fb39cb880b48d58622401b385ff5a0f1 Mon Sep 17 00:00:00 2001 From: Kiran Kumar K Date: Thu, 13 Aug 2020 12:52:49 +0530 Subject: [PATCH] net/octeontx2: support VLAN based RSS hash Adding support for VLAN based RSS hash. Two bytes of TCI field will be considered for hashing. Signed-off-by: Kiran Kumar K Acked-by: Jerin Jacob --- drivers/common/octeontx2/otx2_mbox.h | 2 ++ drivers/net/octeontx2/otx2_ethdev.h | 3 ++- drivers/net/octeontx2/otx2_rss.c | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/common/octeontx2/otx2_mbox.h b/drivers/common/octeontx2/otx2_mbox.h index 5d66caebd5..78de432e71 100644 --- a/drivers/common/octeontx2/otx2_mbox.h +++ b/drivers/common/octeontx2/otx2_mbox.h @@ -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) diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h index 8e6e70d452..b20f399a15 100644 --- a/drivers/net/octeontx2/otx2_ethdev.h +++ b/drivers/net/octeontx2/otx2_ethdev.h @@ -119,7 +119,8 @@ #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 | \ diff --git a/drivers/net/octeontx2/otx2_rss.c b/drivers/net/octeontx2/otx2_rss.c index 03f7bc7ea5..3ba2366b8f 100644 --- a/drivers/net/octeontx2/otx2_rss.c +++ b/drivers/net/octeontx2/otx2_rss.c @@ -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; -- 2.20.1