Skip to contentSkip to conversation

virtio_net: Close queue pairs using helper function

PATCH Superseded Feng Liu 3 participants 7 messages Apr 28, 2023 – May 2, 2023

Subsystems (5)

v1 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Feng Liu

author
#0 lore raw

PATCH 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.

---
 drivers/net/virtio_net.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/net/virtio_net.c +2 -5
index fc6ee833a09f..5cd78e154d14 100644
@@ -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;
 }
Signature · 1 line
2.37.1 (Apple Git-137.1)
Reviewed-by on v1 2/2
#1 lore raw
Quoted 6 lines · Feng Liu

Use newly introduced helper function that exactly does the same of closing the queue pairs.

I guess this was put in a separate patch to 1/2, as it's more net-next material, as opposed to 1/2 which seems to be net material. FWIIW, I'd lean to putting 1/2 in net. And holding this one for net-next.

That aside, this looks good to me.

author
#2 lore raw
Quoted 11 lines · Simon Horman

External email: Use caution opening links or attachments

Quoted 6 lines · Feng Liu

Use newly introduced helper function that exactly does the same of closing the queue pairs.

Quoted 7 lines

I guess this was put in a separate patch to 1/2, as it's more net-next material, as opposed to 1/2 which seems to be net material. FWIIW, I'd lean to putting 1/2 in net. And holding this one for net-next.

That aside, this looks good to me.

Will do, thanks Simon
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

#3 lore raw
Quoted 18 lines · Feng Liu
Quoted 15 lines · Simon Horman

External email: Use caution opening links or attachments

Quoted 6 lines · Feng Liu

Use newly introduced helper function that exactly does the same of closing the queue pairs.

I guess this was put in a separate patch to 1/2, as it's more net-next material, as opposed to 1/2 which seems to be net material. FWIIW, I'd lean to putting 1/2 in net. And holding this one for net-next.

Quoted 5 lines
Quoted 3 lines

That aside, this looks good to me.

Will do, thanks Simon

Nah, I think you should just squash these two patches together. It's early in the merge window.

Signature · 6 lines
MST

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
author
#4 lore raw
Quoted 26 lines · Michael S. Tsirkin

External email: Use caution opening links or attachments

Quoted 22 lines · Feng Liu
Quoted 18 lines · Simon Horman

External email: Use caution opening links or attachments

Quoted 6 lines · Feng Liu

Use newly introduced helper function that exactly does the same of closing the queue pairs.

I guess this was put in a separate patch to 1/2, as it's more net-next material, as opposed to 1/2 which seems to be net material. FWIIW, I'd lean to putting 1/2 in net. And holding this one for net-next.

That aside, this looks good to me.

Quoted 8 lines
Quoted 1 line

Will do, thanks Simon

Nah, I think you should just squash these two patches together. It's early in the merge window.

--
MST

OK, will do , thx
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

#5 lore raw
In reply to Michael S. Tsirkin
Quoted 19 lines · Michael S. Tsirkin
Quoted 18 lines · Feng Liu
Quoted 15 lines · Simon Horman

External email: Use caution opening links or attachments

Quoted 6 lines · Feng Liu

Use newly introduced helper function that exactly does the same of closing the queue pairs.

I guess this was put in a separate patch to 1/2, as it's more net-next material, as opposed to 1/2 which seems to be net material. FWIIW, I'd lean to putting 1/2 in net. And holding this one for net-next.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

That aside, this looks good to me.

Will do, thanks Simon

Nah, I think you should just squash these two patches together. It's early in the merge window.

Ack, sorry for the noise.

maintainer Acked-by on v1 2/2
#6 lore raw
In reply to Feng Liu
Quoted 6 lines · Feng Liu

Use newly introduced helper function that exactly does the same of closing the queue pairs.

Quoted 24 lines
---
 drivers/net/virtio_net.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/net/virtio_net.c +2 -5
index fc6ee833a09f..5cd78e154d14 100644
@@ -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;
 }
Signature · 1 line
2.37.1 (Apple Git-137.1)

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization