From patchwork Thu Jan 23 08:30:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 65080 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4ED67A0537; Thu, 23 Jan 2020 09:31:05 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 36B9D2A62; Thu, 23 Jan 2020 09:31:04 +0100 (CET) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 6065F2956 for ; Thu, 23 Jan 2020 09:31:02 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id CCB0E222C2; Thu, 23 Jan 2020 03:31:01 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 23 Jan 2020 03:31:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=mesmtp; bh=AiVgS7kOy/opjbUHnZdRaoL EYcb+2a4udoVGmSuwiTw=; b=MEruG5racbgVfBCtUp2krBFUv0t+wxxkEqgqRTM m4JAA3qInIoymeLn1VnR/lLs/pLSOvEgkvvnpn6a6i9zjeeyxbmys9mi927QDBL9 C/OEkxXWH8pblpDnWNlCmJomUUyLJE89G2gdIXKwjbrGSBHc23GcKggt9Y36o4zL 5pmM= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=AiVgS7kOy/opjbUHn ZdRaoLEYcb+2a4udoVGmSuwiTw=; b=UkE/2WwmdXNikW0WfecQPsHfx878LyiNQ 7NCedoVEg33ST4KYdP/bLMWBQJlmqiNE/Nv5y7ygofBrgzrHgqbHj+LhgG6ez1vX M3QfaaPYrbWItGJqO5P9N2cezAV6CEKJilDXyncXGd3G0ikfreK4zAvmpR6xTYBB 0ImK3fsD39NGa6aobI5WOCyyXtoarWM+uDti8mDm1jsVvXJQgMv6NLtFqabGH7nK jX0PfaSLAKt1EP5eXCpkfbYRXQBkof0z3i2xEKg75og4gtRN5WU0VBQdhn1zXj+2 puyHZoEEqDz94mZJ69iDwgEC7LYV4ezQZAEu9dCw3c1tA0kv0S1iQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrvddugdduudehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgrshcu ofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecukfhppe ejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgr mhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 780283060AA8; Thu, 23 Jan 2020 03:31:00 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: honnappa.nagarahalli@arm.com, David Marchand , Olivier Matz , Dharmik Thakkar , Gavin Hu , Ruifeng Wang Date: Thu, 23 Jan 2020 09:30:22 +0100 Message-Id: <20200123083022.3791956-1-thomas@monjalon.net> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH] ring: fix namespace prefix of inline functions 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" When adding custom element size feature, some internal inline functions were added in a public header without rte_ prefix. It is fixed by adding __rte_ring_. Fixes: cc4b218790f6 ("ring: support configurable element size") Reported-by: David Marchand Signed-off-by: Thomas Monjalon Acked-by: Honnappa Nagarahalli Acked-by: Olivier Matz Acked-by: Honnappa Nagarahalli Acked-by: Olivier Matz --- lib/librte_ring/rte_ring_elem.h | 42 +++++++++++++++++---------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/lib/librte_ring/rte_ring_elem.h b/lib/librte_ring/rte_ring_elem.h index 15d79bf2ac..7fdfe01e0b 100644 --- a/lib/librte_ring/rte_ring_elem.h +++ b/lib/librte_ring/rte_ring_elem.h @@ -110,8 +110,8 @@ struct rte_ring *rte_ring_create_elem(const char *name, unsigned int esize, unsigned int count, int socket_id, unsigned int flags); static __rte_always_inline void -enqueue_elems_32(struct rte_ring *r, const uint32_t size, uint32_t idx, - const void *obj_table, uint32_t n) +__rte_ring_enqueue_elems_32(struct rte_ring *r, const uint32_t size, + uint32_t idx, const void *obj_table, uint32_t n) { unsigned int i; uint32_t *ring = (uint32_t *)&r[1]; @@ -153,7 +153,7 @@ enqueue_elems_32(struct rte_ring *r, const uint32_t size, uint32_t idx, } static __rte_always_inline void -enqueue_elems_64(struct rte_ring *r, uint32_t prod_head, +__rte_ring_enqueue_elems_64(struct rte_ring *r, uint32_t prod_head, const void *obj_table, uint32_t n) { unsigned int i; @@ -186,7 +186,7 @@ enqueue_elems_64(struct rte_ring *r, uint32_t prod_head, } static __rte_always_inline void -enqueue_elems_128(struct rte_ring *r, uint32_t prod_head, +__rte_ring_enqueue_elems_128(struct rte_ring *r, uint32_t prod_head, const void *obj_table, uint32_t n) { unsigned int i; @@ -219,16 +219,16 @@ enqueue_elems_128(struct rte_ring *r, uint32_t prod_head, * single and multi producer enqueue functions. */ static __rte_always_inline void -enqueue_elems(struct rte_ring *r, uint32_t prod_head, const void *obj_table, - uint32_t esize, uint32_t num) +__rte_ring_enqueue_elems(struct rte_ring *r, uint32_t prod_head, + const void *obj_table, uint32_t esize, uint32_t num) { /* 8B and 16B copies implemented individually to retain * the current performance. */ if (esize == 8) - enqueue_elems_64(r, prod_head, obj_table, num); + __rte_ring_enqueue_elems_64(r, prod_head, obj_table, num); else if (esize == 16) - enqueue_elems_128(r, prod_head, obj_table, num); + __rte_ring_enqueue_elems_128(r, prod_head, obj_table, num); else { uint32_t idx, scale, nr_idx, nr_num, nr_size; @@ -238,13 +238,14 @@ enqueue_elems(struct rte_ring *r, uint32_t prod_head, const void *obj_table, idx = prod_head & r->mask; nr_idx = idx * scale; nr_size = r->size * scale; - enqueue_elems_32(r, nr_size, nr_idx, obj_table, nr_num); + __rte_ring_enqueue_elems_32(r, nr_size, nr_idx, + obj_table, nr_num); } } static __rte_always_inline void -dequeue_elems_32(struct rte_ring *r, const uint32_t size, uint32_t idx, - void *obj_table, uint32_t n) +__rte_ring_dequeue_elems_32(struct rte_ring *r, const uint32_t size, + uint32_t idx, void *obj_table, uint32_t n) { unsigned int i; uint32_t *ring = (uint32_t *)&r[1]; @@ -286,7 +287,7 @@ dequeue_elems_32(struct rte_ring *r, const uint32_t size, uint32_t idx, } static __rte_always_inline void -dequeue_elems_64(struct rte_ring *r, uint32_t prod_head, +__rte_ring_dequeue_elems_64(struct rte_ring *r, uint32_t prod_head, void *obj_table, uint32_t n) { unsigned int i; @@ -319,7 +320,7 @@ dequeue_elems_64(struct rte_ring *r, uint32_t prod_head, } static __rte_always_inline void -dequeue_elems_128(struct rte_ring *r, uint32_t prod_head, +__rte_ring_dequeue_elems_128(struct rte_ring *r, uint32_t prod_head, void *obj_table, uint32_t n) { unsigned int i; @@ -348,16 +349,16 @@ dequeue_elems_128(struct rte_ring *r, uint32_t prod_head, * single and multi producer enqueue functions. */ static __rte_always_inline void -dequeue_elems(struct rte_ring *r, uint32_t cons_head, void *obj_table, - uint32_t esize, uint32_t num) +__rte_ring_dequeue_elems(struct rte_ring *r, uint32_t cons_head, + void *obj_table, uint32_t esize, uint32_t num) { /* 8B and 16B copies implemented individually to retain * the current performance. */ if (esize == 8) - dequeue_elems_64(r, cons_head, obj_table, num); + __rte_ring_dequeue_elems_64(r, cons_head, obj_table, num); else if (esize == 16) - dequeue_elems_128(r, cons_head, obj_table, num); + __rte_ring_dequeue_elems_128(r, cons_head, obj_table, num); else { uint32_t idx, scale, nr_idx, nr_num, nr_size; @@ -367,7 +368,8 @@ dequeue_elems(struct rte_ring *r, uint32_t cons_head, void *obj_table, idx = cons_head & r->mask; nr_idx = idx * scale; nr_size = r->size * scale; - dequeue_elems_32(r, nr_size, nr_idx, obj_table, nr_num); + __rte_ring_dequeue_elems_32(r, nr_size, nr_idx, + obj_table, nr_num); } } @@ -424,7 +426,7 @@ __rte_ring_do_enqueue_elem(struct rte_ring *r, const void *obj_table, if (n == 0) goto end; - enqueue_elems(r, prod_head, obj_table, esize, n); + __rte_ring_enqueue_elems(r, prod_head, obj_table, esize, n); update_tail(&r->prod, prod_head, prod_next, is_sp, 1); end: @@ -471,7 +473,7 @@ __rte_ring_do_dequeue_elem(struct rte_ring *r, void *obj_table, if (n == 0) goto end; - dequeue_elems(r, cons_head, obj_table, esize, n); + __rte_ring_dequeue_elems(r, cons_head, obj_table, esize, n); update_tail(&r->cons, cons_head, cons_next, is_sc, 0);