Re: [PATCH net v5 3/4] ice: resync uplink filters after a switchdev session
From: Ivan Vecera
Date: Fri Nov 27 2026 - 08:35:41 EST
On 11/27/26 09:57, Petr Oros wrote:
A switchdev session leaves the uplink filters out of sync with its
netdev. ice_eswitch_setup_env() removes the multicast promisc rules and
the address filters, and ice_eswitch_release_env() removes the default
VSI (DFLT) Rx rule that a promiscuous uplink needs. ice_set_rx_mode()
ignores the uplink during the session and nothing syncs it when the
session ends, so these are not installed again, and flag changes made
meanwhile are lost.
Let the eswitch own the uplink promisc configuration during a session.
While the new ICE_VSI_ESWITCH_UPLINK bit is set, ice_vsi_sync_fltr()
leaves it alone. When the session ends, after is_running is cleared,
ice_eswitch_resync_uplink() clears the bit and queues a full filter
sync, which programs the uplink from the netdev flags. Also subscribe a
promiscuous VSI to multicast when it already holds the DFLT rule, and
enable VLAN pruning on every promisc off, because it can be off without
our DFLT rule after a session or with LAG.
This does not restore the uplink VLAN filters that
ice_eswitch_setup_env() removes, a separate problem that now also shows
when promisc is cleared after a promiscuous session.
Found by AI code review, starting with the Sashiko review of v4, and
reproduced on an E810-C (FW 8.1.1, ICE COMMS package 1.3.55.0) without
kernel changes:
ip link set $PF promisc on
devlink dev eswitch set pci/$BDF mode switchdev
echo 1 >/sys/class/net/$PF/device/sriov_numvfs
echo 0 >/sys/class/net/$PF/device/sriov_numvfs
after which unknown unicast no longer reaches the PF, and with this
patch it does again. Also tested on that E810-C with promisc changed
before, during and after sessions, allmulti across a session, and PF
resets and driver removal during sessions. LAG and switchdev setup
errors were not tested. No kernel selftests cover this.
Fixes: 1a1c40df2e80 ("ice: set and release switchdev environment")
Fixes: 2571a3fa6251 ("ice: Prohibit rx mode change in switchdev mode")
Fixes: 5c07be96d8b3 ("ice: Avoid setting default Rx VSI twice in switchdev setup")
Fixes: 776fe19953b0 ("ice: block default rule setting on LAG interface")
Signed-off-by: Petr Oros<poros@xxxxxxxxxx>
Reviewed-by: Ivan Vecera <ivecera@xxxxxxxxxx>