[05/25] net/virtio: 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/net/virtio/virtio_user/virtio_user_dev.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
Comments
[PATCH 05/25] net/virtio: use new memory locking API
A minor nit: net/virtio -> net/virtio-user
For the rest,
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
On Wed, May 29, 2019 at 05:30:51PM +0100, 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>
> ---
> drivers/net/virtio/virtio_user/virtio_user_dev.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
[...]
@@ -125,7 +125,6 @@ is_vhost_user_by_type(const char *path)
int
virtio_user_start_device(struct virtio_user_dev *dev)
{
- struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
uint64_t features;
int ret;
@@ -142,7 +141,7 @@ virtio_user_start_device(struct virtio_user_dev *dev)
* replaced when we get proper supports from the
* memory subsystem in the future.
*/
- rte_rwlock_read_lock(&mcfg->memory_hotplug_lock);
+ rte_eal_mcfg_mem_read_lock();
pthread_mutex_lock(&dev->mutex);
if (is_vhost_user_by_type(dev->path) && dev->vhostfd < 0)
@@ -180,12 +179,12 @@ virtio_user_start_device(struct virtio_user_dev *dev)
dev->started = true;
pthread_mutex_unlock(&dev->mutex);
- rte_rwlock_read_unlock(&mcfg->memory_hotplug_lock);
+ rte_eal_mcfg_mem_read_unlock();
return 0;
error:
pthread_mutex_unlock(&dev->mutex);
- rte_rwlock_read_unlock(&mcfg->memory_hotplug_lock);
+ rte_eal_mcfg_mem_read_unlock();
/* TODO: free resource here or caller to check */
return -1;
}