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 3551DA045E for ; Wed, 29 May 2019 18:33:31 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E49E51B9CC; Wed, 29 May 2019 18:31:42 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 1E0161B9A7 for ; Wed, 29 May 2019 18:31:34 +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:34 -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:32 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Byron Marohn , Pablo de Lara Guarch , stephen@networkplumber.org, thomas@monjalon.net, david.marchand@redhat.com Date: Wed, 29 May 2019 17:30:58 +0100 Message-Id: <45017ccc707ae12055f1d242e0186e6f6a74c69b.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 12/25] efd: 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_efd/rte_efd.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/librte_efd/rte_efd.c b/lib/librte_efd/rte_efd.c index 14e493bc3..71f067df6 100644 --- a/lib/librte_efd/rte_efd.c +++ b/lib/librte_efd/rte_efd.c @@ -532,7 +532,7 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len, num_chunks_shift = rte_bsf32(num_chunks); - rte_rwlock_write_lock(RTE_EAL_TAILQ_RWLOCK); + rte_eal_mcfg_tailq_write_lock(); /* * Guarantee there's no existing: this is normally already checked @@ -685,7 +685,7 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len, te->data = (void *) table; TAILQ_INSERT_TAIL(efd_list, te, next); - rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK); + rte_eal_mcfg_tailq_write_unlock(); snprintf(ring_name, sizeof(ring_name), "HT_%s", table->name); /* Create ring (Dummy slot index is not enqueued) */ @@ -705,7 +705,7 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len, return table; error_unlock_exit: - rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK); + rte_eal_mcfg_tailq_write_unlock(); rte_efd_free(table); return NULL; @@ -720,7 +720,7 @@ rte_efd_find_existing(const char *name) efd_list = RTE_TAILQ_CAST(rte_efd_tailq.head, rte_efd_list); - rte_rwlock_read_lock(RTE_EAL_TAILQ_RWLOCK); + rte_eal_mcfg_tailq_read_lock(); TAILQ_FOREACH(te, efd_list, next) { @@ -728,7 +728,7 @@ rte_efd_find_existing(const char *name) if (strncmp(name, table->name, RTE_EFD_NAMESIZE) == 0) break; } - rte_rwlock_read_unlock(RTE_EAL_TAILQ_RWLOCK); + rte_eal_mcfg_tailq_read_unlock(); if (te == NULL) { rte_errno = ENOENT; @@ -751,7 +751,7 @@ rte_efd_free(struct rte_efd_table *table) rte_free(table->chunks[socket_id]); efd_list = RTE_TAILQ_CAST(rte_efd_tailq.head, rte_efd_list); - rte_rwlock_write_lock(RTE_EAL_TAILQ_RWLOCK); + rte_eal_mcfg_tailq_write_lock(); TAILQ_FOREACH_SAFE(te, efd_list, next, temp) { if (te->data == (void *) table) { @@ -761,7 +761,7 @@ rte_efd_free(struct rte_efd_table *table) } } - rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK); + rte_eal_mcfg_tailq_write_unlock(); rte_ring_free(table->free_slots); rte_free(table->offline_chunks); rte_free(table->keys); -- 2.17.1