summaryrefslogtreecommitdiffstats
path: root/src/vlib/linux/vmbus.c
diff options
context:
space:
mode:
authorMatthew Smith <mgsmith@netgate.com>2019-03-04 09:43:45 -0600
committerDamjan Marion <dmarion@me.com>2019-03-06 11:40:21 +0000
commitf6266b56ecd6bca3074886b37d48cf5c20f37fa3 (patch)
treea63689a57a4c142d7afed710d24f6305b20b15d8 /src/vlib/linux/vmbus.c
parenta79271fad186e806060e73131d9128bd9d7ea6a4 (diff)
vmbus: fix bug that breaks multiple netvsc vdevs
VPP supports two DPDK drivers for managing netvsc devices on Azure/Hyper-V. The new netvsc PMD looks a lot like other PCI-based PMDs but it requires recently added kernel support (>=4.17). The older vdev_netvsc is an abstraction that manages the mlx4 VF and tap device underlying the netvsc interface using the failsafe PMD. Distros with older kernels (e.g. RHEL/CentOS 7.x) have to use vdev_netvsc. At startup, netvsc devices are processed and an attempt is made to initialize them for management by the netvsc PMD. If that fails, then vlib_vmbus_bind_to_uio() returns early and the device can be initialized for management by vdev_netvsc. The operation that is supposed to fail if the netvsc PMD cannot be used is registration of the netvsc device type ID with the uio_hv_generic driver. This operation is attempted exactly once so it does not fail for netvsc devices processed after the first one and they end up in a state where they cannot be initialized for use by vdev_netvsc. Only unset uio_new_id_needed if uio_hv_generic registration succeeds. Change-Id: I6be925d422b87ed24e0f4611304cc3a6b07a34fd Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Diffstat (limited to 'src/vlib/linux/vmbus.c')
-rw-r--r--src/vlib/linux/vmbus.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vlib/linux/vmbus.c b/src/vlib/linux/vmbus.c
index c1d8eb9b715..2dba8025326 100644
--- a/src/vlib/linux/vmbus.c
+++ b/src/vlib/linux/vmbus.c
@@ -287,8 +287,6 @@ vlib_vmbus_bind_to_uio (vlib_vmbus_addr_t * addr)
/* tell uio_hv_generic about netvsc device type */
if (uio_new_id_needed)
{
- uio_new_id_needed = 0;
-
vec_reset_length (s);
s = format (s, "%s/%s/new_id%c", sysfs_vmbus_drv_path, uio_drv_name, 0);
error = clib_sysfs_write ((char *) s, "%s", netvsc_uuid);
@@ -296,6 +294,8 @@ vlib_vmbus_bind_to_uio (vlib_vmbus_addr_t * addr)
if (error)
goto done;
+ uio_new_id_needed = 0;
+
}
/* prefer the simplier driver_override model */