From f6266b56ecd6bca3074886b37d48cf5c20f37fa3 Mon Sep 17 00:00:00 2001 From: Matthew Smith Date: Mon, 4 Mar 2019 09:43:45 -0600 Subject: 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 --- src/vlib/linux/vmbus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/vlib/linux/vmbus.c') 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 */ -- cgit 1.2.3-korg