[jump vnet] Workaround MTU set race condition 87/61487/4
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Tue, 28 Aug 2018 22:00:26 +0000 (00:00 +0200)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Tue, 28 Aug 2018 23:26:08 +0000 (01:26 +0200)
Older libvirt (1.x, 2.x, even older 3.x) try to enforce their own MTU
(1500), overriding it back to 1500 after the udev rule finished.
Delay link modification with 1 second and extend its patten to also
include libvirt's own tap interfaces (<network name>-nic).

Change-Id: I3050c11de7f376df02cbf203e9106b61c560683f
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
mcp/scripts/lib.sh

index 016af2b..d7af97c 100644 (file)
@@ -550,8 +550,10 @@ function wait_for {
 function do_udev_cfg {
   local _conf='/etc/udev/rules.d/99-opnfv-fuel-vnet-mtu.rules'
   # http://linuxaleph.blogspot.com/2013/01/how-to-network-jumbo-frames-to-kvm-guest.html
-  echo 'SUBSYSTEM=="net", ACTION=="add|change", KERNEL=="vnet*", ATTR{mtu}="9000"' |& sudo tee "${_conf}"
-  sudo udevadm control --reload || true
+  echo 'SUBSYSTEM=="net", ACTION=="add|change", KERNEL=="vnet*", RUN+="/bin/sh -c '"'/bin/sleep 1; /sbin/ip link set %k mtu 9000'\"" |& sudo tee "${_conf}"
+  echo 'SUBSYSTEM=="net", ACTION=="add|change", KERNEL=="*-nic", RUN+="/bin/sh -c '"'/bin/sleep 1; /sbin/ip link set %k mtu 9000'\"" |& sudo tee -a "${_conf}"
+  sudo udevadm control --reload
+  sudo udevadm trigger
 }
 
 function do_sysctl_cfg {