Thread (7 messages) 7 messages, 3 authors, 15d ago

RE: [Intel-wired-lan] [PATCH iwl-net v3 2/2] ice: preserve uplink DFLT Rx rule on switchdev release

From: Loktionov, Aleksandr <hidden>
Date: 2026-07-07 13:32:48
Also in: intel-wired-lan, lkml

quoted hunk ↗ jump to hunk
-----Original Message-----
From: Intel-wired-lan <redacted> On Behalf
Of Petr Oros
Sent: Wednesday, July 1, 2026 3:36 PM
To: netdev@vger.kernel.org
Cc: Vecera, Ivan <ivecera@redhat.com>; Alice Michael
[off-list ref]; Kitszel, Przemyslaw
[off-list ref]; Eric Dumazet [off-list ref];
linux-kernel@vger.kernel.org; Martyna Szapar-Mudlaw <martyna.szapar-
mudlaw@linux.intel.com>; Andrew Lunn [off-list ref]; Marcin
Szycik [off-list ref]; Nguyen, Anthony L
[off-list ref]; Simon Horman [off-list ref]; intel-
wired-lan@lists.osuosl.org; Keller, Jacob E
[off-list ref]; Jakub Kicinski [off-list ref]; Paolo
Abeni [off-list ref]; David S. Miller [off-list ref]
Subject: [Intel-wired-lan] [PATCH iwl-net v3 2/2] ice: preserve uplink
DFLT Rx rule on switchdev release

When the uplink PF is promiscuous, ice_vsi_sync_fltr() installs an
ICE_SW_LKUP_DFLT catch-all Rx rule on the uplink VSI. Entering
switchdev re-affirms it through the idempotent ice_set_dflt_vsi(), but
ice_eswitch_release_env() removed both the Rx and Tx DFLT rules
unconditionally on teardown. That clobbered a promisc-owned Rx rule:
it disappeared while IFF_PROMISC was still set and the sync path was
not retriggered, leaving the uplink without the catch-all the netdev
requested.

Skip the Rx DFLT removal when the uplink is promiscuous, both in
ice_eswitch_release_env() and the err_def_tx unwind of
ice_eswitch_setup_env(); the Tx leg, owned by switchdev, is still
removed.
Test the live netdev->flags, the same value ena_rx_filtering() ->
ice_cfg_vlan_pruning() above already keys on, so the preserved rule
and the pruning state stay consistent, including for a promisc change
made while switchdev ran (which never reached the gated filter sync).

Fixes: 5c07be96d8b3 ("ice: Avoid setting default Rx VSI twice in
switchdev setup")
Signed-off-by: Petr Oros <redacted>
---
v3:
- Corrected the Fixes tag from 1a1c40df2e80 ("ice: set and release
  switchdev environment") to 5c07be96d8b3 ("ice: Avoid setting default
  Rx VSI twice in switchdev setup"), the commit that made
  ice_eswitch_setup_env() use the idempotent ice_set_dflt_vsi();
before
  it a pre-existing promisc DFLT rule made setup fail with -EEXIST so
the
  release path was never reached. No code change.

v2: https://lore.kernel.org/all/20260622113428.2565255-3-
poros@redhat.com/
v1:
https://lore.kernel.org/all/deef5756e534ef06c12d910c5305d3fd205d30a0.1
781786935.git.poros@redhat.com/
---
 drivers/net/ethernet/intel/ice/ice_eswitch.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_eswitch.c
b/drivers/net/ethernet/intel/ice/ice_eswitch.c
index c30e27bbfe6e25..07e2016fb9481f 100644
--- a/drivers/net/ethernet/intel/ice/ice_eswitch.c
+++ b/drivers/net/ethernet/intel/ice/ice_eswitch.c
@@ -66,8 +66,10 @@ static int ice_eswitch_setup_env(struct ice_pf *pf)
 	ice_cfg_dflt_vsi(uplink_vsi->port_info, uplink_vsi->idx, false,
 			 ICE_FLTR_TX);
 err_def_tx:
-	ice_cfg_dflt_vsi(uplink_vsi->port_info, uplink_vsi->idx, false,
-			 ICE_FLTR_RX);
+	/* keep the Rx DFLT rule if the uplink is promiscuous (see
release_env) */
+	if (!(uplink_vsi->netdev->flags & IFF_PROMISC))
+		ice_cfg_dflt_vsi(uplink_vsi->port_info, uplink_vsi->idx,
+				 false, ICE_FLTR_RX);
 err_def_rx:
 	ice_vsi_del_vlan_zero(uplink_vsi);
 err_vlan_zero:
@@ -276,8 +278,16 @@ static void ice_eswitch_release_env(struct ice_pf
*pf)
 	vlan_ops->ena_rx_filtering(uplink_vsi);
 	ice_cfg_dflt_vsi(uplink_vsi->port_info, uplink_vsi->idx, false,
 			 ICE_FLTR_TX);
-	ice_cfg_dflt_vsi(uplink_vsi->port_info, uplink_vsi->idx, false,
-			 ICE_FLTR_RX);
+
+	/* Keep the Rx DFLT rule if the uplink is promiscuous; it must
outlive
+	 * the session. Test the live netdev->flags, the same value
+	 * ena_rx_filtering() -> ice_cfg_vlan_pruning() above keys its
decision
+	 * on, so the preserved DFLT rule and the pruning state stay
consistent.
+	 */
+	if (!(uplink_vsi->netdev->flags & IFF_PROMISC))
+		ice_cfg_dflt_vsi(uplink_vsi->port_info, uplink_vsi->idx,
+				 false, ICE_FLTR_RX);
+
 	ice_fltr_add_mac_and_broadcast(uplink_vsi,
 				       uplink_vsi->port_info-
quoted
mac.perm_addr,
 				       ICE_FWD_TO_VSI);
--
2.54.0
Reviewed-by: Aleksandr Loktionov <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help