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 DCEB2A045E for ; Wed, 29 May 2019 18:34:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2F6D71B9F2; Wed, 29 May 2019 18:31:54 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 258F21B9DF for ; Wed, 29 May 2019 18:31:46 +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:46 -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:45 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Reshma Pattan , stephen@networkplumber.org, thomas@monjalon.net, david.marchand@redhat.com Date: Wed, 29 May 2019 17:31:04 +0100 Message-Id: <11dbff1785a922c77fdda5e225c82b3fb61f415c.1559147228.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH 18/25] reorder: 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_reorder/rte_reorder.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/librte_reorder/rte_reorder.c b/lib/librte_reorder/rte_reorder.c index 3a4a1b0a0..c505a4810 100644 --- a/lib/librte_reorder/rte_reorder.c +++ b/lib/librte_reorder/rte_reorder.c @@ -119,7 +119,7 @@ rte_reorder_create(const char *name, unsigned socket_id, unsigned int size) return NULL; } - rte_rwlock_write_lock(RTE_EAL_TAILQ_RWLOCK); + rte_eal_mcfg_tailq_write_lock(); /* guarantee there's no existing */ TAILQ_FOREACH(te, reorder_list, next) { @@ -152,7 +152,7 @@ rte_reorder_create(const char *name, unsigned socket_id, unsigned int size) } exit: - rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK); + rte_eal_mcfg_tailq_write_unlock(); return b; } @@ -193,7 +193,7 @@ rte_reorder_free(struct rte_reorder_buffer *b) reorder_list = RTE_TAILQ_CAST(rte_reorder_tailq.head, rte_reorder_list); - rte_rwlock_write_lock(RTE_EAL_TAILQ_RWLOCK); + rte_eal_mcfg_tailq_write_lock(); /* find our tailq entry */ TAILQ_FOREACH(te, reorder_list, next) { @@ -201,13 +201,13 @@ rte_reorder_free(struct rte_reorder_buffer *b) break; } if (te == NULL) { - rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK); + rte_eal_mcfg_tailq_write_unlock(); return; } TAILQ_REMOVE(reorder_list, te, next); - rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK); + rte_eal_mcfg_tailq_write_unlock(); rte_reorder_free_mbufs(b); @@ -229,13 +229,13 @@ rte_reorder_find_existing(const char *name) reorder_list = RTE_TAILQ_CAST(rte_reorder_tailq.head, rte_reorder_list); - rte_rwlock_read_lock(RTE_EAL_TAILQ_RWLOCK); + rte_eal_mcfg_tailq_read_lock(); TAILQ_FOREACH(te, reorder_list, next) { b = (struct rte_reorder_buffer *) te->data; if (strncmp(name, b->name, RTE_REORDER_NAMESIZE) == 0) break; } - rte_rwlock_read_unlock(RTE_EAL_TAILQ_RWLOCK); + rte_eal_mcfg_tailq_read_unlock(); if (te == NULL) { rte_errno = ENOENT; -- 2.17.1