From: Jakub Kicinski Date: Fri, 10 Apr 2026 01:24:34 +0000 (-0700) Subject: Merge branch 'netkit-support-for-io_uring-zero-copy-and-af_xdp' X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=15089225889ba4b29f0263757cd66932fa676cb0;p=thirdparty%2Fkernel%2Flinux.git Merge branch 'netkit-support-for-io_uring-zero-copy-and-af_xdp' Daniel Borkmann says: ==================== netkit: Support for io_uring zero-copy and AF_XDP Containers use virtual netdevs to route traffic from a physical netdev in the host namespace. They do not have access to the physical netdev in the host and thus can't use memory providers or AF_XDP that require reconfiguring/restarting queues in the physical netdev. This patchset adds the concept of queue leasing to virtual netdevs that allow containers to use memory providers and AF_XDP at native speed. Leased queues are bound to a real queue in a physical netdev and act as a proxy. Memory providers and AF_XDP operations take an ifindex and queue id, so containers would pass in an ifindex for a virtual netdev and a queue id of a leased queue, which then gets proxied to the underlying real queue. We have implemented support for this concept in netkit and tested the latter against Nvidia ConnectX-6 (mlx5) as well as Broadcom BCM957504 (bnxt_en) 100G NICs. For more details see the individual patches. ==================== Link: https://patch.msgid.link/20260402231031.447597-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski --- 15089225889ba4b29f0263757cd66932fa676cb0 diff --cc net/core/netdev_rx_queue.c index 05fd2875d7259,1d6e7e47bf0a7..469319451ba29 --- a/net/core/netdev_rx_queue.c +++ b/net/core/netdev_rx_queue.c @@@ -117,15 -211,6 +211,9 @@@ static int __netif_mp_open_rxq(struct n struct netdev_rx_queue *rxq; int ret; + if (!qops) + return -EOPNOTSUPP; + - if (rxq_idx >= dev->real_num_rx_queues) { - NL_SET_ERR_MSG(extack, "rx queue index out of range"); - return -ERANGE; - } - rxq_idx = array_index_nospec(rxq_idx, dev->real_num_rx_queues); - if (dev->cfg->hds_config != ETHTOOL_TCP_DATA_SPLIT_ENABLED) { NL_SET_ERR_MSG(extack, "tcp-data-split is disabled"); return -EINVAL; diff --cc net/xdp/xsk.c index c8ef9e427c9cd,fe1c7899455e7..60be6561f4865 --- a/net/xdp/xsk.c +++ b/net/xdp/xsk.c @@@ -334,11 -382,9 +382,10 @@@ static int xsk_rcv_check(struct xdp_soc { if (!xsk_is_bound(xs)) return -ENXIO; - - if (xs->dev != xdp->rxq->dev || xs->queue_id != xdp->rxq->queue_index) + if (!xsk_dev_queue_valid(xs, xdp->rxq)) return -EINVAL; - if (len > xsk_pool_get_rx_frame_size(xs->pool) && !xs->sg) { + + if (len > __xsk_pool_get_rx_frame_size(xs->pool) && !xs->sg) { xs->rx_dropped++; return -ENOSPC; }