[02/25] bus/fslmc: use new memory locking API

Message ID 62bb5f666f82c69300655643649583aac38927be.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>
---
 drivers/bus/fslmc/fslmc_vfio.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
  

Comments

Shreyansh Jain June 3, 2019, 6:41 a.m. UTC | #1
> -----Original Message-----
> From: Anatoly Burakov <anatoly.burakov@intel.com>
> Sent: Wednesday, May 29, 2019 10:01 PM
> To: dev@dpdk.org
> Cc: Hemant Agrawal <hemant.agrawal@nxp.com>; Shreyansh Jain
> <shreyansh.jain@nxp.com>; stephen@networkplumber.org;
> thomas@monjalon.net; david.marchand@redhat.com
> Subject: [PATCH 02/25] bus/fslmc: use new memory locking API
> 
> Replace usages of direct access to shared memory config with
> calls to the new API.
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---

From fslmc perspective, looks fine to me.

Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
  

Patch

diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
index 1aae56fa9..bf9911f56 100644
--- a/drivers/bus/fslmc/fslmc_vfio.c
+++ b/drivers/bus/fslmc/fslmc_vfio.c
@@ -347,14 +347,12 @@  fslmc_dmamap_seg(const struct rte_memseg_list *msl __rte_unused,
 int rte_fslmc_vfio_dmamap(void)
 {
 	int i = 0, ret;
-	struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
-	rte_rwlock_t *mem_lock = &mcfg->memory_hotplug_lock;
 
 	/* Lock before parsing and registering callback to memory subsystem */
-	rte_rwlock_read_lock(mem_lock);
+	rte_eal_mcfg_mem_read_lock();
 
 	if (rte_memseg_walk(fslmc_dmamap_seg, &i) < 0) {
-		rte_rwlock_read_unlock(mem_lock);
+		rte_eal_mcfg_mem_read_unlock();
 		return -1;
 	}
 
@@ -378,7 +376,7 @@  int rte_fslmc_vfio_dmamap(void)
 	/* Existing segments have been mapped and memory callback for hotplug
 	 * has been installed.
 	 */
-	rte_rwlock_read_unlock(mem_lock);
+	rte_eal_mcfg_mem_read_unlock();
 
 	return 0;
 }