Skip to content

Commit b95ed55

Browse files
samikhawajadavem330
authored andcommitted
xsk: Bring back busy polling support in XDP_COPY
Commit 5ef44b3 ("xsk: Bring back busy polling support") fixed the busy polling support in xsk for XDP_ZEROCOPY after it was broken in commit 86e25f4 ("net: napi: Add napi_config"). The busy polling support with XDP_COPY remained broken since the napi_id setup in xsk_rcv_check was removed. Bring back the setup of napi_id for XDP_COPY so socket level SO_BUSYPOLL can be used to poll the underlying napi. Do the setup of napi_id for XDP_COPY in xsk_bind, as it is done currently for XDP_ZEROCOPY. The setup of napi_id for XDP_COPY in xsk_bind is safe because xsk_rcv_check checks that the rx queue at which the packet arrives is equal to the queue_id that was supplied in bind. This is done for both XDP_COPY and XDP_ZEROCOPY mode. Tested using AF_XDP support in virtio-net by running the xsk_rr AF_XDP benchmarking tool shared here: https://lore.kernel.org/all/[email protected]/T/ Enabled socket busy polling using following commands in qemu, ``` sudo ethtool -L eth0 combined 1 echo 400 | sudo tee /proc/sys/net/core/busy_read echo 100 | sudo tee /sys/class/net/eth0/napi_defer_hard_irqs echo 15000 | sudo tee /sys/class/net/eth0/gro_flush_timeout ``` Fixes: 5ef44b3 ("xsk: Bring back busy polling support") Signed-off-by: Samiullah Khawaja <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Acked-by: Stanislav Fomichev <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 293e38f commit b95ed55

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/xdp/xsk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1304,7 +1304,7 @@ static int xsk_bind(struct socket *sock, struct sockaddr *addr, int addr_len)
13041304
xs->queue_id = qid;
13051305
xp_add_xsk(xs->pool, xs);
13061306

1307-
if (xs->zc && qid < dev->real_num_rx_queues) {
1307+
if (qid < dev->real_num_rx_queues) {
13081308
struct netdev_rx_queue *rxq;
13091309

13101310
rxq = __netif_get_rx_queue(dev, qid);

0 commit comments

Comments
 (0)