From: Michal Swiatkowski Rules whose action can be "to VSI list" should have VSI count set to 1 after creation. There was a lack of it in case of mirroring action. Fix it by setting correct VSI count also for mirror rules. Reproduction: tc filter add dev eth5 ingress protocol arp prio 6301 flower skip_sw \ dst_mac ff:ff:ff:ff:ff:ff action mirred egress mirror dev eth9 tc filter add dev eth5 ingress protocol arp prio 6201 flower skip_sw \ dst_mac ff:ff:ff:ff:ff:ff action mirred egress mirror dev eth10 tc filter del dev eth5 prio 6301 ingress The last command removes the rule, but should only remove one VSI from the forward list. Without the fix: tc filter del dev eth5 prio 6201 ingress results in an error during removing the rule. Fixes: aa4967d8529c ("ice: Add support for packet mirroring using hardware in switchdev mode") Cc: stable@vger.kernel.org Signed-off-by: Michal Swiatkowski Signed-off-by: Aleksandr Loktionov --- drivers/net/ethernet/intel/ice/ice_switch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c index a3e93b1..d77c188 100644 --- a/drivers/net/ethernet/intel/ice/ice_switch.c +++ b/drivers/net/ethernet/intel/ice/ice_switch.c @@ -7318,7 +7318,8 @@ ice_add_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups, sw->recp_list[rid].adv_rule = true; rule_head = &sw->recp_list[rid].filt_rules; - if (rinfo->sw_act.fltr_act == ICE_FWD_TO_VSI) + if (rinfo->sw_act.fltr_act == ICE_FWD_TO_VSI || + rinfo->sw_act.fltr_act == ICE_MIRROR_PACKET) adv_fltr->vsi_count = 1; /* Add rule entry to book keeping list */ -- 2.52.0