octeontx2-af: Add support for VLAN based RSS hashing

Added support for PF/VF drivers to choose RSS flow key algorithm
with VLAN tag included in hashing input data. Only CTAG is considered.

Signed-off-by: George Cherian <george.cherian@marvell.com>
Signed-off-by: Sunil Goutham <sgoutham@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
George Cherian 2020-09-22 18:37:26 +05:30 committed by David S. Miller
parent de2b541b3b
commit 8f900363df
2 changed files with 9 additions and 0 deletions

View File

@ -625,6 +625,7 @@ struct nix_rss_flowkey_cfg {
#define NIX_FLOW_KEY_TYPE_INNR_UDP BIT(15) #define NIX_FLOW_KEY_TYPE_INNR_UDP BIT(15)
#define NIX_FLOW_KEY_TYPE_INNR_SCTP BIT(16) #define NIX_FLOW_KEY_TYPE_INNR_SCTP BIT(16)
#define NIX_FLOW_KEY_TYPE_INNR_ETH_DMAC BIT(17) #define NIX_FLOW_KEY_TYPE_INNR_ETH_DMAC BIT(17)
#define NIX_FLOW_KEY_TYPE_VLAN BIT(20)
u32 flowkey_cfg; /* Flowkey types selected */ u32 flowkey_cfg; /* Flowkey types selected */
u8 group; /* RSS context or group */ u8 group; /* RSS context or group */
}; };

View File

@ -2509,6 +2509,14 @@ static int set_flowkey_fields(struct nix_rx_flowkey_alg *alg, u32 flow_cfg)
field->ltype_match = NPC_LT_LE_GTPU; field->ltype_match = NPC_LT_LE_GTPU;
field->ltype_mask = 0xF; field->ltype_mask = 0xF;
break; break;
case NIX_FLOW_KEY_TYPE_VLAN:
field->lid = NPC_LID_LB;
field->hdr_offset = 2; /* Skip TPID (2-bytes) */
field->bytesm1 = 1; /* 2 Bytes (Actually 12 bits) */
field->ltype_match = NPC_LT_LB_CTAG;
field->ltype_mask = 0xF;
field->fn_mask = 1; /* Mask out the first nibble */
break;
} }
field->ena = 1; field->ena = 1;