On Fri, 7 Aug 2026 09:32:20 +0800 Xiong Weimin wrote: > virtnet_xdp_set() can lower curr_queue_pairs when an XDP program is > detached. Unlike ethtool channel updates, that path does not check for > AF_XDP zero-copy pools on the queues being dropped. A pool can remain > bound on a qid that is no longer covered by curr_queue_pairs, which > breaks later unbind and can leave stale rq/sq->xsk_pool pointers. > > Refuse the shrink with -EBUSY while any AF_XDP pool is still bound on a > queue that would become inactive.
This is really odd. The extra XDP queues should not be visible to the stack and therefore to AF_XDP. AF_XDP and XDP only share the name for "marketing reasons", they are distinct things. We should try to prevent this oddity and prevent the XDP queues from being exposed to the stack. let's see if anyone complains. The patch as posted is only going to create problems further down the line, the stack assumes that XDP detach can never fail.

