diff -Nru libvirt-4.6.0/debian/changelog libvirt-4.6.0/debian/changelog --- libvirt-4.6.0/debian/changelog 2018-08-27 02:57:57.000000000 -0600 +++ libvirt-4.6.0/debian/changelog 2018-09-26 16:53:09.000000000 -0600 @@ -1,3 +1,11 @@ +libvirt (4.6.0-2ubuntu3+lp1771662.1) cosmic; urgency=medium + + * d/p/ubuntu/cavium-thunderx-no-switchdev.patch: avoid trying + to form a VF-to-PF mapping on Cavium ThunderX NICs based on + assumptions from other devices. + + -- dann frazier Wed, 26 Sep 2018 16:53:09 -0600 + libvirt (4.6.0-2ubuntu3) cosmic; urgency=medium * d/p/ubuntu-aa/lp-1788603-fix-ptrace-rules-with-kernel-4.18.patch: diff -Nru libvirt-4.6.0/debian/patches/series libvirt-4.6.0/debian/patches/series --- libvirt-4.6.0/debian/patches/series 2018-08-27 02:56:53.000000000 -0600 +++ libvirt-4.6.0/debian/patches/series 2018-09-26 15:28:51.000000000 -0600 @@ -42,6 +42,7 @@ ubuntu/dnsmasq-as-priv-user ubuntu/avoid-restarting-virtlog-socket.patch ubuntu/ovmf_paths.patch +ubuntu/cavium-thunderx-no-switchdev.patch # Ubuntu Apparmor Changes ubuntu-aa/0001-apparmor-Allow-pygrub-to-run-on-Debian-Ubuntu.patch diff -Nru libvirt-4.6.0/debian/patches/ubuntu/cavium-thunderx-no-switchdev.patch libvirt-4.6.0/debian/patches/ubuntu/cavium-thunderx-no-switchdev.patch --- libvirt-4.6.0/debian/patches/ubuntu/cavium-thunderx-no-switchdev.patch 1969-12-31 17:00:00.000000000 -0700 +++ libvirt-4.6.0/debian/patches/ubuntu/cavium-thunderx-no-switchdev.patch 2018-09-26 16:53:09.000000000 -0600 @@ -0,0 +1,63 @@ +Description: Ignore on-chip Cavium ThunderX in switchdev check + libvirt assumes that the kernel will expose a VF->PF mapping + that is not exposed for this driver/device due to its unique + architecture. Just bypass these devices until there's a proper + fix upstream. +Forwarded: no +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1771662 +Bug-Linaro: https://bugs.linaro.org/show_bug.cgi?id=3778 +Author: dann frazier +Last-Updated: 2018-09-26 + +Index: libvirt-4.6.0/src/util/virnetdev.c +=================================================================== +--- libvirt-4.6.0.orig/src/util/virnetdev.c ++++ libvirt-4.6.0/src/util/virnetdev.c +@@ -3242,6 +3242,37 @@ virNetDevGetFamilyId(const char *family_ + return family_id; + } + ++static bool ++virNetDevSwitchdevFeatureUnsupported(const char *ifname) ++{ ++ int ret = false; ++ int len; ++ char *path = NULL; ++ char *id = NULL; ++ const char cavium_vendor[] = "0x177d\n"; ++ const char cavium_device[] = "0xa034\n"; ++ ++ if (virNetDevSysfsFile(&path, ifname, "device/vendor") < 0) ++ goto cleanup; ++ if ((len = virFileReadAllQuiet(path, 1024, &id)) <= 0) ++ goto cleanup; ++ if (strcmp(cavium_vendor, id) != 0) ++ goto cleanup; ++ VIR_FREE(path); ++ if (virNetDevSysfsFile(&path, ifname, "device/device") < 0) ++ goto cleanup; ++ VIR_FREE(id); ++ if ((len = virFileReadAllQuiet(path, 1024, &id)) <= 0) ++ goto cleanup; ++ if (strcmp(cavium_device, id) != 0) ++ goto cleanup; ++ ret = true; ++ ++ cleanup: ++ VIR_FREE(path); ++ VIR_FREE(id); ++ return ret; ++} + + /** + * virNetDevSwitchdevFeature +@@ -3269,6 +3300,9 @@ virNetDevSwitchdevFeature(const char *if + int ret = -1; + uint32_t family_id; + ++ if (virNetDevSwitchdevFeatureUnsupported(ifname)) ++ return 0; ++ + if ((family_id = virNetDevGetFamilyId(DEVLINK_GENL_NAME)) <= 0) + return ret; +