DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Jiang, YuX" <yux.jiang@intel.com>
To: Hengqi Chen <hengqi.chen@gmail.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, Baoyuan Li <updoing@sina.com>,
	"Maxime Coquelin" <maxime.coquelin@redhat.com>,
	Chenbo Xia <chenbox@nvidia.com>
Subject: RE: [PATCH] net/virtio: Fix check of threshold for Tx freeing
Date: Fri, 18 Jul 2025 01:56:57 +0000	[thread overview]
Message-ID: <IA0PR11MB83365863FAC1A5B8418E9536FE50A@IA0PR11MB8336.namprd11.prod.outlook.com> (raw)
In-Reply-To: <CAEyhmHSoNF=vJE7jqBhOH+eV2ehqUo63g174tnvp-wf+BMPsaA@mail.gmail.com>

Hi,

cd /opt/trex/v3.00/;./t-rex-64 -i --cfg /etc/trex_cfg.yaml -c 16
cp stl/bench.py stl/jy-bench.py
cd /opt/trex/v3.00/;./trex-console
start -f stl/jy-bench.py --port 0 -m 100% -t vm=random

stl/jy-bench.py modify base_pkt.
    def create_stream (self, stl_flow, size, vm, src, dst, pps = 1, isg = 0):
        # Create base packet and pad it to size
        #base_pkt = Ether()/IP(src=src, dst=dst)/UDP(dport=12,sport=1025,chksum=0)
        base_pkt = Ether(dst="40:a6:b7:96:e4:00")/IP(src="192.168.4.1")/("X"*1480)  

Best regards,
Yu Jiang

> -----Original Message-----
> From: Hengqi Chen <hengqi.chen@gmail.com>
> Sent: Thursday, July 17, 2025 11:04 PM
> To: Jiang, YuX <yux.jiang@intel.com>
> Cc: dev@dpdk.org; Baoyuan Li <updoing@sina.com>; Maxime Coquelin
> <maxime.coquelin@redhat.com>; Chenbo Xia <chenbox@nvidia.com>
> Subject: Re: [PATCH] net/virtio: Fix check of threshold for Tx freeing
> 
> Hi Yu,
> 
> On Fri, Jul 4, 2025 at 7:29 PM Jiang, YuX <yux.jiang@intel.com> wrote:
> >
> > Hi Hengqi,
> >
> > Can you help to check the ticket:
> https://bugs.dpdk.org/show_bug.cgi?id=1747? The perf drop is caused by
> your patch. Thanks so much.
> >
> 
> Could you please elaborate how to use trex in your reproduce steps ? Thanks.
> 
> Cheers,
> ---
> Hengqi
> 
> > Best regards,
> > Yu Jiang
> >
> > > -----Original Message-----
> > > From: Hengqi Chen <hengqi.chen@gmail.com>
> > > Sent: Monday, June 9, 2025 3:24 PM
> > > To: dev@dpdk.org
> > > Cc: Hengqi Chen <hengqi.chen@gmail.com>; Baoyuan Li
> > > <updoing@sina.com>; Maxime Coquelin <maxime.coquelin@redhat.com>;
> > > Chenbo Xia <chenbox@nvidia.com>
> > > Subject: [PATCH] net/virtio: Fix check of threshold for Tx freeing
> > >
> > > Like most dirvers, 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.
> > >
> > > Bugzilla ID: 1716
> > >
> > >   [0]: https://github.com/DPDK/dpdk/commit/72514b5d5543
> > >   [1]: https://bugs.dpdk.org/show_bug.cgi?id=1716
> > >
> > > Signed-off-by: Baoyuan Li <updoing@sina.com>
> > > Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
> > > ---
> > >  drivers/net/virtio/virtio_rxtx.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/net/virtio/virtio_rxtx.c
> > > b/drivers/net/virtio/virtio_rxtx.c
> > > index edecd2011f..ab97f03d7d 100644
> > > --- a/drivers/net/virtio/virtio_rxtx.c
> > > +++ b/drivers/net/virtio/virtio_rxtx.c
> > > @@ -1873,7 +1873,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.43.5
> >

      reply	other threads:[~2025-07-18  1:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-09  7:23 Hengqi Chen
2025-06-12 13:24 ` Maxime Coquelin
2025-06-13  8:08 ` Maxime Coquelin
2025-07-04 11:29 ` Jiang, YuX
2025-07-04 11:57   ` Maxime Coquelin
2025-07-07  4:14     ` Hengqi Chen
2025-07-07  4:07   ` Hengqi Chen
2025-07-07  6:47   ` Hengqi Chen
2025-07-17 15:04   ` Hengqi Chen
2025-07-18  1:56     ` Jiang, YuX [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=IA0PR11MB83365863FAC1A5B8418E9536FE50A@IA0PR11MB8336.namprd11.prod.outlook.com \
    --to=yux.jiang@intel.com \
    --cc=chenbox@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=hengqi.chen@gmail.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=updoing@sina.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).