From patchwork Wed Aug 28 14:46:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honnappa Nagarahalli X-Patchwork-Id: 172395 Delivered-To: patch@linaro.org Received: by 2002:ac9:5c4b:0:0:0:0:0 with SMTP id r11csp1016662ocp; Wed, 28 Aug 2019 07:47:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqzy4Y5YJF196+HdKlA1vWsKDY0dGLv0Pdakq/M7tNyWPnrkJaNSh6zc7lPff5Nq16tCZHRM X-Received: by 2002:a17:906:cc81:: with SMTP id oq1mr3601507ejb.124.1567003627921; Wed, 28 Aug 2019 07:47:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567003627; cv=none; d=google.com; s=arc-20160816; b=e7yZU5dCzsVhNStSK+gw8Y607gpJm76FGGUeIoDlKig8Xsue8CqlLxPbJeM7TfhcHd NnMjbfDXXyUgsk+9CDsnMbj6irFwYMnnxx6/KQmHwFas5ReXABQAHl4th0mk5ci36D0i wH1op3qzL15Trv3IkqMUBdcDmL5z1lAE3/vaQZifZNUk8hd/qm1u3pLtqgzrY3FTkj+m Lh10f6uMWtDh/2FIOYDwQJevaLTSBvqZY5/12m8NP/lb9wAYHMFeutHhAE+hAUmfXFHY A7BAIpKVneJgHmncJsKOOcK8pj8do8iaht/xyD71EL5YMeHO70iulomfw0xsqdg+TWbA ITFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=1ESO9kazWZW9VQWbx0wOx0pj7fwfQAvx3hKNu0GLge0=; b=AR09njDVqCUtutygqHBX6O3wUGvT11yyeHiNKkBpq0gfvDSHdrh65RVgkofZM20z3g VDlrdYooeewAIhomuigiYQioPAiUt3f70Wkhg52HG2kNSMvyCNXLHWqo69msouB4r1hA FijNGRsCy1/HfAt9dttnDtaR5mz/fW+a7gq+7txw+M9dNpy/4gsq7bYz/cgzcGpU45AA 3VZpGTUSFEIy/gSRwGoOoh70UgbsVzYYjdFF2Qc9vWli5z0BcjgccH8UvJ7QHxMjSreU UXpqWkrZn4xGggXQnoOgGUkjP+5s0ZRlFIc8Pd6pK/d4+JUMlrbsG6RLG7fBTFMTnNIw H07Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id f50si1363416eda.231.2019.08.28.07.47.07; Wed, 28 Aug 2019 07:47:07 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E19021C013; Wed, 28 Aug 2019 16:46:44 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by dpdk.org (Postfix) with ESMTP id 71A441BEEE for ; Wed, 28 Aug 2019 16:46:40 +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 01A4315AB; Wed, 28 Aug 2019 07:46:40 -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 E251E3F246; Wed, 28 Aug 2019 07:46:39 -0700 (PDT) From: Honnappa Nagarahalli To: olivier.matz@6wind.com, yipeng1.wang@intel.com, sameh.gobriel@intel.com, bruce.richardson@intel.com, pablo.de.lara.guarch@intel.com, honnappa.nagarahalli@arm.com Cc: dev@dpdk.org, dharmik.thakkar@arm.com, gavin.hu@arm.com, ruifeng.wang@arm.com, nd@arm.com Date: Wed, 28 Aug 2019 09:46:13 -0500 Message-Id: <20190828144614.25284-5-honnappa.nagarahalli@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190828144614.25284-1-honnappa.nagarahalli@arm.com> References: <20190828144614.25284-1-honnappa.nagarahalli@arm.com> Subject: [dpdk-dev] [PATCH 4/5] lib/ring: add ring APIs to support 32b ring elements 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" Add ring APIs to support 32b ring elements using templates. Signed-off-by: Honnappa Nagarahalli Reviewed-by: Dharmik Thakkar Reviewed-by: Gavin Hu Reviewed-by: Ruifeng Wang --- lib/librte_ring/Makefile | 3 ++- lib/librte_ring/meson.build | 4 +++- lib/librte_ring/rte_ring_32.c | 19 +++++++++++++++ lib/librte_ring/rte_ring_32.h | 36 ++++++++++++++++++++++++++++ lib/librte_ring/rte_ring_version.map | 2 ++ 5 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 lib/librte_ring/rte_ring_32.c create mode 100644 lib/librte_ring/rte_ring_32.h -- 2.17.1 diff --git a/lib/librte_ring/Makefile b/lib/librte_ring/Makefile index 818898110..3102bb64d 100644 --- a/lib/librte_ring/Makefile +++ b/lib/librte_ring/Makefile @@ -14,10 +14,11 @@ EXPORT_MAP := rte_ring_version.map LIBABIVER := 2 # all source are stored in SRCS-y -SRCS-$(CONFIG_RTE_LIBRTE_RING) := rte_ring.c +SRCS-$(CONFIG_RTE_LIBRTE_RING) := rte_ring.c rte_ring_32.c # install includes SYMLINK-$(CONFIG_RTE_LIBRTE_RING)-include := rte_ring.h \ + rte_ring_32.h \ rte_ring_generic.h \ rte_ring_c11_mem.h \ rte_ring_template.h \ diff --git a/lib/librte_ring/meson.build b/lib/librte_ring/meson.build index e4e208a7c..81ea53ed7 100644 --- a/lib/librte_ring/meson.build +++ b/lib/librte_ring/meson.build @@ -2,8 +2,10 @@ # Copyright(c) 2017 Intel Corporation version = 2 -sources = files('rte_ring.c') +sources = files('rte_ring.c', + 'rte_ring_32.c') headers = files('rte_ring.h', + 'rte_ring_32.h', 'rte_ring_c11_mem.h', 'rte_ring_generic.h', 'rte_ring_template.h', diff --git a/lib/librte_ring/rte_ring_32.c b/lib/librte_ring/rte_ring_32.c new file mode 100644 index 000000000..09e90cec1 --- /dev/null +++ b/lib/librte_ring/rte_ring_32.c @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2019 Arm Limited + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include diff --git a/lib/librte_ring/rte_ring_32.h b/lib/librte_ring/rte_ring_32.h new file mode 100644 index 000000000..5270a9bc7 --- /dev/null +++ b/lib/librte_ring/rte_ring_32.h @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2019 Arm Limited + */ + +#ifndef _RTE_RING_32_H_ +#define _RTE_RING_32_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define RTE_RING_TMPLT_API_SUFFIX 32 +#define RTE_RING_TMPLT_ELEM_SIZE sizeof(uint32_t) +#define RTE_RING_TMPLT_ELEM_TYPE uint32_t +#define RTE_RING_TMPLT_EXPERIMENTAL __rte_experimental + +#include + +#ifdef __cplusplus +} +#endif + +#endif /* _RTE_RING_32_H_ */ diff --git a/lib/librte_ring/rte_ring_version.map b/lib/librte_ring/rte_ring_version.map index e410a7503..9efba91bb 100644 --- a/lib/librte_ring/rte_ring_version.map +++ b/lib/librte_ring/rte_ring_version.map @@ -21,7 +21,9 @@ DPDK_2.2 { EXPERIMENTAL { global: + rte_ring_create_32; rte_ring_create_elem; + rte_ring_get_memsize_32; rte_ring_get_memsize_elem; rte_ring_reset;