This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
Full review at: https://sashiko.dev
---
virtio_net: disable cb when NAPI is busy-polled

This commit disables the virtqueue callback at the entry of virtnet_poll().
It aims to prevent a large number of spurious interrupts when busy-poll is
active by keeping the callback off while polling.

> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 26afa6341d161..c1e252400c0fc 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -3011,6 +3011,8 @@ static int virtnet_poll(struct napi_struct *napi, int 
> budget)
>       unsigned int xdp_xmit = 0;
>       bool napi_complete;
>  
> +     virtqueue_disable_cb(rq->vq);
> +

[Severity: High]
Can this unconditionally disable the RX callback and cause a permanent network
stall when polled by netpoll?

If the netpoll subsystem (e.g., used by netconsole) calls the NAPI poll
function directly with a budget of 0, virtqueue_disable_cb() is called
immediately. virtnet_receive() will then process 0 packets and return 0.

Later in virtnet_poll(), the completion condition is checked:

        if (received < budget) {
                napi_complete = virtqueue_napi_complete(napi, rq->vq, received);
        ...
        }

When both received and budget are 0, this condition evaluates to false. This
skips virtqueue_napi_complete(), leaving the RX callback permanently disabled
and preventing the device from raising further RX interrupts.

>       virtnet_poll_cleantx(rq, budget);
>  
>       received = virtnet_receive(rq, budget, &xdp_xmit);

Reply via email to