veth deletes the NAPI instances on link down, when NAPI is no longer needed for GRO or XDP, and when ethtool -L reduces the number of RX queues. When veth adds them again, each queue gets a new NAPI ID and loses its per-NAPI settings. An AF_XDP socket bound to the queue keeps the old NAPI ID, so its busy polling stops. Use netif_napi_add_config(), as Documentation/networking/napi.rst asks drivers to do whenever possible. The queue then keeps its NAPI ID and its settings. virtio_net made the same change in commit d5d715207e29 ("virtio_net: Use persistent NAPI config"). Signed-off-by: Tianyi Gao --- New in v3, as Sashiko suggested on v2 [1]. [1] https://lore.kernel.org/all/179470883411.2199510.13825316417997386083@kernel.org/ --- drivers/net/veth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/veth.c b/drivers/net/veth.c index 470c4f95e4a1..1c7ee3bf65f0 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c @@ -1057,7 +1057,7 @@ static int veth_napi_enable_range(struct net_device *dev, int start, int end) } for (i = start; i < end; i++) - netif_napi_add(dev, &priv->rq[i].xdp_napi, veth_poll); + netif_napi_add_config(dev, &priv->rq[i].xdp_napi, veth_poll, i); for (i = start; i < end; i++) { struct veth_rq *rq = &priv->rq[i]; -- 2.56.0