From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id AA0191B295; Mon, 12 Feb 2018 14:17:09 +0100 (CET) Received: from glumotte.dev.6wind.com. (unknown [10.16.0.195]) by proxy.6wind.com (Postfix) with ESMTP id 3914D131219; Mon, 12 Feb 2018 14:14:24 +0100 (CET) From: Olivier Matz To: dev@dpdk.org Cc: Yuanhan Liu , Maxime Coquelin , Tiwei Bie , stable@dpdk.org Date: Mon, 12 Feb 2018 14:16:36 +0100 Message-Id: <20180212131636.25858-1-olivier.matz@6wind.com> X-Mailer: git-send-email 2.11.0 Subject: [dpdk-dev] [PATCH] net/virtio: fix mbuf data offset for simple Rx function X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 13:17:09 -0000 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 --- 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