summaryrefslogtreecommitdiffstats
path: root/nfvbenchvm
diff options
context:
space:
mode:
Diffstat (limited to 'nfvbenchvm')
-rw-r--r--nfvbenchvm/README.rst28
-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
9 files changed, 47 insertions, 23 deletions
diff --git a/nfvbenchvm/README.rst b/nfvbenchvm/README.rst
index baa6996..1bf0bbf 100644
--- a/nfvbenchvm/README.rst
+++ b/nfvbenchvm/README.rst
@@ -1,4 +1,4 @@
-NFVBENCH VM IMAGE FOR OPENSTACK
+NFVBENCH VM IMAGE FOR OPENSTACK
+++++++++++++++++++++++++++++++
This repo will build a centos 7 image with testpmd and VPP installed.
@@ -18,7 +18,7 @@ Pre-requisites
Build the image
---------------
- cd dib
-- update the version number for the image (if needed) by modifying __version__ in build-image.sh
+- update the version number for the image (if needed) by modifying __version__ in build-image.sh
- setup your http_proxy if needed
- bash build-image.sh
@@ -48,15 +48,17 @@ nfvbenchvm config file is located at ``/etc/nfvbenchvm.conf``.
.. code-block:: bash
- FORWARDER=VPP
- TG_MAC0=00:10:94:00:0A:00
- TG_MAC1=00:11:94:00:0A:00
- VNF1_GATEWAY_CIDR=1.1.0.2/8
- VNF2_GATEWAY_CIDR=2.2.0.2/8
- TG1_NET=10.0.0.0/8
- TG2_NET=20.0.0.0/8
- TG1_GATEWAY_IP=1.1.0.100
- TG1_GATEWAY_IP=2.2.0.100
+ FORWARDER=testpmd
+ INTF_MAC1=FA:16:3E:A2:30:41
+ INTF_MAC2=FA:16:3E:10:DA:10
+ TG_MAC1=00:10:94:00:0A:00
+ TG_MAC2=00:11:94:00:0A:00
+ VNF_GATEWAY1_CIDR=1.1.0.2/8
+ VNF_GATEWAY2_CIDR=2.2.0.2/8
+ TG_NET1=10.0.0.0/8
+ TG_NET2=20.0.0.0/8
+ TG_GATEWAY1_IP=1.1.0.100
+ TG_GATEWAY2_IP=2.2.0.100
Launching nfvbenchvm VM
@@ -79,6 +81,6 @@ To check if VPP is running, you can run this command in VNC console:
Hardcoded Username and Password
--------------------------------
-- Username: nfvbench
-- Password: nfvbench
+- Username: nfvbench
+- Password: nfvbench
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 {