[dpdk-stable] patch 'net/virtio: fix indirect descriptor reconnection' has been queued to stable release 20.11.4

Xueming Li xuemingl at nvidia.com
Wed Nov 10 07:31:05 CET 2021


Hi,

FYI, your patch has been queued to stable release 20.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/12/21. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/d74c2896ad6d7fea73e3251bbabccd47c941ff42

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From d74c2896ad6d7fea73e3251bbabccd47c941ff42 Mon Sep 17 00:00:00 2001
From: Xuan Ding <xuan.ding at intel.com>
Date: Wed, 13 Oct 2021 01:36:40 +0000
Subject: [PATCH] net/virtio: fix indirect descriptor reconnection
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 04bcc80204db16ca77d1dd11a6ea1773214cc755 ]

Add initialization for packed ring indirect descriptors
in reconnection path.

Fixes: 381f39ebb78a ("net/virtio: fix packed ring indirect descricptors
setup")

Signed-off-by: Xuan Ding <xuan.ding at intel.com>
Tested-by: Yinan Wang <yinan.wang at intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.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 2702e120ee..67eeb3701d 100644
--- a/drivers/net/virtio/virtqueue.c
+++ b/drivers/net/virtio/virtqueue.c
@@ -186,6 +186,8 @@ virtqueue_txvq_reset_packed(struct virtqueue *vq)
 	struct vq_desc_extra *dxp;
 	struct virtnet_tx *txvq;
 	uint16_t desc_idx;
+	struct virtio_tx_region *txr;
+	struct vring_packed_desc *start_dp;
 
 	vq->vq_used_cons_idx = 0;
 	vq->vq_desc_head_idx = 0;
@@ -198,6 +200,7 @@ virtqueue_txvq_reset_packed(struct virtqueue *vq)
 	vq->vq_packed.event_flags_shadow = 0;
 
 	txvq = &vq->txq;
+	txr = txvq->virtio_net_hdr_mz->addr;
 	memset(txvq->mz->addr, 0, txvq->mz->len);
 	memset(txvq->virtio_net_hdr_mz->addr, 0,
 		txvq->virtio_net_hdr_mz->len);
@@ -208,6 +211,17 @@ virtqueue_txvq_reset_packed(struct virtqueue *vq)
 			rte_pktmbuf_free(dxp->cookie);
 			dxp->cookie = NULL;
 		}
+
+		if (vtpci_with_feature(vq->hw, VIRTIO_RING_F_INDIRECT_DESC)) {
+			/* first indirect descriptor is always the tx header */
+			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.33.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-10 14:17:09.965434773 +0800
+++ 0181-net-virtio-fix-indirect-descriptor-reconnection.patch	2021-11-10 14:17:01.990745109 +0800
@@ -1 +1 @@
-From 04bcc80204db16ca77d1dd11a6ea1773214cc755 Mon Sep 17 00:00:00 2001
+From d74c2896ad6d7fea73e3251bbabccd47c941ff42 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 04bcc80204db16ca77d1dd11a6ea1773214cc755 ]
@@ -9,2 +12,2 @@
-Fixes: 381f39ebb78a ("net/virtio: fix packed ring indirect descricptors setup")
-Cc: stable at dpdk.org
+Fixes: 381f39ebb78a ("net/virtio: fix packed ring indirect descricptors
+setup")
@@ -20 +23 @@
-index 1f9af3c31b..65bf792eb0 100644
+index 2702e120ee..67eeb3701d 100644
@@ -45 +48 @@
-+		if (virtio_with_feature(vq->hw, VIRTIO_RING_F_INDIRECT_DESC)) {
++		if (vtpci_with_feature(vq->hw, VIRTIO_RING_F_INDIRECT_DESC)) {


More information about the stable mailing list