DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/virtio: fix mbuf data offset for simple Rx function
@ 2018-02-12 13:16 Olivier Matz
  2018-02-12 15:11 ` Maxime Coquelin
  0 siblings, 1 reply; 2+ messages in thread
From: Olivier Matz @ 2018-02-12 13:16 UTC (permalink / raw)
  To: dev; +Cc: Yuanhan Liu, Maxime Coquelin, Tiwei Bie, stable

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

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
 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.11.0

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] net/virtio: fix mbuf data offset for simple Rx function
  2018-02-12 13:16 [dpdk-dev] [PATCH] net/virtio: fix mbuf data offset for simple Rx function Olivier Matz
@ 2018-02-12 15:11 ` Maxime Coquelin
  0 siblings, 0 replies; 2+ messages in thread
From: Maxime Coquelin @ 2018-02-12 15:11 UTC (permalink / raw)
  To: Olivier Matz, dev; +Cc: Yuanhan Liu, Tiwei Bie, stable

Hi Olivier,

On 02/12/2018 02:16 PM, Olivier Matz wrote:
> 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: stable@dpdk.org
> 
> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
> ---
>   drivers/net/virtio/virtio_rxtx_simple.c | 1 +
>   1 file changed, 1 insertion(+)
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks!
Maxime

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-02-12 15:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-12 13:16 [dpdk-dev] [PATCH] net/virtio: fix mbuf data offset for simple Rx function Olivier Matz
2018-02-12 15:11 ` Maxime Coquelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).