net/ice/base: ignore inverse switch recipes
authorQi Zhang <qi.z.zhang@intel.com>
Thu, 29 Aug 2019 02:36:56 +0000 (10:36 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 7 Oct 2019 13:00:53 +0000 (15:00 +0200)
When looking for an existing recipes, never choose an inverse
recipe as these are used for anti-spoofing. Choosing inverse
recipes for source MAC address rules was causing errors while
adding the rule.

Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
drivers/net/ice/base/ice_switch.c

index 59da7ea..2437fae 100644 (file)
@@ -4709,6 +4709,11 @@ static u16 ice_find_recp(struct ice_hw *hw, struct ice_prot_lkup_ext *lkup_exts)
                                                &refresh_required))
                                continue;
 
+               /* Skip inverse action recipes */
+               if (recp[i].root_buf && recp[i].root_buf->content.act_ctrl &
+                   ICE_AQ_RECIPE_ACT_INV_ACT)
+                       continue;
+
                /* if number of words we are looking for match */
                if (lkup_exts->n_val_words == recp[i].lkup_exts.n_val_words) {
                        struct ice_fv_word *a = lkup_exts->fv_words;