Feng Liu
2023-Apr-28 22:43 UTC
[PATCH net v1 2/2] virtio_net: Close queue pairs using helper function
Use newly introduced helper function that exactly does the same of closing the queue pairs. Signed-off-by: Feng Liu <feliu at nvidia.com> Reviewed-by: William Tu <witu at nvidia.com> Reviewed-by: Parav Pandit <parav at nvidia.com> --- drivers/net/virtio_net.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index fc6ee833a09f..5cd78e154d14 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -2319,11 +2319,8 @@ static int virtnet_close(struct net_device *dev) /* Make sure refill_work doesn't re-enable napi! */ 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); - } + for (i = 0; i < vi->max_queue_pairs; i++) + virtnet_disable_qp(vi, i); return 0; } -- 2.37.1 (Apple Git-137.1)
Michael S. Tsirkin
2023-May-01 14:14 UTC
[PATCH net v1 2/2] virtio_net: Close queue pairs using helper function
On Fri, Apr 28, 2023 at 06:43:46PM -0400, Feng Liu wrote:> Use newly introduced helper function that exactly does the same of > closing the queue pairs. > > Signed-off-by: Feng Liu <feliu at nvidia.com> > Reviewed-by: William Tu <witu at nvidia.com> > Reviewed-by: Parav Pandit <parav at nvidia.com>Acked-by: Michael S. Tsirkin <mst at redhat.com>> --- > drivers/net/virtio_net.c | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c > index fc6ee833a09f..5cd78e154d14 100644 > --- a/drivers/net/virtio_net.c > +++ b/drivers/net/virtio_net.c > @@ -2319,11 +2319,8 @@ static int virtnet_close(struct net_device *dev) > /* Make sure refill_work doesn't re-enable napi! */ > 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); > - } > + for (i = 0; i < vi->max_queue_pairs; i++) > + virtnet_disable_qp(vi, i); > > return 0; > } > -- > 2.37.1 (Apple Git-137.1)