From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0E3AC4360C for ; Wed, 9 Oct 2019 02:47:24 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 5283320859 for ; Wed, 9 Oct 2019 02:47:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5283320859 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9D2A31C124; Wed, 9 Oct 2019 04:47:23 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by dpdk.org (Postfix) with ESMTP id 89BEE1C123 for ; Wed, 9 Oct 2019 04:47:22 +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 AF26428; Tue, 8 Oct 2019 19:47:21 -0700 (PDT) Received: from qc2400f-1.austin.arm.com (qc2400f-1.austin.arm.com [10.118.12.34]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A42F83F6C4; Tue, 8 Oct 2019 19:47:21 -0700 (PDT) From: Honnappa Nagarahalli To: olivier.matz@6wind.com, sthemmin@microsoft.com, jerinj@marvell.com, bruce.richardson@intel.com, david.marchand@redhat.com, pbhagavatula@marvell.com, konstantin.ananyev@intel.com, honnappa.nagarahalli@arm.com Cc: dev@dpdk.org, dharmik.thakkar@arm.com, ruifeng.wang@arm.com, gavin.hu@arm.com Date: Tue, 8 Oct 2019 21:47:07 -0500 Message-Id: <20191009024709.38144-1-honnappa.nagarahalli@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190906190510.11146-1-honnappa.nagarahalli@arm.com> References: <20190906190510.11146-1-honnappa.nagarahalli@arm.com> Subject: [dpdk-dev] [PATCH v3 0/2] lib/ring: APIs to support custom element size X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The current rte_ring hard-codes the type of the ring element to 'void *', hence the size of the element is hard-coded to 32b/64b. Since the ring element type is not an input to rte_ring APIs, it results in couple of issues: 1) If an application requires to store an element which is not 64b, it needs to write its own ring APIs similar to rte_event_ring APIs. This creates additional burden on the programmers, who end up making work-arounds and often waste memory. 2) If there are multiple libraries that store elements of the same type, currently they would have to write their own rte_ring APIs. This results in code duplication. This patch adds new APIs to support configurable ring element size. The APIs support custom element sizes by allowing to define the ring element to be a multiple of 32b. The aim is to achieve same performance as the existing ring implementation. The patch adds same performance tests that are run for existing APIs. This allows for performance comparison. I also tested with memcpy. x86 shows significant improvements on bulk and burst tests. On the Arm platform, I used, there is a drop of 4% to 6% in few tests. May be this is something that we can explore later. Note that this version skips changes to other libraries as I would like to get an agreement on the implementation from the community. They will be added once there is agreement on the rte_ring changes. v4 - Few fixes after more performance testing v3 - Removed macro-fest and used inline functions (Stephen, Bruce) v2 - Change Event Ring implementation to use ring templates (Jerin, Pavan) Honnappa Nagarahalli (2): lib/ring: apis to support configurable element size test/ring: add test cases for configurable element size ring app/test/Makefile | 1 + app/test/meson.build | 1 + app/test/test_ring_perf_elem.c | 419 ++++++++++++ lib/librte_ring/Makefile | 3 +- lib/librte_ring/meson.build | 3 + lib/librte_ring/rte_ring.c | 45 +- lib/librte_ring/rte_ring.h | 1 + lib/librte_ring/rte_ring_elem.h | 946 +++++++++++++++++++++++++++ lib/librte_ring/rte_ring_version.map | 2 + 9 files changed, 1412 insertions(+), 9 deletions(-) create mode 100644 app/test/test_ring_perf_elem.c create mode 100644 lib/librte_ring/rte_ring_elem.h -- 2.17.1