vhost: introduce API to get vDPA device number
authorXiaolong Ye <xiaolong.ye@intel.com>
Fri, 28 Sep 2018 21:47:46 +0000 (05:47 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 11 Oct 2018 16:53:49 +0000 (18:53 +0200)
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>
lib/librte_vhost/rte_vdpa.h
lib/librte_vhost/rte_vhost_version.map
lib/librte_vhost/vdpa.c

index 90465ca..b8223e3 100644 (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_ */
index da220dd..ae39b6e 100644 (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;
index c82fd43..c2c5dff 100644 (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;
+}