From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by dpdk.org (Postfix) with ESMTP id 5E9941B385; Mon, 12 Feb 2018 16:46:40 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EC40C404084E; Mon, 12 Feb 2018 15:46:39 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-42.ams2.redhat.com [10.36.112.42]) by smtp.corp.redhat.com (Postfix) with ESMTP id 83B492026DFD; Mon, 12 Feb 2018 15:46:37 +0000 (UTC) From: Maxime Coquelin To: tiwei.bie@intel.com, yliu@fridaylinux.org, ferruh.yigit@intel.com, victork@redhat.com, thomas@monjalon.net, olivier.matz@6wind.com, jianfeng.tan@intel.com Cc: dev@dpdk.org, stable@dpdk.org, zhihong.wang@intel.com, qian.q.xu@intel.com, lei.a.yao@intel.com Date: Mon, 12 Feb 2018 16:46:10 +0100 Message-Id: <20180212154612.5297-2-maxime.coquelin@redhat.com> In-Reply-To: <20180212154612.5297-1-maxime.coquelin@redhat.com> References: <20180212154612.5297-1-maxime.coquelin@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 12 Feb 2018 15:46:40 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 12 Feb 2018 15:46:40 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'maxime.coquelin@redhat.com' RCPT:'' Subject: [dpdk-dev] [PATCH v2 1/3] 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 15:46:40 -0000 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: 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.14.3