| 356 | } |
| 357 | |
| 358 | int |
| 359 | rte_vdev_uninit(const char *name) |
| 360 | { |
| 361 | struct rte_vdev_device *dev; |
| 362 | int ret; |
| 363 | |
| 364 | if (name == NULL) |
| 365 | return -EINVAL; |
| 366 | |
| 367 | rte_spinlock_recursive_lock(&vdev_device_list_lock); |
| 368 | |
| 369 | dev = find_vdev(name); |
| 370 | if (!dev) { |
| 371 | ret = -ENOENT; |
| 372 | goto unlock; |
| 373 | } |
| 374 | |
| 375 | ret = vdev_remove_driver(dev); |
| 376 | if (ret) |
| 377 | goto unlock; |
| 378 | |
| 379 | TAILQ_REMOVE(&vdev_device_list, dev, next); |
| 380 | rte_devargs_remove(dev->device.devargs); |
| 381 | free(dev); |
| 382 | |
| 383 | unlock: |
| 384 | rte_spinlock_recursive_unlock(&vdev_device_list_lock); |
| 385 | return ret; |
| 386 | } |
| 387 | |
| 388 | struct vdev_param { |
| 389 | #define VDEV_SCAN_REQ 1 |