patch 'net/virtio: fix check of threshold for Tx freeing' has been queued to stable release 22.11.9
Maxime Coquelin
maxime.coquelin at redhat.com
Fri Jul 4 14:01:07 CEST 2025
Hi Luca,
This patch introduces a performance regression, could you make sure it
is not applied to the v22.11 LTS ?
Thanks,
Maxime
On 6/30/25 2:25 PM, luca.boccassi at gmail.com wrote:
> Hi,
>
> FYI, your patch has been queued to stable release 22.11.9
>
> Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
> It will be pushed if I get no objections before 07/02/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://github.com/bluca/dpdk-stable
>
> This queued commit can be viewed at:
> https://github.com/bluca/dpdk-stable/commit/4863a82ac7db22f67294808bc5077b848e057a40
>
> Thanks.
>
> Luca Boccassi
>
> ---
> From 4863a82ac7db22f67294808bc5077b848e057a40 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
>
> [ 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")
>
> 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 | 3 +++
> drivers/net/virtio/virtio_rxtx.c | 2 +-
> 2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/.mailmap b/.mailmap
> index f53fdf0d85..bda591c1cf 100644
> --- a/.mailmap
> +++ b/.mailmap
> @@ -150,6 +150,8 @@ 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>
> Bartosz Staszewski <bartoszx.staszewski at intel.com>
> @@ -504,6 +506,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 c3e686cf0c..66aaeb3c65 100644
> --- a/drivers/net/virtio/virtio_rxtx.c
> +++ b/drivers/net/virtio/virtio_rxtx.c
> @@ -1870,7 +1870,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++) {
More information about the stable
mailing list