From 9822729742168c877a301ff50a3a1067b90a89ad Mon Sep 17 00:00:00 2001 From: Vladimir Ratnikov Date: Wed, 11 Nov 2020 08:00:48 -0500 Subject: dpdk: allow configure individual VMBUS devices now startup.conf supports confuguration for VMBUS devices as for PCI devices for whitelisting/blacklisting dpdk { dev fa5a6e7a-cf3a-4b98-9569-addb479b84bc } with sub-configuration as for PCI devices dpdk { blacklist fa5a6e7a-cf3a-4b98-9569-addb479b84bc } where fa5a6e7a-cf3a-4b98-9569-addb479b84bc - example of UUID struct vlib_vmbus_addr_t changed to union with UUID described fields Added device_config_index_by_vmbus_addr blacklist_by_vmbus_addr to enumerate available device configs hash_key is as_u32[0] field(last 4 bytes of UUID) Lost of precision against full UUID, but 2^32 is enough to handle all the devices available Added is_blacklisted check while creating vnet devices in order to supress creation of dev if it's blacklisted Type: feature Signed-off-by: Vladimir Ratnikov Change-Id: Id82611e54fed082190e488c7e5fbe14ecbe5b2ab --- src/plugins/dpdk/device/common.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/plugins/dpdk/device/common.c') diff --git a/src/plugins/dpdk/device/common.c b/src/plugins/dpdk/device/common.c index 0c43bfe02bb..2521abde97a 100644 --- a/src/plugins/dpdk/device/common.c +++ b/src/plugins/dpdk/device/common.c @@ -260,6 +260,19 @@ dpdk_get_pci_device (const struct rte_eth_dev_info *info) return NULL; } +/* If this device is VMBUS return pointer to info, otherwise NULL */ +struct rte_vmbus_device * +dpdk_get_vmbus_device (const struct rte_eth_dev_info *info) +{ + const struct rte_bus *bus; + + bus = rte_bus_find_by_device (info->device); + if (bus && !strcmp (bus->name, "vmbus")) + return container_of (info->device, struct rte_vmbus_device, device); + else + return NULL; +} + /* * fd.io coding-style-patch-verification: ON * -- cgit 1.2.3-korg