[PATCH v1 07/12] net/ice/base: allow overriding recipe ID

Anatoly Burakov anatoly.burakov at intel.com
Tue Sep 2 19:26:57 CEST 2025


From: Pandi Kumar Maharajan <pandi.maharajan at intel.com>

With the addition of double VLAN mode on the device, the MAC VLAN filter
add rule was previously matching only the inner VLAN, rather than the
intended outer VLAN. This patch resolves the issue by introducing a new
software recipe ID as part of ice_fltr_info, allowing the base code to
send the newly created recipe ID. This ensures that the filter correctly
matches the outer VLAN when processing packets. Issue is observed in ESXi
environment but this patch introduces a generic solution for all
operating systems by adding a rid_override flag. If the base driver needs
to use a recipe ID different from the shared code default, it can set the
rid variable and enable the rid_override flag. This instructs the shared
code to use the specified rid instead of the default value.

Signed-off-by: Pandi Kumar Maharajan <pandi.maharajan at intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
---
 drivers/net/intel/ice/base/ice_switch.c | 6 +++++-
 drivers/net/intel/ice/base/ice_switch.h | 4 ++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/net/intel/ice/base/ice_switch.c b/drivers/net/intel/ice/base/ice_switch.c
index 628473f100..fff61b89d7 100644
--- a/drivers/net/intel/ice/base/ice_switch.c
+++ b/drivers/net/intel/ice/base/ice_switch.c
@@ -4113,7 +4113,11 @@ ice_fill_sw_rule(struct ice_hw *hw, struct ice_fltr_info *f_info,
 		CPU_TO_LE16(ICE_AQC_SW_RULES_T_LKUP_TX);
 
 	/* Recipe set depending on lookup type */
-	s_rule->recipe_id = CPU_TO_LE16(f_info->lkup_type);
+	if (f_info->rid_override) {
+		s_rule->recipe_id = CPU_TO_LE16(f_info->rid);
+	} else {
+		s_rule->recipe_id = CPU_TO_LE16(f_info->lkup_type);
+	}
 	s_rule->src = CPU_TO_LE16(f_info->src);
 	s_rule->act = CPU_TO_LE32(act);
 
diff --git a/drivers/net/intel/ice/base/ice_switch.h b/drivers/net/intel/ice/base/ice_switch.h
index 8eac7739fb..73452cc4c7 100644
--- a/drivers/net/intel/ice/base/ice_switch.h
+++ b/drivers/net/intel/ice/base/ice_switch.h
@@ -195,6 +195,10 @@ struct ice_fltr_info {
 	u8 lb_en;	/* Indicate if packet can be looped back */
 	u8 lan_en;	/* Indicate if packet can be forwarded to the uplink */
 	u8 fltVeb_en;   /* Indicate if VSI is connected to floating VEB */
+
+	/* Override default Recipe ID */
+	u16 rid;
+	bool rid_override;
 };
 
 struct ice_update_recipe_lkup_idx_params {
-- 
2.47.3



More information about the dev mailing list