From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Ma, WenwuX" <wenwux.ma@intel.com>, <maxime.coquelin@redhat.com>,
"Xia, Chenbo" <chenbo.xia@intel.com>, <dev@dpdk.org>,
"Richardson, Bruce" <bruce.richardson@intel.com>
Cc: "Pai G, Sunil" <sunil.pai.g@intel.com>,
"Hu, Jiayu" <jiayu.hu@intel.com>,
"Wang, Yinan" <yinan.wang@intel.com>,
"He, Xingguang" <xingguang.he@intel.com>,
"Ding, Xuan" <xuan.ding@intel.com>,
"Jiang, Cheng1" <cheng1.jiang@intel.com>,
"Wang, YuanX" <yuanx.wang@intel.com>
Subject: RE: [PATCH v4] vhost: support CPU copy for small packets
Date: Tue, 27 Sep 2022 12:45:03 +0200 [thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D87361@smartserver.smartshare.dk> (raw)
In-Reply-To: <MN0PR11MB6110B0A9A8351F0A0DDAE8BEEB559@MN0PR11MB6110.namprd11.prod.outlook.com>
> From: Ma, WenwuX [mailto:wenwux.ma@intel.com]
> Sent: Tuesday, 27 September 2022 09.32
>
> > From: Morten Brørup <mb@smartsharesystems.com>
> > Sent: 2022年9月7日 22:47
> >
> > > From: Wenwu Ma [mailto:wenwux.ma@intel.com]
> > > Sent: Monday, 29 August 2022 02.57
> > >
> > > Offloading small packets to DMA degrades throughput 10%~20%, and
> this
> > > is because DMA offloading is not free and DMA is not good at
> > > processing small packets. In addition, control plane packets are
> > > usually small, and assign those packets to DMA will significantly
> > > increase latency, which may cause timeout like TCP handshake
> packets.
> > > Therefore, this patch use CPU to perform small copies in vhost.
> > >
> > > Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
> > > ---
> >
> > [...]
> >
> > > diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c index
> > > 35fa4670fd..cf796183a0 100644
> > > --- a/lib/vhost/virtio_net.c
> > > +++ b/lib/vhost/virtio_net.c
> > > @@ -26,6 +26,8 @@
> > >
> > > #define MAX_BATCH_LEN 256
> > >
> > > +#define CPU_COPY_THRESHOLD_LEN 256
> >
> > This threshold may not be optimal for all CPU architectures and/or
> DMA
> > engines.
> >
> > Could you please provide a test application to compare the
> performance of
> > DMA copy with CPU rte_memcpy?
> >
> > The performance metric should be simple: How many cycles does the CPU
> > spend copying various packet sizes using each the two methods.
> >
> > You could provide test_dmadev_perf.c in addition to the existing
> > test_dmadev.c.
> > You can probably copy a some of the concepts and code from
> > test_memcpy_perf.c.
> > Alternatively, you might be able to add DMA copy to
> test_memcpy_perf.c.
> >
> > I'm sorry to push this on you - it should have been done as part of
> DMAdev
> > development already.
> >
> > -Morten
>
> The test application has been supported by the following patch.
>
> http://patchwork.dpdk.org/project/dpdk/patch/20220919113957.52127-1-
> cheng1.jiang@intel.com/
>
Yes, thank you for reminding me.
Acked-by: Morten Brørup <mb@smartsharesystems.com>
next prev parent reply other threads:[~2022-09-27 10:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-12 6:45 [PATCH] " Wenwu Ma
2022-08-12 7:34 ` [PATCH v2] " Wenwu Ma
2022-08-26 5:31 ` [PATCH v3] " Wenwu Ma
2022-08-29 0:56 ` [PATCH v4] " Wenwu Ma
2022-09-07 14:47 ` Morten Brørup
2022-09-27 7:32 ` Ma, WenwuX
2022-09-27 10:45 ` Morten Brørup [this message]
2024-10-04 2:22 ` Stephen Hemminger
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=98CBD80474FA8B44BF855DF32C47DC35D87361@smartserver.smartshare.dk \
--to=mb@smartsharesystems.com \
--cc=bruce.richardson@intel.com \
--cc=chenbo.xia@intel.com \
--cc=cheng1.jiang@intel.com \
--cc=dev@dpdk.org \
--cc=jiayu.hu@intel.com \
--cc=maxime.coquelin@redhat.com \
--cc=sunil.pai.g@intel.com \
--cc=wenwux.ma@intel.com \
--cc=xingguang.he@intel.com \
--cc=xuan.ding@intel.com \
--cc=yinan.wang@intel.com \
--cc=yuanx.wang@intel.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).