X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Ftools%2Fdisk-image-builder%2Fnested%2Fimage-patches%2F06-dpdk-support;h=5990f0925bc08888d0e80a29ea79422259821f00;hb=refs%2Fchanges%2F48%2F4148%2F7;hp=99ac0e14e3d19c4a7dce17ba6ef8b4a21c8f9298;hpb=bb847371cf77f1fac6579d0444d6168b5b43c2a0;p=csit.git diff --git a/resources/tools/disk-image-builder/nested/image-patches/06-dpdk-support b/resources/tools/disk-image-builder/nested/image-patches/06-dpdk-support index 99ac0e14e3..5990f0925b 100755 --- a/resources/tools/disk-image-builder/nested/image-patches/06-dpdk-support +++ b/resources/tools/disk-image-builder/nested/image-patches/06-dpdk-support @@ -34,6 +34,8 @@ fi # Set up hugepages echo "vm.nr_hugepages = ${NUM_HUGEPAGES}" > /etc/sysctl.conf +echo "vm.swappiness = 0" >> /etc/sysctl.conf +echo "kernel.randomize_va_space = 0" >> /etc/sysctl.conf sysctl -p mkdir -p /mnt/huge grep -q hugetlbfs /etc/fstab || echo "hugetlbfs /mnt/huge hugetlbfs mode=1770,gid=2021 0 0" >> /etc/fstab @@ -50,6 +52,21 @@ do echo $dev > /sys/bus/pci/drivers/${TARGET_DRIVER}/bind done +# RCU and IRQ affinity +for i in $(ls /proc/irq/ | grep [0-9]) +do + echo 1 > /proc/irq/$i/smp_affinity +done +echo 1 | sudo tee /sys/bus/workqueue/devices/writeback/cpumask + +# There is a bug causing packet loss when VM is initialized. This workaround is +# supposed to re-initialize CPUs. +for i in $(ls -d /sys/devices/system/cpu/cpu[1-9]/online); do + echo 0 | sudo tee $i + sleep 2 + echo 1 | sudo tee $i +done + # Start testpmd in the background. This looks a bit convoluted; we need to redirect stdin # (and keep stdin active) or else testpmd will quit. tail -f /dev/null | nohup testpmd $@ > ${TESTPMD_LOG} 2>&1 &