aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk/device/common.c
diff options
context:
space:
mode:
authorVladimir Ratnikov <vratnikov@netgate.com>2020-11-11 08:00:48 -0500
committerMatthew Smith <mgsmith@netgate.com>2021-01-11 20:40:23 +0000
commit9822729742168c877a301ff50a3a1067b90a89ad (patch)
tree6060722a9b4f72282e78e5076f759a42c9e1d3d7 /src/plugins/dpdk/device/common.c
parentdcacdc4fd90d6cc71aaafccbca3ea91c7481ddbd (diff)
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 <vratnikov@netgate.com> Change-Id: Id82611e54fed082190e488c7e5fbe14ecbe5b2ab
Diffstat (limited to 'src/plugins/dpdk/device/common.c')
-rw-r--r--src/plugins/dpdk/device/common.c13
1 files changed, 13 insertions, 0 deletions
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
*