X-Git-Url: http://git.droids-corp.org/?p=dpdk.git;a=blobdiff_plain;f=lib%2Flibrte_vhost%2Frte_vdpa.h;h=b752dfeb96aadfa84d12f7cbf985bc560a3cc8a5;hp=ecb3d911d060d6e6b394cca7eead1d5cab6870dc;hb=38f8ab0bbc8d14066ebafec2b70583092328a5ab;hpb=383fb5a9c7f86931720a389335268b32fb9373a5 diff --git a/lib/librte_vhost/rte_vdpa.h b/lib/librte_vhost/rte_vdpa.h index ecb3d911d0..b752dfeb96 100644 --- a/lib/librte_vhost/rte_vdpa.h +++ b/lib/librte_vhost/rte_vdpa.h @@ -18,25 +18,6 @@ #define MAX_VDPA_NAME_LEN 128 -enum vdpa_addr_type { - VDPA_ADDR_PCI, - VDPA_ADDR_MAX -}; - -/** - * vdpa device address - */ -struct rte_vdpa_dev_addr { - /** vdpa address type */ - enum vdpa_addr_type type; - - /** vdpa pci address */ - union { - uint8_t __dummy[64]; - struct rte_pci_addr pci_addr; - }; -}; - /** Maximum name length for statistics counters */ #define RTE_VDPA_STATS_NAME_SIZE 64 @@ -120,8 +101,8 @@ struct rte_vdpa_dev_ops { * vdpa device structure includes device address and device operations. */ struct rte_vdpa_device { - /** vdpa device address */ - struct rte_vdpa_dev_addr addr; + /** Generic device information */ + struct rte_device *device; /** vdpa device operations */ struct rte_vdpa_dev_ops *ops; } __rte_cache_aligned; @@ -141,7 +122,7 @@ struct rte_vdpa_device { */ __rte_experimental int -rte_vdpa_register_device(struct rte_vdpa_dev_addr *addr, +rte_vdpa_register_device(struct rte_device *rte_dev, struct rte_vdpa_dev_ops *ops); /** @@ -159,6 +140,21 @@ __rte_experimental int rte_vdpa_unregister_device(int did); +/** + * @warning + * @b EXPERIMENTAL: this API may change without prior notice + * + * Find the device id of a vdpa device from its name + * + * @param name + * the vdpa device name + * @return + * device id on success, -1 on failure + */ +__rte_experimental +int +rte_vdpa_find_device_id_by_name(const char *name); + /** * @warning * @b EXPERIMENTAL: this API may change without prior notice @@ -172,7 +168,7 @@ rte_vdpa_unregister_device(int did); */ __rte_experimental int -rte_vdpa_find_device_id(struct rte_vdpa_dev_addr *addr); +rte_vdpa_find_device_id(struct rte_vdpa_device *dev); /** * @warning