Message ID | 20220517105109.1086090-1-joyce.kong@arm.com (mailing list archive) |
---|---|
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DEEB1A0505; Tue, 17 May 2022 12:52:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BFCF840042; Tue, 17 May 2022 12:52:02 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id 9035040041 for <dev@dpdk.org>; Tue, 17 May 2022 12:52:01 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E8B841042; Tue, 17 May 2022 03:52:00 -0700 (PDT) Received: from net-arm-n1amp-02.shanghai.arm.com (net-arm-n1amp-02.shanghai.arm.com [10.169.210.142]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5C16C3F66F; Tue, 17 May 2022 03:51:59 -0700 (PDT) From: Joyce Kong <joyce.kong@arm.com> To: Cc: ruifeng.wang@arm.com, dev@dpdk.org, nd@arm.com, Joyce Kong <joyce.kong@arm.com> Subject: [PATCH v1 0/2] add a fast path for memif Rx/Tx Date: Tue, 17 May 2022 10:51:07 +0000 Message-Id: <20220517105109.1086090-1-joyce.kong@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220412093243.3670187-1-joyce.kong@arm.com> References: <20220412093243.3670187-1-joyce.kong@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org |
Series |
add a fast path for memif Rx/Tx
|
|
Message
Joyce Kong
May 17, 2022, 10:51 a.m. UTC
For memif non-zero-copy mode, there is a branch to compare the mbuf and memif buffer size during memory copying. Add a fast memory copy path by removing this branch with mbuf and memif buffer size defined at compile time. And for Tx fast path, bulk free the mbufs which come from the same mempool. When mbuf == memif buffer size, both Rx/Tx would choose the fast memcpy path. When mbuf < memif buffer size, the Rx chooses previous memcpy path while Tx chooses fast memcpy path. When mbuf > memif buffer size, the Rx chooses fast memcpy path while Tx chooses previous memcpy path. Test with 1p1q on Ampere Altra AArch64 server, --------------------------------------------------------- buf size | memif = mbuf | memif < mbuf | memif > mbuf --------------------------------------------------------- non-zc gain | 16.95% | 3.28% | 13.29% --------------------------------------------------------- zc gain | 19.43% | 4.62% | 18.14% --------------------------------------------------------- Test with 1p1q on Cascade Lake Xeon X86server, --------------------------------------------------------- buf size | memif = mbuf | memif < mbuf | memif > mbuf --------------------------------------------------------- non-zc gain | 19.97% | 2.35% | 21.43% --------------------------------------------------------- zc gain | 14.30% | -1.21% | 11.98% --------------------------------------------------------- Joyce Kong (2): net/memif: add a Rx fast path net/memif: add a Tx fast path drivers/net/memif/rte_eth_memif.c | 258 ++++++++++++++++++++---------- 1 file changed, 176 insertions(+), 82 deletions(-)
Comments
> From: Joyce Kong [mailto:joyce.kong@arm.com] > Sent: Tuesday, 17 May 2022 12.51 > > For memif non-zero-copy mode, there is a branch to compare > the mbuf and memif buffer size during memory copying. Add > a fast memory copy path by removing this branch with mbuf > and memif buffer size defined at compile time. And for Tx > fast path, bulk free the mbufs which come from the same > mempool. > > When mbuf == memif buffer size, both Rx/Tx would choose > the fast memcpy path. When mbuf < memif buffer size, the > Rx chooses previous memcpy path while Tx chooses fast > memcpy path. When mbuf > memif buffer size, the Rx chooses > fast memcpy path while Tx chooses previous memcpy path. > > Test with 1p1q on Ampere Altra AArch64 server, > --------------------------------------------------------- > buf size | memif = mbuf | memif < mbuf | memif > mbuf > --------------------------------------------------------- > non-zc gain | 16.95% | 3.28% | 13.29% > --------------------------------------------------------- > zc gain | 19.43% | 4.62% | 18.14% > --------------------------------------------------------- > > Test with 1p1q on Cascade Lake Xeon X86server, > --------------------------------------------------------- > buf size | memif = mbuf | memif < mbuf | memif > mbuf > --------------------------------------------------------- > non-zc gain | 19.97% | 2.35% | 21.43% > --------------------------------------------------------- > zc gain | 14.30% | -1.21% | 11.98% > --------------------------------------------------------- > > Joyce Kong (2): > net/memif: add a Rx fast path > net/memif: add a Tx fast path > > drivers/net/memif/rte_eth_memif.c | 258 ++++++++++++++++++++---------- > 1 file changed, 176 insertions(+), 82 deletions(-) > > -- > 2.25.1 > Series-Acked-by: Morten Brørup <mb@smartsharesystems.com>
> -----Original Message----- > From: Joyce Kong <joyce.kong@arm.com> > Sent: Tuesday, May 17, 2022 6:51 PM > Cc: Ruifeng Wang <Ruifeng.Wang@arm.com>; dev@dpdk.org; nd > <nd@arm.com>; Joyce Kong <Joyce.Kong@arm.com> > Subject: [PATCH v1 0/2] add a fast path for memif Rx/Tx > > For memif non-zero-copy mode, there is a branch to compare the mbuf and > memif buffer size during memory copying. Add a fast memory copy path by > removing this branch with mbuf and memif buffer size defined at compile > time. And for Tx fast path, bulk free the mbufs which come from the same > mempool. > > When mbuf == memif buffer size, both Rx/Tx would choose the fast > memcpy path. When mbuf < memif buffer size, the Rx chooses previous > memcpy path while Tx chooses fast memcpy path. When mbuf > memif > buffer size, the Rx chooses fast memcpy path while Tx chooses previous > memcpy path. > > Test with 1p1q on Ampere Altra AArch64 server, > --------------------------------------------------------- > buf size | memif = mbuf | memif < mbuf | memif > mbuf > --------------------------------------------------------- > non-zc gain | 16.95% | 3.28% | 13.29% > --------------------------------------------------------- > zc gain | 19.43% | 4.62% | 18.14% > --------------------------------------------------------- > > Test with 1p1q on Cascade Lake Xeon X86server, > --------------------------------------------------------- > buf size | memif = mbuf | memif < mbuf | memif > mbuf > --------------------------------------------------------- > non-zc gain | 19.97% | 2.35% | 21.43% > --------------------------------------------------------- > zc gain | 14.30% | -1.21% | 11.98% > --------------------------------------------------------- > > Joyce Kong (2): > net/memif: add a Rx fast path > net/memif: add a Tx fast path > > drivers/net/memif/rte_eth_memif.c | 258 ++++++++++++++++++++-------- > -- > 1 file changed, 176 insertions(+), 82 deletions(-) > > -- > 2.25.1 Series-reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>