From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 1D472A045E for ; Wed, 29 May 2019 18:33:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C5C031B9D3; Wed, 29 May 2019 18:31:44 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id A322F1B9B6 for ; Wed, 29 May 2019 18:31:36 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 May 2019 09:31:36 -0700 X-ExtLoop1: 1 Received: from silpixa00399498.ir.intel.com (HELO silpixa00399498.ger.corp.intel.com) ([10.237.223.125]) by orsmga005.jf.intel.com with ESMTP; 29 May 2019 09:31:34 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Jerin Jacob , stephen@networkplumber.org, thomas@monjalon.net, david.marchand@redhat.com Date: Wed, 29 May 2019 17:30:59 +0100 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH 13/25] eventdev: use new tailq locking API 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" Replace usages of direct access to shared memory config with calls to the new API. Signed-off-by: Anatoly Burakov --- lib/librte_eventdev/rte_event_ring.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/librte_eventdev/rte_event_ring.c b/lib/librte_eventdev/rte_event_ring.c index 16d02a953..fcb90eb45 100644 --- a/lib/librte_eventdev/rte_event_ring.c +++ b/lib/librte_eventdev/rte_event_ring.c @@ -72,7 +72,7 @@ rte_event_ring_create(const char *name, unsigned int count, int socket_id, return NULL; } - rte_rwlock_write_lock(RTE_EAL_TAILQ_RWLOCK); + rte_eal_mcfg_tailq_write_lock(); /* * reserve a memory zone for this ring. If we can't get rte_config or @@ -89,7 +89,7 @@ rte_event_ring_create(const char *name, unsigned int count, int socket_id, if (rte_memzone_free(mz) != 0) RTE_LOG(ERR, RING, "Cannot free memzone\n"); rte_free(te); - rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK); + rte_eal_mcfg_tailq_write_unlock(); return NULL; } @@ -102,7 +102,7 @@ rte_event_ring_create(const char *name, unsigned int count, int socket_id, RTE_LOG(ERR, RING, "Cannot reserve memory\n"); rte_free(te); } - rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK); + rte_eal_mcfg_tailq_write_unlock(); return r; } @@ -118,7 +118,7 @@ rte_event_ring_lookup(const char *name) ring_list = RTE_TAILQ_CAST(rte_event_ring_tailq.head, rte_event_ring_list); - rte_rwlock_read_lock(RTE_EAL_TAILQ_RWLOCK); + rte_eal_mcfg_tailq_read_lock(); TAILQ_FOREACH(te, ring_list, next) { r = (struct rte_event_ring *) te->data; @@ -126,7 +126,7 @@ rte_event_ring_lookup(const char *name) break; } - rte_rwlock_read_unlock(RTE_EAL_TAILQ_RWLOCK); + rte_eal_mcfg_tailq_read_unlock(); if (te == NULL) { rte_errno = ENOENT; @@ -163,7 +163,7 @@ rte_event_ring_free(struct rte_event_ring *r) ring_list = RTE_TAILQ_CAST(rte_event_ring_tailq.head, rte_event_ring_list); - rte_rwlock_write_lock(RTE_EAL_TAILQ_RWLOCK); + rte_eal_mcfg_tailq_write_lock(); /* find out tailq entry */ TAILQ_FOREACH(te, ring_list, next) { @@ -172,13 +172,13 @@ rte_event_ring_free(struct rte_event_ring *r) } if (te == NULL) { - rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK); + rte_eal_mcfg_tailq_write_unlock(); return; } TAILQ_REMOVE(ring_list, te, next); - rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK); + rte_eal_mcfg_tailq_write_unlock(); rte_free(te); } -- 2.17.1