Re: [PATCH iwl-net v2] ice: release IRQs and rings in ice_dis_vsi() when the VSI is already down

From: Ionut Nechita (Wind River)

Date: Wed Nov 25 2026 - 10:30:54 EST


On 11/25/26 11:51 AM, Przemek Kitszel wrote:
> I've run your patch through our local sashiko instance, and it reports
> that your patch adds new problems on edge cases. The same issues were
> reported both on your patch just on top of netdev/main and
> tony/dev-queue+some more fixes (meaning those problems are not "already
> resolved elsewhere"). For the first issue (DCB) both my and Petr Oros
> patches were applied (not yet on netdev main (aka -net)).

Hi Przemek,

Thank you for running it and for sharing the report.

> [Severity: High]
> Can this free DMA memory that enabled hardware queues still own?

Yes, this is right, and it makes the patch worse than the problem it
fixes. If ice_up_complete() fails in ice_vsi_start_all_rx_rings(), it
returns with ICE_VSI_DOWN still set, while the Tx queues are enabled by
FW and the Rx queues may be enabled with buffers posted. Today that
memory is leaked but stays allocated and mapped; with my patch
ice_vsi_close() frees it without stopping the queues first, so the
device could DMA into freed memory. Pointing to ice_stop() as the
precedent was wrong, since it has the same hazard.

> [Severity: Medium]
> Can this now reach a NULL vsi->q_vectors?

Also right. ice_vsi_free_arrays() sets q_vectors to NULL but leaves
num_q_vectors as is, and ice_vsi_clear_napi_queues() does not check
q_vectors, so the already_down check was hiding this after a failed
ice_vsi_rebuild(). My statement that ice_vsi_close() already handles
a VSI that is down only holds for the IRQs and the rings.

> [Severity: Medium]
> Does removing the already_down check widen races with code that brings
> the VSI down without rtnl_lock?

Agreed that it widens the window, so the reasoning in the commit
message that ICE_VSI_DOWN is still tested under rtnl_lock is not
enough to show it is safe.

So please drop v2. The underlying problem is that a failed ice_up() /
ice_down_up() leaves the VSI half up, and ice_dis_vsi() cannot tell
whether the queues are still enabled, so it is not the right place to
clean this up. If I come back to it, it will be a fix on those error
paths, tested on hardware rather than build only.

Could you point me to your and Petr's patches for the DCB path? I would
like to check whether they also cover the case I originally hit with
the out-of-tree driver (ice_vsi_cfg_lan() failing on an E830 port
without a module installed).

Separately, the NULL q_vectors with a non-zero num_q_vectors after a
failed rebuild looks reachable through ice_stop() already, independent
of this patch. If you think it is worth it, I can send a small fix for
that once I have reproduced it.

Thanks,
Ionut