RE: [Intel-wired-lan] [PATCH iwl-next v4 3/7] ice: allow overriding lan_en, lb_en in switch

From: Romanowski, Rafal

Date: Mon Mar 02 2026 - 12:39:32 EST


> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@xxxxxxxxxx> On Behalf Of Jakub
> Slepecki
> Sent: Wednesday, February 4, 2026 4:44 PM
> To: intel-wired-lan@xxxxxxxxxxxxxxxx
> Cc: linux-kernel@xxxxxxxxxxxxxxx; netdev@xxxxxxxxxxxxxxx; Kitszel, Przemyslaw
> <przemyslaw.kitszel@xxxxxxxxx>; Nguyen, Anthony L
> <anthony.l.nguyen@xxxxxxxxx>; michal.swiatkowski@xxxxxxxxxxxxxxx; Slepecki,
> Jakub <jakub.slepecki@xxxxxxxxx>; Loktionov, Aleksandr
> <aleksandr.loktionov@xxxxxxxxx>
> Subject: [Intel-wired-lan] [PATCH iwl-next v4 3/7] ice: allow overriding lan_en,
> lb_en in switch
>
> Currently, lan_en and lb_en are determined based on switching mode, destination
> MAC, and the lookup type, action type and flags of the rule in question. This gives
> little to no options for the user (such as
> ice_fltr.c) to enforce rules to behave in a specific way.
>
> Such functionality is needed to work with pairs of rules, for example, when
> handling MAC forward to LAN together with MAC,VLAN forward to loopback rules
> pair. This case could not be easily deduced in a context of a single filter without
> adding some guessing logic or a specialized flag.
>
> Add a slightly more generic flag to the lan_en and lb_en themselves for the
> ice_fltr.c to request specific destination flags later on, for example, to override
> both values:
>
> struct ice_fltr_info fi;
> fi.lb_en = ICE_FLTR_INFO_LB_LAN_FORCE_ENABLED;
> fi.lan_en = ICE_FLTR_INFO_LB_LAN_FORCE_DISABLED;
>
> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@xxxxxxxxx>
> Signed-off-by: Jakub Slepecki <jakub.slepecki@xxxxxxxxx>
> ---
> Added R-B from Aleksandr as we talked live and he reviewed the changes.
>
> No changes in v4.
>
> Changes in v3:
> - LB_LAN masks and values no longer rely on boolean promotion.
> - ice_fill_sw_info() deals with u8 the entire time instead of building
> building lb_en and lan_en values at the end from booleans.
>
> Changes in v2:
> - Use FIELD_GET et al. when handling fi.lb_en and fi.lan_en.
> - Rename /LB_LAN/s/_MASK/_M/ because one of uses would need to break
> line
> ---
> drivers/net/ethernet/intel/ice/ice_switch.c | 25 +++++++++++++--------
> drivers/net/ethernet/intel/ice/ice_switch.h | 19 +++++++++++++---
> 2 files changed, 32 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/ice/ice_switch.c
> b/drivers/net/ethernet/intel/ice/ice_switch.c
> index 04e5d653efce..3caccd798220 100644
> --- a/drivers/net/ethernet/intel/ice/ice_switch.c
> +++ b/drivers/net/ethernet/intel/ice/ice_switch.c
> @@ -2534,12 +2534,14 @@ int ice_get_initial_sw_cfg(struct ice_hw *hw)


Tested-by: Rafal Romanowski <rafal.romanowski@xxxxxxxxx>