Re: [PATCH net v7 3/4] ice: resync uplink filters after a switchdev session

From: Petr Oros

Date: Thu Dec 03 2026 - 04:51:33 EST


On Wed, Dec 03, 2026 at 08:01:57AM +0000, Sashiko wrote:
> Would a per-VSI mutex around the filter and promisc state give the same
> exclusion, with proper acquire/release semantics?

No, it would give none. The state the two new sections touch is the state
ice_vsi_sync_fltr(), ice_vlan_rx_add_vid() and ice_vlan_rx_kill_vid()
already touch under ICE_CFG_BUSY in vsi->state. A fresh mutex taken only
by the eswitch paths would not exclude any of them and the handoff would
stop working, so all of them would have to be converted at once.

ICE_CFG_BUSY also cannot just become a mutex. ice_reset_subtask(),
ice_watchdog_subtask() and ice_update_vsi_stats() only test_bit() it to
decide whether to skip a pass, so it would first have to be split into a
lock and a separate "reconfiguration in flight" flag, across vsi->state
and pf->state both.

That is a driver wide cleanup, and this is a fix for net with four Fixes
tags reaching back to 1a1c40df2e80 ("ice: set and release switchdev
environment") from 2021, headed for stable. The review found no concrete
deadlock among the current holders, so there is nothing incorrect here to
fix, and using the serialization the driver already has is what keeps the
backport small.

> This version had to switch ice_vsi_sync_fltr() to clear_bit_unlock(),
> but other holders of the same bit still release it with a plain
> clear_bit():

Fair, and pre-existing. Both VLAN ndos write current_netdev_flags and
reprogram promisc rules in their section and release with plain
clear_bit(), which is already weak against ice_vsi_sync_fltr() without
this series. v7 tightened the one release the handoff depends on and left
the rest alone on purpose. I will send the ndos, and the full conversion
if people want it, for net-next.

Thanks,
Petr