[02/25] bus/fslmc: use new memory locking API
Checks
Commit Message
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
> -----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>
@@ -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;
}