[17/25] mempool: use new tailq locking API

Message ID abad7640365fbaf85a759d9488b93c988c73bac5.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:31 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_mempool/rte_mempool.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
  

Comments

Andrew Rybchenko May 29, 2019, 4:47 p.m. UTC | #1
On 5/29/19 7:31 PM, Anatoly Burakov wrote:
> Replace usages of direct access to shared memory config with
> calls to the new API.
>
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>

Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
  

Patch

diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c
index 69bd2a65c..aacfdafdd 100644
--- a/lib/librte_mempool/rte_mempool.c
+++ b/lib/librte_mempool/rte_mempool.c
@@ -711,7 +711,7 @@  rte_mempool_free(struct rte_mempool *mp)
 		return;
 
 	mempool_list = RTE_TAILQ_CAST(rte_mempool_tailq.head, rte_mempool_list);
-	rte_rwlock_write_lock(RTE_EAL_TAILQ_RWLOCK);
+	rte_eal_mcfg_tailq_write_lock();
 	/* find out tailq entry */
 	TAILQ_FOREACH(te, mempool_list, next) {
 		if (te->data == (void *)mp)
@@ -722,7 +722,7 @@  rte_mempool_free(struct rte_mempool *mp)
 		TAILQ_REMOVE(mempool_list, te, next);
 		rte_free(te);
 	}
-	rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK);
+	rte_eal_mcfg_tailq_write_unlock();
 
 	rte_mempool_free_memchunks(mp);
 	rte_mempool_ops_free(mp);
@@ -898,9 +898,9 @@  rte_mempool_create_empty(const char *name, unsigned n, unsigned elt_size,
 
 	te->data = mp;
 
-	rte_rwlock_write_lock(RTE_EAL_TAILQ_RWLOCK);
+	rte_eal_mcfg_tailq_write_lock();
 	TAILQ_INSERT_TAIL(mempool_list, te, next);
-	rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK);
+	rte_eal_mcfg_tailq_write_unlock();
 	rte_rwlock_write_unlock(RTE_EAL_MEMPOOL_RWLOCK);
 
 	return mp;