summaryrefslogtreecommitdiffstats
path: root/nfvbenchvm/dib
diff options
context:
space:
mode:
authorYichen Wang <yicwang@cisco.com>2017-11-22 16:26:29 -0800
committerYichen Wang <yicwang@cisco.com>2017-11-24 01:52:53 -0800
commit1ce98c7510f810a5ee790523a0dcbf429961adda (patch)
treed29558354fdef0b51a1487fa67ad15022a1c1ad4 /nfvbenchvm/dib
parent58d63a026082a7e3207e409d51e919f959627e56 (diff)
Add support to use vswitch to handle V2V in PVVP SRIOV scenario
1. Add support to use vswitch to handle V2V in PVVP SRIOV scenario 2. Update nfvbenchvm to 0.5: (1) Update VPP to 17.10; (2) Update DPDK testpmd to 17.08; (3) Change kernel to based on longterm lineup; Change-Id: I944489579a4cd92d17075e80870bbdb32512a150 Signed-off-by: Yichen Wang <yicwang@cisco.com>
Diffstat (limited to 'nfvbenchvm/dib')
-rwxr-xr-xnfvbenchvm/dib/build-image.sh2
-rw-r--r--nfvbenchvm/dib/elements/nfvbenchvm/fdio-release.repo2
-rw-r--r--nfvbenchvm/dib/elements/nfvbenchvm/package-installs.yaml2
-rwxr-xr-xnfvbenchvm/dib/elements/nfvbenchvm/post-install.d/01-update-kernel2
-rwxr-xr-xnfvbenchvm/dib/elements/nfvbenchvm/post-install.d/02-testpmd-script5
-rwxr-xr-xnfvbenchvm/dib/elements/nfvbenchvm/post-install.d/99-cleanup2
-rw-r--r--nfvbenchvm/dib/elements/nfvbenchvm/static/etc/rc.d/rc.local25
-rw-r--r--nfvbenchvm/dib/elements/nfvbenchvm/static/vpp/startup.conf2
8 files changed, 32 insertions, 10 deletions
diff --git a/nfvbenchvm/dib/build-image.sh b/nfvbenchvm/dib/build-image.sh
index 9326762..605db54 100755
--- a/nfvbenchvm/dib/build-image.sh
+++ b/nfvbenchvm/dib/build-image.sh
@@ -11,7 +11,7 @@ set -e
gs_url=artifacts.opnfv.org/nfvbench/images
# image version number
-__version__=0.4
+__version__=0.5
image_name=nfvbenchvm_centos-$__version__
# if image exists skip building
diff --git a/nfvbenchvm/dib/elements/nfvbenchvm/fdio-release.repo b/nfvbenchvm/dib/elements/nfvbenchvm/fdio-release.repo
index a26aa42..3ad12fb 100644
--- a/nfvbenchvm/dib/elements/nfvbenchvm/fdio-release.repo
+++ b/nfvbenchvm/dib/elements/nfvbenchvm/fdio-release.repo
@@ -1,5 +1,5 @@
[fdio-release]
name=fd.io release branch latest merge
-baseurl=https://nexus.fd.io/content/repositories/fd.io.stable.1707.centos7/
+baseurl=https://nexus.fd.io/content/repositories/fd.io.stable.1710.centos7/
enabled=1
gpgcheck=0
diff --git a/nfvbenchvm/dib/elements/nfvbenchvm/package-installs.yaml b/nfvbenchvm/dib/elements/nfvbenchvm/package-installs.yaml
index 36e0196..e3184c7 100644
--- a/nfvbenchvm/dib/elements/nfvbenchvm/package-installs.yaml
+++ b/nfvbenchvm/dib/elements/nfvbenchvm/package-installs.yaml
@@ -6,6 +6,8 @@ screen:
telnet:
python-devel:
libyaml-devel:
+numactl-libs:
+numactl-devel:
vpp:
vpp-plugins:
kernel-firmware:
diff --git a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/01-update-kernel b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/01-update-kernel
index d884f79..8094006 100755
--- a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/01-update-kernel
+++ b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/01-update-kernel
@@ -8,7 +8,7 @@ fi
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
yum remove -y kernel-firmware kernel-headers kernel-devel
-yum install -y --enablerepo=elrepo-kernel kernel-ml kernel-ml-headers kernel-ml-devel
+yum install -y --enablerepo=elrepo-kernel kernel-lt kernel-lt-headers kernel-lt-devel
# gcc will be removed with old kernel as dependency, so reinstalling it back
yum install -y gcc
diff --git a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/02-testpmd-script b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/02-testpmd-script
index acdc6a3..2136c3a 100755
--- a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/02-testpmd-script
+++ b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/02-testpmd-script
@@ -1,7 +1,7 @@
#!/bin/bash
-DPDK=dpdk-17.05.2
-DPDK_UNTAR=dpdk-stable-17.05.2
+DPDK=dpdk-17.08
+DPDK_UNTAR=dpdk-17.08
# pick up the kernel version for the target image
kernel_version=`ls -t /lib/modules | awk 'NR==1 {print}'`
@@ -19,6 +19,7 @@ cp usertools/dpdk-devbind.py ../dpdk
# cp tools/dpdk_nic_bind.py ../dpdk/dpdk-devbind.py
cp x86_64-native-linuxapp-gcc/app/testpmd ../dpdk
cp x86_64-native-linuxapp-gcc/kmod/igb_uio.ko ../dpdk
+echo "set promisc all off" > /dpdk/testpmd_cmd.txt
cd ..
rm -f $DPDK.tar.xz
diff --git a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/99-cleanup b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/99-cleanup
index 83d4fc5..14e9f27 100755
--- a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/99-cleanup
+++ b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/99-cleanup
@@ -1,3 +1,3 @@
#!/bin/bash
-yum erase -y python-devel libyaml-devel kernel-devel kernel-headers kernel-ml-headers kernel-ml-devel gcc
+yum erase -y python-devel libyaml-devel numactl-devel kernel-devel kernel-headers kernel-lt-headers kernel-lt-devel gcc
diff --git a/nfvbenchvm/dib/elements/nfvbenchvm/static/etc/rc.d/rc.local b/nfvbenchvm/dib/elements/nfvbenchvm/static/etc/rc.d/rc.local
index 596cfdb..8aab1ae 100644
--- a/nfvbenchvm/dib/elements/nfvbenchvm/static/etc/rc.d/rc.local
+++ b/nfvbenchvm/dib/elements/nfvbenchvm/static/etc/rc.d/rc.local
@@ -34,6 +34,25 @@ for irq in `ls /proc/irq/`; do
done
tuna -c $(seq -s, 1 1 $WORKER_CORES) --isolate
+# Sometimes the interfaces on the loopback VM will use different drivers, e.g.
+# one from vswitch which is virtio based, one is from SRIOV VF. In this case,
+# we have to make sure the forwarder uses them in the right order, which is
+# especially important if the VM is in a PVVP chain.
+if [ -z $INTF_MAC1 ] && [ -z $INTF_MAC2 ]; then
+ NET_PATH=/sys/class/net
+ EXP_INTF_1=$(for f in $(ls $NET_PATH/); do if [ ! $(grep -o "$INTF_MAC1" $NET_PATH/$f/address) ]; then break; fi; done)
+ EXP_PCI_ADDRESS_1=$(basename $(readlink $NET_PATH/$EXP_INTF_1/device))
+ EXP_INTF_2=$(for f in $(ls $NET_PATH/); do if [ ! $(grep -o "$INTF_MAC2" $NET_PATH/$f/address) ]; then break; fi; done)
+ EXP_PCI_ADDRESS_2=$(basename $(readlink $NET_PATH/$EXP_INTF_2/device))
+ if [ "$PCI_ADDRESS_1" == "$EXP_PCI_ADDRESS_2" ] && [ "$PCI_ADDRESS_2" == "$EXP_PCI_ADDRESS_1" ]; then
+ # Interfaces are not coming in the expected order:
+ # (1) Swap the MAC in the case of testpmd;
+ # (2) Swap the interface order in the case of VPP;
+ TEMP=$PCI_ADDRESS_1; PCI_ADDRESS_1=$PCI_ADDRESS_2; PCI_ADDRESS_2=$TEMP
+ TEMP=$TG_MAC1; TG_MAC1=$TG_MAC2; TG_MAC2=$TEMP
+ fi
+fi
+
# Configure the forwarder
if [ "$FORWARDER" == "testpmd" ]; then
echo "Configuring testpmd..."
@@ -56,8 +75,9 @@ if [ "$FORWARDER" == "testpmd" ]; then
--eth-peer=0,$TG_MAC1 \
--eth-peer=1,$TG_MAC2 \
--forward-mode=mac \
- --nb-cores=$WORKER_CORES\
- --max-pkt-len 9000
+ --nb-cores=$WORKER_CORES \
+ --max-pkt-len=9000 \
+ --cmdline-file=/dpdk/testpmd_cmd.txt
else
echo "Configuring vpp..."
cp /vpp/startup.conf /etc/vpp/startup.conf
@@ -81,6 +101,5 @@ else
sed -i "s/{{TG_NET2}}/${TG_NET2//\//\/}/g" /etc/vpp/vm.conf
sed -i "s/{{TG_GATEWAY1_IP}}/${TG_GATEWAY1_IP}/g" /etc/vpp/vm.conf
sed -i "s/{{TG_GATEWAY2_IP}}/${TG_GATEWAY2_IP}/g" /etc/vpp/vm.conf
-
service vpp restart
fi
diff --git a/nfvbenchvm/dib/elements/nfvbenchvm/static/vpp/startup.conf b/nfvbenchvm/dib/elements/nfvbenchvm/static/vpp/startup.conf
index 811eee1..4306fe9 100644
--- a/nfvbenchvm/dib/elements/nfvbenchvm/static/vpp/startup.conf
+++ b/nfvbenchvm/dib/elements/nfvbenchvm/static/vpp/startup.conf
@@ -3,7 +3,7 @@ unix {
log /tmp/vpp.log
full-coredump
startup-config /etc/vpp/vm.conf
- cli-listen localhost:5002
+ cli-listen /run/vpp/cli.sock
}
api-trace {