aboutsummaryrefslogtreecommitdiffstats
path: root/resources
diff options
context:
space:
mode:
Diffstat (limited to 'resources')
-rwxr-xr-xresources/tools/disk-image-builder/nested/image-patches/06-dpdk-support12
-rwxr-xr-x[-rw-r--r--]resources/tools/disk-image-builder/nested/image-patches/07-isolate-cpu8
2 files changed, 16 insertions, 4 deletions
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 fb166ef2cf..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,10 +52,20 @@ 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.
diff --git a/resources/tools/disk-image-builder/nested/image-patches/07-isolate-cpu b/resources/tools/disk-image-builder/nested/image-patches/07-isolate-cpu
index 72d94160be..401966deac 100644..100755
--- a/resources/tools/disk-image-builder/nested/image-patches/07-isolate-cpu
+++ b/resources/tools/disk-image-builder/nested/image-patches/07-isolate-cpu
@@ -1,8 +1,8 @@
#!/bin/sh
patch boot/grub/menu.lst <<"_EOF"
-15c17
-< kernel /boot/bzImage rw root=/dev/sda1 console=ttyS0,115200n8
+17c17
+< kernel /boot/bzImage rw root=/dev/sda1 ipv6.disable=1 console=ttyS0,115200n8
---
-> kernel /boot/bzImage rw root=/dev/sda1 console=ttyS0,115200n8 isolcpus=1-7 nohz_full=1-7 rcu_nocbs=1-7
-_EOF \ No newline at end of file
+> kernel /boot/bzImage rw root=/dev/sda1 ipv6.disable=1 console=ttyS0,115200n8 isolcpus=1,2,3,4 nohz_full=1,2,3,4 rcu_nocbs=1,2,3,4 intel_pstate=disable
+_EOF