summaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk/device/dpdk.h
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/dpdk.h
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/dpdk.h')
-rw-r--r--src/plugins/dpdk/device/dpdk.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/plugins/dpdk/device/dpdk.h b/src/plugins/dpdk/device/dpdk.h
index c81f23d769c..504bac5b6ee 100644
--- a/src/plugins/dpdk/device/dpdk.h
+++ b/src/plugins/dpdk/device/dpdk.h
@@ -32,6 +32,7 @@
#include <rte_per_lcore.h>
#include <rte_interrupts.h>
#include <rte_pci.h>
+#include <rte_bus_vmbus.h>
#include <rte_ether.h>
#include <rte_ethdev.h>
#include <rte_ring.h>
@@ -52,6 +53,7 @@
#endif
#include <vlib/pci/pci.h>
+#include <vlib/vmbus/vmbus.h>
#include <vnet/flow/flow.h>
extern vnet_device_class_t dpdk_device_class;
@@ -250,9 +252,21 @@ typedef struct
_ (num_tx_desc) \
_ (rss_fn)
+typedef enum
+{
+ VNET_DEV_ADDR_PCI,
+ VNET_DEV_ADDR_VMBUS,
+ VNET_DEV_ADDR_ANY,
+} dpdk_device_addr_type_t;
+
typedef struct
{
- vlib_pci_addr_t pci_addr;
+ union
+ {
+ vlib_pci_addr_t pci_addr;
+ vlib_vmbus_addr_t vmbus_addr;
+ };
+ dpdk_device_addr_type_t dev_addr_type;
u8 *name;
u8 is_blacklisted;
u8 vlan_strip_offload;
@@ -302,9 +316,12 @@ typedef struct
dpdk_device_config_t default_devconf;
dpdk_device_config_t *dev_confs;
uword *device_config_index_by_pci_addr;
+ uword *device_config_index_by_vmbus_addr;
/* devices blacklist by pci vendor_id, device_id */
u32 *blacklist_by_pci_vendor_and_device;
+ /* devices blacklist by VMBUS address */
+ u32 *blacklist_by_vmbus_addr;
} dpdk_config_main_t;
@@ -459,6 +476,8 @@ clib_error_t *unformat_rss_fn (unformat_input_t * input, uword * rss_fn);
struct rte_pci_device *dpdk_get_pci_device (const struct rte_eth_dev_info
*info);
+struct rte_vmbus_device *
+dpdk_get_vmbus_device (const struct rte_eth_dev_info *info);
void dpdk_cli_reference (void);
#if CLI_DEBUG