Skip to content

Commit e81e1d7

Browse files
Michal Swiatkowskianguy11
authored andcommitted
ice: add recipe priority check in search
The new recipe should be added even if exactly the same recipe already exists with different priority. Example use case is when the rule is being added from TC tool context. It should has the highest priority, but if the recipe already exists the rule will inherit it priority. It can lead to the situation when the rule added from TC tool has lower priority than expected. The solution is to check the recipe priority when trying to find existing one. Previous recipe is still useful. Example: RID 8 -> priority 4 RID 10 -> priority 7 The difference is only in priority rest is let's say eth + mac + direction. Adding ARP + MAC_A + RX on RID 8, forward to VF0_VSI After that IP + MAC_B + RX on RID 10 (from TC tool), forward to PF0 Both will work. In case of adding ARP + MAC_A + RX on RID 8, forward to VF0_VSI ARP + MAC_A + RX on RID 10, forward to PF0. Only second one will match, but this is expected. Reviewed-by: Marcin Szycik <[email protected]> Reviewed-by: Przemek Kitszel <[email protected]> Signed-off-by: Michal Swiatkowski <[email protected]> Reviewed-by: Simon Horman <[email protected]> Tested-by: Sujai Buvaneswaran <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent fb59a52 commit e81e1d7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4784,7 +4784,8 @@ ice_find_recp(struct ice_hw *hw, struct ice_prot_lkup_ext *lkup_exts,
47844784
*/
47854785
if (found && recp[i].tun_type == rinfo->tun_type &&
47864786
recp[i].need_pass_l2 == rinfo->need_pass_l2 &&
4787-
recp[i].allow_pass_l2 == rinfo->allow_pass_l2)
4787+
recp[i].allow_pass_l2 == rinfo->allow_pass_l2 &&
4788+
recp[i].priority == rinfo->priority)
47884789
return i; /* Return the recipe ID */
47894790
}
47904791
}

0 commit comments

Comments
 (0)