From: Xuan Ding <xuan.d...@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: sta...@dpdk.org

Signed-off-by: Xuan Ding <xuan.d...@intel.com>
Signed-off-by: Yong Liu <yong....@intel.com>
Signed-off-by: Miao Li <miao...@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 via email to