diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/intel/ice/ice_switch.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c index d560a8aa5015..09d1c314b68f 100644 --- a/drivers/net/ethernet/intel/ice/ice_switch.c +++ b/drivers/net/ethernet/intel/ice/ice_switch.c | |||
@@ -1538,9 +1538,20 @@ ice_remove_rule_internal(struct ice_hw *hw, u8 recp_id, | |||
1538 | } else if (!list_elem->vsi_list_info) { | 1538 | } else if (!list_elem->vsi_list_info) { |
1539 | status = ICE_ERR_DOES_NOT_EXIST; | 1539 | status = ICE_ERR_DOES_NOT_EXIST; |
1540 | goto exit; | 1540 | goto exit; |
1541 | } else if (list_elem->vsi_list_info->ref_cnt > 1) { | ||
1542 | /* a ref_cnt > 1 indicates that the vsi_list is being | ||
1543 | * shared by multiple rules. Decrement the ref_cnt and | ||
1544 | * remove this rule, but do not modify the list, as it | ||
1545 | * is in-use by other rules. | ||
1546 | */ | ||
1547 | list_elem->vsi_list_info->ref_cnt--; | ||
1548 | remove_rule = true; | ||
1541 | } else { | 1549 | } else { |
1542 | if (list_elem->vsi_list_info->ref_cnt > 1) | 1550 | /* a ref_cnt of 1 indicates the vsi_list is only used |
1543 | list_elem->vsi_list_info->ref_cnt--; | 1551 | * by one rule. However, the original removal request is only |
1552 | * for a single VSI. Update the vsi_list first, and only | ||
1553 | * remove the rule if there are no further VSIs in this list. | ||
1554 | */ | ||
1544 | vsi_handle = f_entry->fltr_info.vsi_handle; | 1555 | vsi_handle = f_entry->fltr_info.vsi_handle; |
1545 | status = ice_rem_update_vsi_list(hw, vsi_handle, list_elem); | 1556 | status = ice_rem_update_vsi_list(hw, vsi_handle, list_elem); |
1546 | if (status) | 1557 | if (status) |