Skip to content

Commit 74382ae

Browse files
Marcin Szycikkuba-moo
authored andcommitted
ice: Fix VSI list rule with ICE_SW_LKUP_LAST type
Adding/updating VSI list rule, as well as allocating/freeing VSI list resource are called several times with type ICE_SW_LKUP_LAST, which fails because ice_update_vsi_list_rule() and ice_aq_alloc_free_vsi_list() consider it invalid. Allow calling these functions with ICE_SW_LKUP_LAST. This fixes at least one issue in switchdev mode, where the same rule with different action cannot be added, e.g.: tc filter add dev $PF1 ingress protocol arp prio 0 flower skip_sw \ dst_mac ff:ff:ff:ff:ff:ff action mirred egress redirect dev $VF1_PR tc filter add dev $PF1 ingress protocol arp prio 0 flower skip_sw \ dst_mac ff:ff:ff:ff:ff:ff action mirred egress redirect dev $VF2_PR Fixes: 0f94570 ("ice: allow adding advanced rules") Suggested-by: Michal Swiatkowski <[email protected]> Reviewed-by: Michal Swiatkowski <[email protected]> Reviewed-by: Przemek Kitszel <[email protected]> Signed-off-by: Marcin Szycik <[email protected]> Reviewed-by: Jacob Keller <[email protected]> Reviewed-by: Simon Horman <[email protected]> Tested-by: Sujai Buvaneswaran <[email protected]> Signed-off-by: Tony Nguyen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 02a176d commit 74382ae

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/net/ethernet/intel/ice/ice_switch.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1899,7 +1899,8 @@ ice_aq_alloc_free_vsi_list(struct ice_hw *hw, u16 *vsi_list_id,
18991899
lkup_type == ICE_SW_LKUP_ETHERTYPE_MAC ||
19001900
lkup_type == ICE_SW_LKUP_PROMISC ||
19011901
lkup_type == ICE_SW_LKUP_PROMISC_VLAN ||
1902-
lkup_type == ICE_SW_LKUP_DFLT) {
1902+
lkup_type == ICE_SW_LKUP_DFLT ||
1903+
lkup_type == ICE_SW_LKUP_LAST) {
19031904
sw_buf->res_type = cpu_to_le16(ICE_AQC_RES_TYPE_VSI_LIST_REP);
19041905
} else if (lkup_type == ICE_SW_LKUP_VLAN) {
19051906
if (opc == ice_aqc_opc_alloc_res)
@@ -2922,7 +2923,8 @@ ice_update_vsi_list_rule(struct ice_hw *hw, u16 *vsi_handle_arr, u16 num_vsi,
29222923
lkup_type == ICE_SW_LKUP_ETHERTYPE_MAC ||
29232924
lkup_type == ICE_SW_LKUP_PROMISC ||
29242925
lkup_type == ICE_SW_LKUP_PROMISC_VLAN ||
2925-
lkup_type == ICE_SW_LKUP_DFLT)
2926+
lkup_type == ICE_SW_LKUP_DFLT ||
2927+
lkup_type == ICE_SW_LKUP_LAST)
29262928
rule_type = remove ? ICE_AQC_SW_RULES_T_VSI_LIST_CLEAR :
29272929
ICE_AQC_SW_RULES_T_VSI_LIST_SET;
29282930
else if (lkup_type == ICE_SW_LKUP_VLAN)

0 commit comments

Comments
 (0)