path: root/drivers/net/virtio/virtio_rxtx_simple.c
diff options
authorOlivier Matz <>2018-02-12 16:46:10 +0100
committerThomas Monjalon <>2018-02-13 18:41:19 +0100
commit9fedc2da388cbe261e43c7b1cafb7463ccce3747 (patch)
treecf2aa7d8da64e73e097b13a34c2db68d695c7327 /drivers/net/virtio/virtio_rxtx_simple.c
parent344259ab7745b2c6e43a94339d49b0068bf1ef25 (diff)
net/virtio: fix mbuf data offset for simple Rx
The mbuf->data_off was was not properly set for the first received mbufs. Fix this by setting it in virtqueue_enqueue_recv_refill_simple(), which is used to enqueue the first mbuf in the ring. The function virtio_rxq_rearm_vec(), which is used to rearm the ring with new mbufs, is valid and does not need to be updated. Fixes: cab0461234e7 ("virtio: fill Rx avail ring with blank mbufs") Cc: Signed-off-by: Olivier Matz <> Reviewed-by: Maxime Coquelin <>
Diffstat (limited to 'drivers/net/virtio/virtio_rxtx_simple.c')
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/virtio/virtio_rxtx_simple.c b/drivers/net/virtio/virtio_rxtx_simple.c
index 7247a08..b1f610f 100644
--- a/drivers/net/virtio/virtio_rxtx_simple.c
+++ b/drivers/net/virtio/virtio_rxtx_simple.c
@@ -36,6 +36,7 @@ virtqueue_enqueue_recv_refill_simple(struct virtqueue *vq,
uint16_t desc_idx;
cookie->port = vq->rxq.port_id;
+ cookie->data_off = RTE_PKTMBUF_HEADROOM;
desc_idx = vq->vq_avail_idx & (vq->vq_nentries - 1);
dxp = &vq->vq_descx[desc_idx];