Thread (3 messages) flat view 3 messages, 2 authors, 2026-08-13

Re: [PATCH net v2 2/2] virtio_net: refuse XDP queue shrink while AF_XDP is bound

From: Jakub Kicinski <kuba@kernel.org>
Date: 2026-08-13 01:49:05
Also in: lkml, virtualization

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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help