From patchwork Fri Oct 23 04:43:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honnappa Nagarahalli X-Patchwork-Id: 318909 Delivered-To: patch@linaro.org Received: by 2002:a92:d1d1:0:0:0:0:0 with SMTP id u17csp125968ilg; Thu, 22 Oct 2020 21:45:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFO4XT6yHdQUunqQUM2wjyIeJYKRaNDV3GNKLOLFfpmV2tQhCEeAONKn77nXdPLAadzrvQ X-Received: by 2002:a17:906:8349:: with SMTP id b9mr290643ejy.88.1603428309409; Thu, 22 Oct 2020 21:45:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603428309; cv=none; d=google.com; s=arc-20160816; b=xDj5mDexoMdYZg4Vv9SkOZofyjpnlFWfMHqpyDbqVoyB5v+PO//k/nI7PjVltEOhyM x58uC/35vmwV3BgphikVifD1tfWfbke996QdL/1ypHP+4AbK7ICnmvDlZAkaXrqdDlf3 TtLWED1o7PvGQeMes5lG36ISRorPabb/06Rk8PveJ6ao2rcUnNMXPv/lojnLN3m9ctP+ Ww/OAY5Ow6mW5gBNQgqNVT0argXQWStnuyxjFEyPlXsKdN0e8qC6W6SC+pgGrZNwZacV RhPR+fcluB2l5u8lQhiM0g/rvcWpauotXJP+An8PV7lM2/0D1Rx1e6zBKi+vJOW6G2+j O93g== 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=a3yZwjRAyrb6v0nFM1C5zkGdYuhkls2zQID9LNTCdYs=; b=NuWoupicAJlEqwRUbftSz6wXPIygZ8H0HL6C2ZvbHb0n3Ws8xFAppw1AJmWOM3oaCX NePHyLVi5ooB46388dQpauoev8EEiEE6zl8qljZV3PLOBUuxLZv/dlFHfBoFfrG1+aZK OIxbm0MTb+Skfa3oyilsx5ih3CMPr3xDn/r7wI1a0CxudY8jJheCJELx+mOvssdlddwQ B0eBmyR3r2ldLPj/T9GP5HqJVEQMdRa/0bmYPyc3fqxcnmfSQ8+X8ZAKrNWB8W6iNefJ trbMlxbjoFuCguTLwY3iGASmjNWktq76RLmxD73muETEtMO8YbuUZaUxYd80lci62xT8 A6xg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id v4si95396edx.148.2020.10.22.21.45.09; Thu, 22 Oct 2020 21:45:09 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A4D1B72D8; Fri, 23 Oct 2020 06:44:25 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by dpdk.org (Postfix) with ESMTP id 86DFF6CAC for ; Fri, 23 Oct 2020 06:44: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 0BBA9113E; Thu, 22 Oct 2020 21:44:21 -0700 (PDT) Received: from qc2400f-1.austin.arm.com (qc2400f-1.austin.arm.com [10.118.12.27]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EF73F3F66B; Thu, 22 Oct 2020 21:44:20 -0700 (PDT) From: Honnappa Nagarahalli To: dev@dpdk.org, honnappa.nagarahalli@arm.com, konstantin.ananyev@intel.com Cc: olivier.matz@6wind.com, david.marchand@redhat.com, dharmik.thakkar@arm.com, ruifeng.wang@arm.com, nd@arm.com Date: Thu, 22 Oct 2020 23:43:41 -0500 Message-Id: <20201023044343.13462-4-honnappa.nagarahalli@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201023044343.13462-1-honnappa.nagarahalli@arm.com> References: <20200224203931.21256-1-honnappa.nagarahalli@arm.com> <20201023044343.13462-1-honnappa.nagarahalli@arm.com> Subject: [dpdk-dev] [PATCH v3 3/5] test/ring: move common function to header file 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" Move test_ring_inc_ptr to header file so that it can be used by functions in other files. Signed-off-by: Honnappa Nagarahalli Reviewed-by: Dharmik Thakkar --- app/test/test_ring.c | 11 ----------- app/test/test_ring.h | 11 +++++++++++ 2 files changed, 11 insertions(+), 11 deletions(-) -- 2.17.1 diff --git a/app/test/test_ring.c b/app/test/test_ring.c index a62cb263b..329d538a9 100644 --- a/app/test/test_ring.c +++ b/app/test/test_ring.c @@ -243,17 +243,6 @@ test_ring_deq_impl(struct rte_ring *r, void **obj, int esize, unsigned int n, NULL); } -static void** -test_ring_inc_ptr(void **obj, int esize, unsigned int n) -{ - /* Legacy queue APIs? */ - if ((esize) == -1) - return ((void **)obj) + n; - else - return (void **)(((uint32_t *)obj) + - (n * esize / sizeof(uint32_t))); -} - static void test_ring_mem_init(void *obj, unsigned int count, int esize) { diff --git a/app/test/test_ring.h b/app/test/test_ring.h index d4b15af7c..16697ee02 100644 --- a/app/test/test_ring.h +++ b/app/test/test_ring.h @@ -42,6 +42,17 @@ test_ring_create(const char *name, int esize, unsigned int count, (socket_id), (flags)); } +static inline void** +test_ring_inc_ptr(void **obj, int esize, unsigned int n) +{ + /* Legacy queue APIs? */ + if ((esize) == -1) + return ((void **)obj) + n; + else + return (void **)(((uint32_t *)obj) + + (n * esize / sizeof(uint32_t))); +} + static __rte_always_inline unsigned int test_ring_enqueue(struct rte_ring *r, void **obj, int esize, unsigned int n, unsigned int api_type)