vhost: introduce API to get vDPA device number

It's used to get number of available registered vDPA devices.

Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Xiao Wang <xiao.w.wang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
This commit is contained in:
Xiaolong Ye 2018-09-29 05:47:46 +08:00 committed by Ferruh Yigit
parent 65313f1a82
commit 0e0a7d3801
3 changed files with 10 additions and 0 deletions

View File

@ -84,4 +84,7 @@ rte_vdpa_find_device_id(struct rte_vdpa_dev_addr *addr);
struct rte_vdpa_device * __rte_experimental
rte_vdpa_get_device(int did);
/* Get current available vdpa device number */
int __rte_experimental
rte_vdpa_get_device_num(void);
#endif /* _RTE_VDPA_H_ */

View File

@ -67,6 +67,7 @@ EXPERIMENTAL {
rte_vdpa_unregister_device;
rte_vdpa_find_device_id;
rte_vdpa_get_device;
rte_vdpa_get_device_num;
rte_vhost_driver_attach_vdpa_device;
rte_vhost_driver_detach_vdpa_device;
rte_vhost_driver_get_vdpa_device_id;

View File

@ -113,3 +113,9 @@ rte_vdpa_get_device(int did)
return vdpa_devices[did];
}
int
rte_vdpa_get_device_num(void)
{
return vdpa_device_num;
}