Re: [PATCH net-next v4 14/14] ibmveth: Fix MQ RX poll and shutdown hangs after queue resize

mingming cao <[email protected]>
Newsgroups org.ozlabs.lists.linuxppc-dev,org.kernel.vger.netdev
Message-ID <[email protected]>
On 8/6/26 11:49 AM, Jakub Kicinski wrote:
> On Thu, 30 Jul 2026 17:47:17 -0700 Mingming Cao wrote:
>> After aggressive ethtool -L cycling, PHYP can leave a VALID RX descriptor
>> with a correlator that no longer matches the per-queue buffer pools. Poll
>> treated this as fatal: ibmveth_rxq_get_buffer() WARNed and returned NULL
>> without advancing the ring, then restart_poll retried the same slot
>> forever.
>>
>> Advance past bad correlators instead of spinning: validate correlators
>> without WARN_ON, skip invalid slots in poll (count as invalid_buffers),
>> and advance the RX ring when remove_buffer_from_pool cannot map the
>> correlator. Rate-limit the bad correlator message.
>>
>> Complete NAPI when the interface is down or napi_disable is pending so
>> close/quiesce can finish. Do not restart_poll in that window. Close
>> keeps hypervisor IRQ disable before napi_disable (via
>> cleanup_rx_interrupts() / related cleanup helpers).
>>
>> Also validate descriptor length against skb tailroom before skb_put(),
>> and after napi_complete_done() on the budget-exhausted shutdown path
>> return a value less than budget so NAPI does not immediately reschedule.
> This patch looks very odd, like there's a bug somewhere and instead of
> fixing it we're making the rx path more resilient. BTW minor coding
> note - you're adding a bunch of heavily indented code to an already
> long function. Please consider factoring things out. Similar comment
> can be applied to other patches.
Agreed. The main fix here should be in the earlier resize/teardown path,
not in a trailing resilience patch.

I’ll fold that back into the owning resize work: drain before
deregister/unmap/free, publish the surviving queue range before freeing
queue resources, and use the same teardown path on the scale-up
enable_irq failure path. The poll-side skip logic should stay only as
belt-and-braces after the teardown fix, not as the primary answer.

I’ll also move the new poll branches into small helpers so
ibmveth_poll() stays a thin loop, but keep those helpers with the
patches that introduce the logic rather than as a standalone trailer
refactor.

I think the same cleanup principle applies to a few of the other
patches as well, so I’ll fold helper extraction into the owning changes
there too.

Thanks,
Mingming
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.