From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2185DA00C2; Tue, 27 Sep 2022 12:45:05 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 026B241133; Tue, 27 Sep 2022 12:45:05 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id 384FF410D0 for ; Tue, 27 Sep 2022 12:45:04 +0200 (CEST) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="ks_c_5601-1987" Content-Transfer-Encoding: quoted-printable Subject: RE: [PATCH v4] vhost: support CPU copy for small packets Date: Tue, 27 Sep 2022 12:45:03 +0200 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D87361@smartserver.smartshare.dk> In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH v4] vhost: support CPU copy for small packets Thread-Index: AQHYu0J5TNZGRMdSNk+2CfL0BaWs3q3UGumAgB7zZUCAADcBIA== References: <20220812064517.272530-1-wenwux.ma@intel.com> <20220829005658.84590-1-wenwux.ma@intel.com> <98CBD80474FA8B44BF855DF32C47DC35D87300@smartserver.smartshare.dk> From: =?ks_c_5601-1987?B?TW9ydGVuIEJyqapydXA=?= To: "Ma, WenwuX" , , "Xia, Chenbo" , , "Richardson, Bruce" Cc: "Pai G, Sunil" , "Hu, Jiayu" , "Wang, Yinan" , "He, Xingguang" , "Ding, Xuan" , "Jiang, Cheng1" , "Wang, YuanX" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > From: Ma, WenwuX [mailto:wenwux.ma@intel.com] > Sent: Tuesday, 27 September 2022 09.32 >=20 > > From: Morten Br=A9=AArup > > Sent: 2022=D2=B49=EA=C57=EC=ED 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 > > > --- > > > > [...] > > > > > 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 >=20 > The test application has been supported by the following patch. >=20 > http://patchwork.dpdk.org/project/dpdk/patch/20220919113957.52127-1- > cheng1.jiang@intel.com/ >=20 Yes, thank you for reminding me. Acked-by: Morten Br=A9=AArup