aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ice/ice_switch.c
diff options
context:
space:
mode:
authorMichal Swiatkowski <[email protected]>2023-04-07 16:52:15 +0000
committerTony Nguyen <[email protected]>2023-05-19 15:57:43 +0000
commitecd01b69a5f8edda731d8a7cfe33c9ffa0c85700 (patch)
tree0b74a29e71c8c7bf9a03c47a0f5b9484026c4c29 /drivers/net/ethernet/intel/ice/ice_switch.c
parentnet: arc: Make arc_emac_remove() return void (diff)
downloadkernel-ecd01b69a5f8edda731d8a7cfe33c9ffa0c85700.tar.gz
kernel-ecd01b69a5f8edda731d8a7cfe33c9ffa0c85700.zip
ice: define meta data to match in switch
Add description for each meta data. Redefine tunnel mask to match only tunneled MAC and tunneled VLAN. It shouldn't try to match other flags (previously it was 0xff, it is redundant). VLAN mask was 0xd000, change it to 0xf000. 4 last bits are flags depending on the same field in packets (VLAN tag). Because of that, It isn't harmful to match also on ITAG. Group all MDID and MDID offsets into enums to keep things organized. Signed-off-by: Michal Swiatkowski <[email protected]> Reviewed-by: Piotr Raczynski <[email protected]> Reviewed-by: Simon Horman <[email protected]> Reviewed-by: Leon Romanovsky <[email protected]> Tested-by: Sujai Buvaneswaran <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_switch.c')
-rw-r--r--drivers/net/ethernet/intel/ice/ice_switch.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c
index 46b36851af46..5c3f266fa80f 100644
--- a/drivers/net/ethernet/intel/ice/ice_switch.c
+++ b/drivers/net/ethernet/intel/ice/ice_switch.c
@@ -5268,7 +5268,7 @@ static bool ice_tun_type_match_word(enum ice_sw_tunnel_type tun_type, u16 *mask)
case ICE_SW_TUN_NVGRE:
case ICE_SW_TUN_GTPU:
case ICE_SW_TUN_GTPC:
- *mask = ICE_TUN_FLAG_MASK;
+ *mask = ICE_PKT_TUNNEL_MASK;
return true;
default:
@@ -5297,7 +5297,8 @@ ice_add_special_words(struct ice_adv_rule_info *rinfo,
u8 word = lkup_exts->n_val_words++;
lkup_exts->fv_words[word].prot_id = ICE_META_DATA_ID_HW;
- lkup_exts->fv_words[word].off = ICE_TUN_FLAG_MDID_OFF;
+ lkup_exts->fv_words[word].off =
+ ICE_PKT_TUNNEL_MDID_OFFSET;
lkup_exts->field_mask[word] = mask;
} else {
return -ENOSPC;
@@ -5309,9 +5310,9 @@ ice_add_special_words(struct ice_adv_rule_info *rinfo,
u8 word = lkup_exts->n_val_words++;
lkup_exts->fv_words[word].prot_id = ICE_META_DATA_ID_HW;
- lkup_exts->fv_words[word].off = ICE_VLAN_FLAG_MDID_OFF;
- lkup_exts->field_mask[word] =
- ICE_PKT_FLAGS_0_TO_15_VLAN_FLAGS_MASK;
+ lkup_exts->fv_words[word].off =
+ ICE_PKT_VLAN_MDID_OFFSET;
+ lkup_exts->field_mask[word] = ICE_PKT_VLAN_MASK;
} else {
return -ENOSPC;
}