DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/virtio: fix indirect descriptors reconnection
@ 2021-08-19  5:35 Xuan Ding
  2021-09-23  8:15 ` Maxime Coquelin
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Xuan Ding @ 2021-08-19  5:35 UTC (permalink / raw)
  To: maxime.coquelin, chenbo.xia
  Cc: dev, jiayu.hu, yinan.wang, Xuan Ding, stable, yong.liu

Since packed indirect descriptors are added and initialized when
initializing vring, the reconnection path also needs to be considered.

Fixes: 381f39ebb78a ("net/virtio: fix packed ring indirect descricptors setup")
Cc: stable@dpdk.org
Cc: yong.liu@intel.com

Signed-off-by: Xuan Ding <xuan.ding@intel.com>
---
 drivers/net/virtio/virtqueue.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/net/virtio/virtqueue.c b/drivers/net/virtio/virtqueue.c
index 1f9af3c31b..47229f35c4 100644
--- a/drivers/net/virtio/virtqueue.c
+++ b/drivers/net/virtio/virtqueue.c
@@ -208,6 +208,20 @@ virtqueue_txvq_reset_packed(struct virtqueue *vq)
 			rte_pktmbuf_free(dxp->cookie);
 			dxp->cookie = NULL;
 		}
+
+		struct virtio_tx_region *txr;
+		txr = txvq->virtio_net_hdr_mz->addr;
+		/* first indirect descriptor is always the tx header */
+		struct vring_packed_desc *start_dp =
+			txr[desc_idx].tx_packed_indir;
+		vring_desc_init_indirect_packed(start_dp,
+		      RTE_DIM(txr[desc_idx].tx_packed_indir));
+		start_dp->addr = txvq->virtio_net_hdr_mem
+			+ desc_idx * sizeof(*txr)
+			+ offsetof(struct virtio_tx_region,
+				   tx_hdr);
+		start_dp->len = vq->hw->vtnet_hdr_size;
+
 	}
 
 	vring_desc_init_packed(vq, size);
-- 
2.17.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-10-21 12:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-19  5:35 [dpdk-dev] [PATCH] net/virtio: fix indirect descriptors reconnection Xuan Ding
2021-09-23  8:15 ` Maxime Coquelin
2021-09-23  8:35   ` Ding, Xuan
2021-09-23  9:21     ` Ding, Xuan
2021-10-12  8:48       ` Maxime Coquelin
2021-10-13  0:28 ` Wang, Yinan
2021-10-13  1:36 ` [dpdk-dev] [PATCH v2] " Xuan Ding
2021-10-14  7:59   ` Maxime Coquelin
2021-10-21 12:32   ` Maxime Coquelin

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