Re: [PATCH net v5 2/4] ice: do not leave switchdev mode while representors exist
From: Petr Oros
Date: Mon Nov 30 2026 - 08:20:44 EST
On Sat, 28 Nov 2026 09:30:08 +0000, netdev-bot+sashiko@xxxxxxxxxx wrote:
> - [Medium] The new `xa_empty(&pf->eswitch.reprs)` check in
> ice_eswitch_mode_set() is protected only by the PF devlink lock, which…
Right. v6 checks pf->dyn_ports instead, which only changes under that
lock.
> - [Low] The commit message understates what this patch fixes.
Right. On the E810-C without the patch, devlink port del of the SF port
after the switch to legacy returned 0, the representor netdev stayed
registered, and KASAN reported a slab use after free in
devlink_nl_port_fill() when the port list was read. The v6 message
says so.
> - [Low] In ice_eswitch_mode_set(), the new
> `!xa_empty(&pf->eswitch.reprs)` check (ice_eswitch.c:358) runs before…
Right. v6 checks only on the way to legacy. With an SF port and DCB on,
switchdev_inactive gets EINVAL "ice: Unknown eswitch mode" again, as
without the patch.
> - [Low] The new gate checks whether pf->eswitch.reprs is empty, not
> whether SF ports exist.
v6 checks the SF ports. The failed xa_insert() in
ice_eswitch_update_repr() itself is older than the series, from commit
fff5cca345a6 ("ice: update representor when VSI is ready"), and is not
changed here.
pw-bot: cr