[12/25] efd: use new tailq locking API

Message ID 45017ccc707ae12055f1d242e0186e6f6a74c69b.1559147228.git.anatoly.burakov@intel.com (mailing list archive)
State Superseded, archived
Headers
Series Make shared memory config non-public |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Burakov, Anatoly May 29, 2019, 4:30 p.m. UTC
  Replace usages of direct access to shared memory config with
calls to the new API.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/librte_efd/rte_efd.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
  

Patch

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);