Thread (24 messages) 24 messages, 4 authors, 2025-01-27

Re: [RFC net-next v3 2/4] virtio_net: Prepare for NAPI to queue mapping

From: Jason Wang <jasowang@redhat.com>
Date: 2025-01-22 06:13:05
Also in: lkml, virtualization

On Wed, Jan 22, 2025 at 3:11 AM Joe Damato [off-list ref] wrote:
quoted hunk ↗ jump to hunk
Slight refactor to prepare the code for NAPI to queue mapping. No
functional changes.

Signed-off-by: Joe Damato <redacted>
Reviewed-by: Gerhard Engleder <redacted>
Tested-by: Lei Yang <redacted>
---
 v2:
   - Previously patch 1 in the v1.
   - Added Reviewed-by and Tested-by tags to commit message. No
     functional changes.

 drivers/net/virtio_net.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 7646ddd9bef7..cff18c66b54a 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -2789,7 +2789,8 @@ static void skb_recv_done(struct virtqueue *rvq)
        virtqueue_napi_schedule(&rq->napi, rvq);
 }

-static void virtnet_napi_enable(struct virtqueue *vq, struct napi_struct *napi)
+static void virtnet_napi_do_enable(struct virtqueue *vq,
+                                  struct napi_struct *napi)
 {
        napi_enable(napi);
Nit: it might be better to not have this helper to avoid a misuse of
this function directly.

Other than this.

Acked-by: Jason Wang <jasowang@redhat.com>

Thanks
quoted hunk ↗ jump to hunk
@@ -2802,6 +2803,11 @@ static void virtnet_napi_enable(struct virtqueue *vq, struct napi_struct *napi)
        local_bh_enable();
 }

+static void virtnet_napi_enable(struct virtqueue *vq, struct napi_struct *napi)
+{
+       virtnet_napi_do_enable(vq, napi);
+}
+
 static void virtnet_napi_tx_enable(struct virtnet_info *vi,
                                   struct virtqueue *vq,
                                   struct napi_struct *napi)
@@ -2817,7 +2823,7 @@ static void virtnet_napi_tx_enable(struct virtnet_info *vi,
                return;
        }

-       return virtnet_napi_enable(vq, napi);
+       virtnet_napi_do_enable(vq, napi);
 }

 static void virtnet_napi_tx_disable(struct napi_struct *napi)
--
2.25.1
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help