]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
virtio-net: Maintain reverse cleanup order
authorParav Pandit <parav@nvidia.com>
Fri, 3 Feb 2023 13:37:38 +0000 (15:37 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 6 Feb 2023 08:55:06 +0000 (08:55 +0000)
To easily audit the code, better to keep the device stop()
sequence to be mirror of the device open() sequence.

Acked-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Parav Pandit <parav@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/virtio_net.c

index c6c62d0596bc42469c83a80e0a07012d1aed4484..5256fdd555471ed99dd38bfecc3c957b2e556ecd 100644 (file)
@@ -2282,9 +2282,9 @@ static int virtnet_close(struct net_device *dev)
        cancel_delayed_work_sync(&vi->refill);
 
        for (i = 0; i < vi->max_queue_pairs; i++) {
+               virtnet_napi_tx_disable(&vi->sq[i].napi);
                napi_disable(&vi->rq[i].napi);
                xdp_rxq_info_unreg(&vi->rq[i].xdp_rxq);
-               virtnet_napi_tx_disable(&vi->sq[i].napi);
        }
 
        return 0;