ice: Skip adv rules removal upon switchdev release
authorWojciech Drewek <wojciech.drewek@intel.com>
Wed, 12 Jul 2023 11:03:26 +0000 (13:03 +0200)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Mon, 24 Jul 2023 15:52:19 +0000 (08:52 -0700)
Advanced rules for ctrl VSI will be removed anyway when the
VSI will cleaned up, no need to do it explicitly.

Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com>
Tested-by: Sujai Buvaneswaran <sujai.buvaneswaran@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_eswitch.c
drivers/net/ethernet/intel/ice/ice_switch.c
drivers/net/ethernet/intel/ice/ice_switch.h

index ad0a007..be5b226 100644 (file)
@@ -503,7 +503,6 @@ static void ice_eswitch_disable_switchdev(struct ice_pf *pf)
 
        ice_eswitch_napi_disable(pf);
        ice_eswitch_release_env(pf);
-       ice_rem_adv_rule_for_vsi(&pf->hw, ctrl_vsi->idx);
        ice_eswitch_release_reprs(pf, ctrl_vsi);
        ice_vsi_release(ctrl_vsi);
        ice_repr_rem_from_all_vfs(pf);
index 6db4ca7..81f45d7 100644 (file)
@@ -6533,59 +6533,6 @@ ice_rem_adv_rule_by_id(struct ice_hw *hw,
 }
 
 /**
- * ice_rem_adv_rule_for_vsi - removes existing advanced switch rules for a
- *                            given VSI handle
- * @hw: pointer to the hardware structure
- * @vsi_handle: VSI handle for which we are supposed to remove all the rules.
- *
- * This function is used to remove all the rules for a given VSI and as soon
- * as removing a rule fails, it will return immediately with the error code,
- * else it will return success.
- */
-int ice_rem_adv_rule_for_vsi(struct ice_hw *hw, u16 vsi_handle)
-{
-       struct ice_adv_fltr_mgmt_list_entry *list_itr, *tmp_entry;
-       struct ice_vsi_list_map_info *map_info;
-       struct ice_adv_rule_info rinfo;
-       struct list_head *list_head;
-       struct ice_switch_info *sw;
-       int status;
-       u8 rid;
-
-       sw = hw->switch_info;
-       for (rid = 0; rid < ICE_MAX_NUM_RECIPES; rid++) {
-               if (!sw->recp_list[rid].recp_created)
-                       continue;
-               if (!sw->recp_list[rid].adv_rule)
-                       continue;
-
-               list_head = &sw->recp_list[rid].filt_rules;
-               list_for_each_entry_safe(list_itr, tmp_entry, list_head,
-                                        list_entry) {
-                       rinfo = list_itr->rule_info;
-
-                       if (rinfo.sw_act.fltr_act == ICE_FWD_TO_VSI_LIST) {
-                               map_info = list_itr->vsi_list_info;
-                               if (!map_info)
-                                       continue;
-
-                               if (!test_bit(vsi_handle, map_info->vsi_map))
-                                       continue;
-                       } else if (rinfo.sw_act.vsi_handle != vsi_handle) {
-                               continue;
-                       }
-
-                       rinfo.sw_act.vsi_handle = vsi_handle;
-                       status = ice_rem_adv_rule(hw, list_itr->lkups,
-                                                 list_itr->lkups_cnt, &rinfo);
-                       if (status)
-                               return status;
-               }
-       }
-       return 0;
-}
-
-/**
  * ice_replay_vsi_adv_rule - Replay advanced rule for requested VSI
  * @hw: pointer to the hardware structure
  * @vsi_handle: driver VSI handle
index c84b56f..db08509 100644 (file)
@@ -379,7 +379,6 @@ int
 ice_set_vlan_vsi_promisc(struct ice_hw *hw, u16 vsi_handle, u8 promisc_mask,
                         bool rm_vlan_promisc);
 
-int ice_rem_adv_rule_for_vsi(struct ice_hw *hw, u16 vsi_handle);
 int
 ice_rem_adv_rule_by_id(struct ice_hw *hw,
                       struct ice_rule_query_data *remove_entry);