DPDK patches and discussions
 help / color / mirror / Atom feed
From: xuan.ding@intel.com
To: dev@dpdk.org, maxime.coquelin@redhat.com, chenbo.xia@intel.com
Cc: Xuan Ding <xuan.ding@intel.com>,
	stable@dpdk.org, Yong Liu <yong.liu@intel.com>,
	Miao Li <miao.li@intel.com>
Subject: [dpdk-dev] [PATCH] net/virtio: fix incorrect avail desc id
Date: Thu, 21 Oct 2021 14:25:40 +0000	[thread overview]
Message-ID: <20211021142540.43753-1-xuan.ding@intel.com> (raw)

From: Xuan Ding <xuan.ding@intel.com>

Vhost will update desc’s Buffer ID advance to next used descriptor when
VIRTIO_F_IN_ORDER feature negotiated. When virtio reuses the descriptor,
the Buffer ID should be restored even VIRTQ_DESC_F_INDIRECT
feature negotiated.

Fixes: b473061b0e1d ("net/virtio: fix indirect descriptors in packed datapaths")
Cc: stable@dpdk.org

Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Signed-off-by: Yong Liu <yong.liu@intel.com>
Signed-off-by: Miao Li <miao.li@intel.com>
---
 drivers/net/virtio/virtqueue.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h
index d0c48ca415..5259a6f814 100644
--- a/drivers/net/virtio/virtqueue.h
+++ b/drivers/net/virtio/virtqueue.h
@@ -709,6 +709,9 @@ virtqueue_enqueue_xmit_packed(struct virtnet_tx *txvq, struct rte_mbuf *cookie,
 			RTE_PTR_DIFF(&txr[idx].tx_packed_indir, txr);
 		start_dp[idx].len   = (seg_num + 1) *
 			sizeof(struct vring_packed_desc);
+		/* Packed descriptor id needs to be restored when inorder. */
+		if (in_order)
+			start_dp[idx].id = idx;
 		/* reset flags for indirect desc */
 		head_flags = VRING_DESC_F_INDIRECT;
 		head_flags |= vq->vq_packed.cached_flags;
-- 
2.17.1


             reply	other threads:[~2021-10-21  5:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-21 14:25 xuan.ding [this message]
2021-10-21 12:15 ` Maxime Coquelin
2021-10-21 12:35 ` Maxime Coquelin

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=20211021142540.43753-1-xuan.ding@intel.com \
    --to=xuan.ding@intel.com \
    --cc=chenbo.xia@intel.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=miao.li@intel.com \
    --cc=stable@dpdk.org \
    --cc=yong.liu@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).