DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
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
Subject: [dpdk-dev] [PATCH v2 1/3] net/virtio: fix mbuf data offset for simple Rx function
Date: Mon, 12 Feb 2018 16:46:10 +0100	[thread overview]
Message-ID: <20180212154612.5297-2-maxime.coquelin@redhat.com> (raw)
In-Reply-To: <20180212154612.5297-1-maxime.coquelin@redhat.com>

From: Olivier Matz <olivier.matz@6wind.com>

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.14.3

  reply	other threads:[~2018-02-12 15:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-12 15:46 [dpdk-dev] [PATCH v2 0/3] Vhost & Virtio fixes for v18.02 Maxime Coquelin
2018-02-12 15:46 ` Maxime Coquelin [this message]
2018-02-13  8:53   ` [dpdk-dev] [PATCH v2 1/3] net/virtio: fix mbuf data offset for simple Rx function Maxime Coquelin
2018-02-12 15:46 ` [dpdk-dev] [PATCH v2 2/3] virtio: fix resuming port with rx vector path Maxime Coquelin
2018-02-12 15:46 ` [dpdk-dev] [PATCH v2 3/3] vhost: don't take access_lock on VHOST_USER_RESET_OWNER Maxime Coquelin
2018-02-13 17:45 ` [dpdk-dev] [dpdk-stable] [PATCH v2 0/3] Vhost & Virtio fixes for v18.02 Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180212154612.5297-2-maxime.coquelin@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=jianfeng.tan@intel.com \
    --cc=lei.a.yao@intel.com \
    --cc=olivier.matz@6wind.com \
    --cc=qian.q.xu@intel.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    --cc=tiwei.bie@intel.com \
    --cc=victork@redhat.com \
    --cc=yliu@fridaylinux.org \
    --cc=zhihong.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).