patch 'net/virtio: fix check of threshold for Tx freeing' has been queued to stable release 23.11.5

Xueming Li xuemingl at nvidia.com
Wed Jul 30 16:56:21 CEST 2025


Hi,

FYI, your patch has been queued to stable release 23.11.5

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/10/25. 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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=ebe1537ebc32a48f1ef31113cb13b8e0236360bd

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From ebe1537ebc32a48f1ef31113cb13b8e0236360bd Mon Sep 17 00:00:00 2001
From: Hengqi Chen <hengqi.chen at gmail.com>
Date: Mon, 9 Jun 2025 07:23:47 +0000
Subject: [PATCH] net/virtio: fix check of threshold for Tx freeing
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 3e3c7f3fa5ac3f2748a4463d87e73eb28024b401 ]

Like most drivers, make the fast path of virtio_xmit_cleanup() behave as
described by the comments of rte_eth_txconf::tx_free_thresh ([0]):
    Start freeing Tx buffers if there are
    less free descriptors than this value.

The rationale behind this change is that:
  * vq->vq_nentries is set during device probe
    with the queue size specified by vhost backend,
    this value does not reflect the real nb_tx_desc
  * the real available tx desc is set to vq->vq_free_cnt
    via the nb_tx_desc param of rte_eth_tx_queue_setup() API
  * so `nb_used > vq->vq_nentries - vq->vq_free_thresh` could never be true
    if say nb_tx_desc=2048, vq->vq_nentries=4096, vq->vq_free_thresh=32,
    see bug report 1716 ([1]) for details.

[0]: https://github.com/DPDK/dpdk/commit/72514b5d5543
[1]: https://bugs.dpdk.org/show_bug.cgi?id=1716

Bugzilla ID: 1716
Fixes: 72514b5d5543 ("ethdev: fix check of threshold for Tx freeing")
Cc: stable at dpdk.org

Signed-off-by: Baoyuan Li <updoing at sina.com>
Signed-off-by: Hengqi Chen <hengqi.chen at gmail.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
---
 .mailmap                         | 2 ++
 drivers/net/virtio/virtio_rxtx.c | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index 80c6f855dc..86920fea08 100644
--- a/.mailmap
+++ b/.mailmap
@@ -158,6 +158,7 @@ Balakrishna Bhamidipati <bbhamidipati at marvell.com>
 Balasubramanian Manoharan <balasubramanian.manoharan at caviumnetworks.com>
 Balazs Nemeth <bnemeth at redhat.com> <balazs.nemeth at intel.com>
 Bao-Long Tran <longtb5 at viettel.com.vn>
+Baoyuan Li <updoing at sina.com>
 Bar Neuman <bneuman at nvidia.com>
 Barak Enat <barak at saguna.net>
 Barry Cao <barry.cao at nxp.com>
@@ -519,6 +520,7 @@ Hemant Agrawal <hemant.agrawal at nxp.com> <hemant at freescale.com>
 Heng Ding <hengx.ding at intel.com>
 Hengjian Zhang <hengjianx.zhang at intel.com>
 Heng Jiang <jiangheng14 at huawei.com>
+Hengqi Chen <hengqi.chen at gmail.com>
 Heng Wang <heng.wang at ericsson.com>
 Henning Schild <henning.schild at siemens.com>
 Henry Cai <caihe at huawei.com>
diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index 99b95194cd..a13df4952d 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -1863,7 +1863,7 @@ virtio_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 
 	nb_used = virtqueue_nused(vq);
 
-	if (likely(nb_used > vq->vq_nentries - vq->vq_free_thresh))
+	if (likely(vq->vq_free_cnt < vq->vq_free_thresh))
 		virtio_xmit_cleanup(vq, nb_used);
 
 	for (nb_tx = 0; nb_tx < nb_pkts; nb_tx++) {
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-07-30 22:50:03.893233602 +0800
+++ 0012-net-virtio-fix-check-of-threshold-for-Tx-freeing.patch	2025-07-30 22:50:03.012754407 +0800
@@ -1 +1 @@
-From 3e3c7f3fa5ac3f2748a4463d87e73eb28024b401 Mon Sep 17 00:00:00 2001
+From ebe1537ebc32a48f1ef31113cb13b8e0236360bd Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 3e3c7f3fa5ac3f2748a4463d87e73eb28024b401 ]
@@ -37 +40 @@
-index 25a53d06ca..8e898e303e 100644
+index 80c6f855dc..86920fea08 100644
@@ -40 +43 @@
-@@ -167,6 +167,7 @@ Balakrishna Bhamidipati <bbhamidipati at marvell.com>
+@@ -158,6 +158,7 @@ Balakrishna Bhamidipati <bbhamidipati at marvell.com>
@@ -47,2 +50,2 @@
- Barbara Skobiej <barbara.skobiej at intel.com>
-@@ -552,6 +553,7 @@ Hemant Agrawal <hemant.agrawal at nxp.com> <hemant at freescale.com>
+ Barry Cao <barry.cao at nxp.com>
+@@ -519,6 +520,7 @@ Hemant Agrawal <hemant.agrawal at nxp.com> <hemant at freescale.com>
@@ -57 +60 @@
-index edecd2011f..ab97f03d7d 100644
+index 99b95194cd..a13df4952d 100644
@@ -60 +63 @@
-@@ -1873,7 +1873,7 @@ virtio_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
+@@ -1863,7 +1863,7 @@ virtio_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)


More information about the stable mailing list