Re: [dpdk-dev] [PATCH v2 1/3] net/virtio: fix mbuf data offset for simple Rx function

2018-02-13 Thread Maxime Coquelin



On 02/12/2018 04:46 PM, Maxime Coquelin wrote:

From: Olivier Matz 

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: sta...@dpdk.org

Signed-off-by: Olivier Matz 
---
  drivers/net/virtio/virtio_rxtx_simple.c | 1 +
  1 file changed, 1 insertion(+)



I forgot to apply my r-b when re-posting:
Reviewed-by: Maxime Coquelin 

Maxime


[dpdk-dev] [PATCH v2 1/3] net/virtio: fix mbuf data offset for simple Rx function

2018-02-12 Thread Maxime Coquelin
From: Olivier Matz 

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: sta...@dpdk.org

Signed-off-by: Olivier Matz 
---
 drivers/net/virtio/virtio_rxtx_simple.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/virtio/virtio_rxtx_simple.c 
b/drivers/net/virtio/virtio_rxtx_simple.c
index 7247a0822..b1f610ffa 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];
-- 
2.14.3