From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Wenwu Ma" <wenwux.ma@intel.com>, <maxime.coquelin@redhat.com>,
<chenbo.xia@intel.com>, <dev@dpdk.org>,
"Bruce Richardson" <bruce.richardson@intel.com>
Cc: <sunil.pai.g@intel.com>, <jiayu.hu@intel.com>,
<yinan.wang@intel.com>, <xingguang.he@intel.com>,
<xuan.ding@intel.com>, <cheng1.jiang@intel.com>,
<yuanx.wang@intel.com>
Subject: RE: [PATCH v4] vhost: support CPU copy for small packets
Date: Wed, 7 Sep 2022 16:47:13 +0200 [thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D87300@smartserver.smartshare.dk> (raw)
In-Reply-To: <20220829005658.84590-1-wenwux.ma@intel.com>
> 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
next prev parent reply other threads:[~2022-09-07 14:47 UTC|newest]
Thread overview: 7+ 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 [this message]
2022-09-27 7:32 ` Ma, WenwuX
2022-09-27 10:45 ` Morten Brørup
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=98CBD80474FA8B44BF855DF32C47DC35D87300@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).