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 59F00A00C5; Thu, 15 Sep 2022 08:58:39 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 463084021D; Thu, 15 Sep 2022 08:58:39 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id 820A440156 for ; Thu, 15 Sep 2022 08:58:37 +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 54BF11682; Wed, 14 Sep 2022 23:58:43 -0700 (PDT) Received: from net-arm-n1sdp-02.shanghai.arm.com (net-arm-n1sdp-02.shanghai.arm.com [10.169.210.140]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5F6943F73B; Wed, 14 Sep 2022 23:59:03 -0700 (PDT) From: Joyce Kong To: jgrajcia@cisco.com, stephen@networkplumber.org Cc: dev@dpdk.org, nd@arm.com, Joyce Kong Subject: [PATCH v4 0/2] add a fast path for memif Rx/Tx Date: Thu, 15 Sep 2022 14:58:23 +0800 Message-Id: <20220915065825.26169-1-joyce.kong@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220412093243.3670187-1-joyce.kong@arm.com> References: <20220412093243.3670187-1-joyce.kong@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 For memif non-zero-copy mode, there is a branch to compare the mbuf and memif buffer size during memory copy. Add a fast memcpy path by removing this branch with mbuf and memif buffer size defined at compile time. For Rx fast path, bulk allocating mbufs to get additional speedup. For Tx fast path, bulk free 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 N1SDP AArch64 server, --------------------------------------------------------- buf size | memif = mbuf | memif < mbuf | memif > mbuf --------------------------------------------------------- non-zc gain | 47.16% | 24.67% | 12.47% --------------------------------------------------------- zc gain | 20.96% | 9.16% | 10.66% --------------------------------------------------------- Test with 1p1q on Cascade Lake Xeon X86 server, --------------------------------------------------------- buf size | memif = mbuf | memif < mbuf | memif > mbuf --------------------------------------------------------- non-zc gain | 23.52% | 14.20% | 5.10% --------------------------------------------------------- zc gain | 17.49% | 10.62% | 12.42% --------------------------------------------------------- v4: 1.Fix incorrect indentation. 2.Fix the mbuf array length to avoid additional overhead if stack-protector strong is enabled. v3: Add bulk allocation to get additional speedup for memif Rx fast path. v2: Rebase v1 and update commit message. Joyce Kong (2): net/memif: add a Rx fast path net/memif: add a Tx fast path drivers/net/memif/rte_eth_memif.c | 280 +++++++++++++++++++++--------- drivers/net/memif/rte_eth_memif.h | 2 + 2 files changed, 199 insertions(+), 83 deletions(-) -- 2.17.1