Re: [PATCH net v4 1/4] igb: don't touch rings that don't exist when disabling an XSK pool
From: Janis Edvarts Lacis
Date: Fri Nov 20 2026 - 18:17:52 EST
On 20 Nov 22:01, Antonio Quartulli wrote:
xsk_get_pool_from_qid() checks the queue id against the stack's real
queue counts, which can be higher than the number of rings the device
has: on 82576, enabling VFs leaves a single Tx queue while keeping two
Rx queues, and igb can fall back from MSI-X to MSI with a single queue
on resume. Disabling the pool of such a queue, e.g. one bound to queue 1
before enabling VFs, then passes a NULL Tx ring to
igb_txrx_ring_disable().
Only disable and re-enable the rings the device has: skip the queue if
it has no Rx ring, and only the Tx part if it has no Tx ring, so that
an Rx ring using the pool still stops using it.
What happens if a pool is bound to, say, queue 1 and the socket stays open across a runtime resume that falls back from MSI-X to MSI (queue 1 becomes invalid)?
If the socket is closed after igb_rtnl_resume_task() has reduced both
real queue counts to one, xsk_get_pool_from_qid() will return NULL for
queue 1. As I read it, igb_xsk_pool_disable() then returns -EINVAL
before doing the cleanup and resources get leaked.
I may be mistaken here, if so, please let me know :)
Best regards,
Janis