Skip to content

Commit

Permalink
Add mac/vlan support to RSS
Browse files Browse the repository at this point in the history
  • Loading branch information
cardigliano committed Jan 3, 2025
1 parent eb95cc6 commit 557d589
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions drivers/intel/ice/ice-1.12.7-zc/src/ice_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -3944,6 +3944,13 @@ static u32 ice_parse_hdrs(struct ethtool_rxnfc *nfc)
return hdrs;
}

#define ICE_FLOW_HASH_FLD_ETH_SA BIT_ULL(ICE_FLOW_FIELD_IDX_ETH_SA)
#define ICE_FLOW_HASH_FLD_ETH_DA BIT_ULL(ICE_FLOW_FIELD_IDX_ETH_DA)
#define ICE_FLOW_HASH_FLD_S_VLAN BIT_ULL(ICE_FLOW_FIELD_IDX_S_VLAN)
#define ICE_FLOW_HASH_FLD_C_VLAN BIT_ULL(ICE_FLOW_FIELD_IDX_C_VLAN)
#define ICE_FLOW_HASH_FLD_PPPOE_SESS_ID \
BIT_ULL(ICE_FLOW_FIELD_IDX_PPPOE_SESS_ID)

#define ICE_FLOW_HASH_FLD_IPV4_SA BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_SA)
#define ICE_FLOW_HASH_FLD_IPV6_SA BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_SA)
#define ICE_FLOW_HASH_FLD_IPV4_DA BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_DA)
Expand All @@ -3968,6 +3975,16 @@ static u64 ice_parse_hash_flds(struct ethtool_rxnfc *nfc)
{
u64 hfld = ICE_HASH_INVALID;

if (nfc->data & RXH_L2DA) {
hfld |= ICE_FLOW_HASH_FLD_ETH_SA; /* Source MAC Addr */
hfld |= ICE_FLOW_HASH_FLD_ETH_DA; /* Destination MAC Addr */
}

if (nfc->data & RXH_VLAN) {
hfld |= ICE_FLOW_HASH_FLD_S_VLAN; /* Source VLAN */
hfld |= ICE_FLOW_HASH_FLD_C_VLAN; /* QinQ */
}

if (nfc->data & RXH_IP_SRC || nfc->data & RXH_IP_DST) {
switch (nfc->flow_type) {
case TCP_V4_FLOW:
Expand Down

0 comments on commit 557d589

Please sign in to comment.