summaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk/device/init.c
diff options
context:
space:
mode:
authorStephen Hemminger <stephen@networkplumber.org>2018-10-15 12:52:30 -0700
committerDamjan Marion <damarion@cisco.com>2018-12-19 08:34:39 +0100
commit6fbef2322870bbe1768537caecc3ca06bfd70dd7 (patch)
tree9c588f17b05d5bedf57b7207694d3e92136a4cbd /src/plugins/dpdk/device/init.c
parentb0b9dadc5c57b96ed43427ca78430e52fed9196e (diff)
vlib: support Hyper-v/Azure VMBus
This patch adds support for VMBus to the VPP infrastructure. Since the only device that matters is the netvsc Poll Mode Driver in DPDK, the infrastructure is much simpler than PCI. Change-Id: Ie96c897ad9c426716c2398e4528688ce2217419b Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Diffstat (limited to 'src/plugins/dpdk/device/init.c')
-rw-r--r--src/plugins/dpdk/device/init.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c
index c0a927acae5..c5c98ab3359 100644
--- a/src/plugins/dpdk/device/init.c
+++ b/src/plugins/dpdk/device/init.c
@@ -24,6 +24,7 @@
#include <vnet/ethernet/ethernet.h>
#include <dpdk/device/dpdk.h>
#include <vlib/pci/pci.h>
+#include <vlib/vmbus/vmbus.h>
#include <rte_ring.h>
@@ -973,6 +974,27 @@ dpdk_bind_devices_to_uio (dpdk_config_main_t * conf)
vlib_pci_free_device_info (d);
}
+static void
+dpdk_bind_vmbus_devices_to_uio (dpdk_config_main_t * conf)
+{
+ clib_error_t *error;
+ vlib_vmbus_addr_t *addrs, *addr = 0;
+
+ addrs = vlib_vmbus_get_all_dev_addrs ();
+
+ /* *INDENT-OFF* */
+ vec_foreach (addr, addrs)
+ {
+ error = vlib_vmbus_bind_to_uio (addr);
+
+ if (error)
+ {
+ clib_error_report (error);
+ }
+ }
+ /* *INDENT-ON* */
+}
+
static clib_error_t *
dpdk_device_config (dpdk_config_main_t * conf, vlib_pci_addr_t pci_addr,
unformat_input_t * input, u8 is_default)
@@ -1121,6 +1143,7 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input)
int ret, i;
int num_whitelisted = 0;
u8 no_pci = 0;
+ u8 no_vmbus = 0;
u8 no_huge = 0;
u8 huge_dir = 0;
u8 file_prefix = 0;
@@ -1214,6 +1237,12 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input)
vec_add1 (conf->blacklist_by_pci_vendor_and_device,
blacklist_entry);
}
+ else if (unformat (input, "no-vmbus"))
+ {
+ no_vmbus = 1;
+ tmp = format (0, "--no-vmbus%c", 0);
+ vec_add1 (conf->eal_init_args, tmp);
+ }
#define _(a) \
else if (unformat(input, #a)) \
@@ -1417,6 +1446,9 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input)
if (no_pci == 0 && geteuid () == 0)
dpdk_bind_devices_to_uio (conf);
+ if (no_vmbus == 0 && geteuid () == 0)
+ dpdk_bind_vmbus_devices_to_uio (conf);
+
#define _(x) \
if (devconf->x == 0 && conf->default_devconf.x > 0) \
devconf->x = conf->default_devconf.x ;