From e4095ec00b9deb968bedfb201c0af12a168a3375 Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Wed, 29 Aug 2018 00:00:26 +0200 Subject: [PATCH] [jump vnet] Workaround MTU set race condition 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 (-nic). Change-Id: I3050c11de7f376df02cbf203e9106b61c560683f Signed-off-by: Alexandru Avadanii --- mcp/scripts/lib.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mcp/scripts/lib.sh b/mcp/scripts/lib.sh index 016af2bcb..d7af97c9b 100644 --- a/mcp/scripts/lib.sh +++ b/mcp/scripts/lib.sh @@ -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 { -- 2.16.6