virtio_net: big mode skip the unmap check
authorXuan Zhuo <xuanzhuo@linux.alibaba.com>
Tue, 29 Oct 2024 08:46:13 +0000 (16:46 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 5 Nov 2024 10:37:40 +0000 (11:37 +0100)
The virtio-net big mode did not enable premapped mode,
so we did not need to check the unmap. And the subsequent
commit will remove the failover code for failing enable
premapped for merge and small mode. So we need to remove
the checking do_dma code in the big mode path.

Tested-by: Darren Kenny <darren.kenny@oracle.com>
Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/virtio_net.c

index 3ff063fff443baf320ba8b398ae5fe139d9467ac..b82f6b8a8231d97df910c32fee8ba6bf2ec294a7 100644 (file)
@@ -987,7 +987,7 @@ static void virtnet_rq_unmap_free_buf(struct virtqueue *vq, void *buf)
                return;
        }
 
-       if (rq->do_dma)
+       if (!vi->big_packets || vi->mergeable_rx_bufs)
                virtnet_rq_unmap(rq, buf, 0);
 
        virtnet_rq_free_buf(vi, rq, buf);
@@ -2712,7 +2712,7 @@ static int virtnet_receive_packets(struct virtnet_info *vi,
                }
        } else {
                while (packets < budget &&
-                      (buf = virtnet_rq_get_buf(rq, &len, NULL)) != NULL) {
+                      (buf = virtqueue_get_buf(rq->vq, &len)) != NULL) {
                        receive_buf(vi, rq, buf, len, NULL, xdp_xmit, stats);
                        packets++;
                }