Skip to content

Commit a377ae5

Browse files
fengidrikuba-moo
authored andcommitted
virtio_net: big mode skip the unmap check
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. Signed-off-by: Xuan Zhuo <[email protected]> Acked-by: Jason Wang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent f9dac92 commit a377ae5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/virtio_net.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@ static void virtnet_rq_unmap_free_buf(struct virtqueue *vq, void *buf)
963963

964964
rq = &vi->rq[i];
965965

966-
if (rq->do_dma)
966+
if (!vi->big_packets || vi->mergeable_rx_bufs)
967967
virtnet_rq_unmap(rq, buf, 0);
968968

969969
virtnet_rq_free_buf(vi, rq, buf);
@@ -2277,7 +2277,7 @@ static int virtnet_receive(struct receive_queue *rq, int budget,
22772277
}
22782278
} else {
22792279
while (packets < budget &&
2280-
(buf = virtnet_rq_get_buf(rq, &len, NULL)) != NULL) {
2280+
(buf = virtqueue_get_buf(rq->vq, &len)) != NULL) {
22812281
receive_buf(vi, rq, buf, len, NULL, xdp_xmit, &stats);
22822282
packets++;
22832283
}

0 commit comments

Comments
 (0)