summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcommon/scripts/netmap-pkt-gen/find_nics.sh16
-rwxr-xr-xcommon/scripts/netmap-pkt-gen/parse-tx-rx.sh9
-rwxr-xr-xcommon/scripts/netmap-pkt-gen/start-pkt-gen.sh13
-rwxr-xr-xcommon/scripts/odp-ovs/ovs-odp-dpdk-nic-bind-82599.sh7
-rw-r--r--ubuntu/netmap-pkt-gen-multinode.yaml90
-rw-r--r--ubuntu/ovs-odp-dpdk-server-multinode.yaml100
6 files changed, 235 insertions, 0 deletions
diff --git a/common/scripts/netmap-pkt-gen/find_nics.sh b/common/scripts/netmap-pkt-gen/find_nics.sh
new file mode 100755
index 0000000..b85b4e7
--- /dev/null
+++ b/common/scripts/netmap-pkt-gen/find_nics.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+# This script looks for all network interfaces of a certain type given by
+# NIC_PATTERN. It uses lspci to get the pci ids of the matching NICs and then
+# tries to find the network interfaces (ethx) associated with them. For this
+# the appropriate drivers must be available in the system.
+
+test $# -lt 1 && echo "Please pass NIC pattern" && exit 1
+NIC=$1
+
+truncate -s 0 pci_ids
+truncate -s 0 sys_net
+truncate -s 0 ifs
+lspci -nn | grep -i $NIC | awk '{print $1}' > pci_ids
+for i in $(ls /sys/class/net/); do ln=$(readlink -f /sys/class/net/$i/device); echo $i $ln >> sys_net; done
+for i in $(cat pci_ids); do cat sys_net | grep $i | awk '{print $1}' >> ifs; done
diff --git a/common/scripts/netmap-pkt-gen/parse-tx-rx.sh b/common/scripts/netmap-pkt-gen/parse-tx-rx.sh
new file mode 100755
index 0000000..a133c81
--- /dev/null
+++ b/common/scripts/netmap-pkt-gen/parse-tx-rx.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+# This script parses the output from netmap and transforms it into something
+# usable by common/script/min_max_avg_parse.py
+# Sample command: parse-tx-rx.sh tx.in tx.out rx.in rx.out
+
+test $# -lt 4 && echo "Please pass input and output files" && exit 1
+cat $1 | grep main_thread | grep pps | awk '{print "tx_throughput: " $4}' > $2
+cat $3 | grep main_thread | grep pps | awk '{print "rx_throughput: " $4}' > $4
diff --git a/common/scripts/netmap-pkt-gen/start-pkt-gen.sh b/common/scripts/netmap-pkt-gen/start-pkt-gen.sh
new file mode 100755
index 0000000..5f03a72
--- /dev/null
+++ b/common/scripts/netmap-pkt-gen/start-pkt-gen.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+# This script start netmap pkt-gen on two interfaces, one used to transmit and
+# the other to receive; the output of pkt-gen is saved in files to be parsed and
+# passed to common/scripts/min_max_avg_parse.py
+# Sample command: start-pkt-gen.sh eth0 eth1 tx.out rx.out
+# where eth0 is used to send packets and eth1 to receive
+
+test $# -lt 4 && echo "Please pass interfaces and rx and tx output files" && exit 1
+
+netmap/examples/pkt-gen -i $1 -f tx -l 64 &> $2 &
+sleep 4
+netmap/examples/pkt-gen -i $3 -f rx &> $4 &
diff --git a/common/scripts/odp-ovs/ovs-odp-dpdk-nic-bind-82599.sh b/common/scripts/odp-ovs/ovs-odp-dpdk-nic-bind-82599.sh
new file mode 100755
index 0000000..33ff797
--- /dev/null
+++ b/common/scripts/odp-ovs/ovs-odp-dpdk-nic-bind-82599.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+test $# -lt 1 && echo "Please pass path to DPDK" && exit 1
+cd $1
+for n in $(./tools/dpdk_nic_bind.py --status | awk ' $2 ~ "82599" {print $1}')
+do
+ ./tools/dpdk_nic_bind.py --bind=igb_uio $n
+done
diff --git a/ubuntu/netmap-pkt-gen-multinode.yaml b/ubuntu/netmap-pkt-gen-multinode.yaml
new file mode 100644
index 0000000..a892b91
--- /dev/null
+++ b/ubuntu/netmap-pkt-gen-multinode.yaml
@@ -0,0 +1,90 @@
+metadata:
+ format: Lava-Test Test Definition 1.0
+ name: netmap-pkt-gen-multinode
+ description: "The netmap-pkt-gen-multinode can be used to measure the performance of a simple l2fwd
+ application in a multinode setup. A typical setup is two machines connected back to
+ back through a pair of interfaces (usually intel server DPDK dual NICs like the 82599
+ dual port 10GB interface) where the l2fwd runs on one machine and netmap runs on the
+ other. The test launches a pkt-gen instance to send packets on one interface and another
+ one to receive packets and count them on the other interface."
+ maintainer:
+ - ciprian.barbu@linaro.org
+ os:
+ - ubuntu
+ scope:
+ - functional
+ - performance
+ devices:
+ - x86
+
+
+params:
+ LINUX_SRC: "/usr/src/linux-source"
+ NIC_PATTERN: "82599"
+ TEST_TIME: "360"
+
+install:
+ deps:
+ - git
+ - binutils
+ - gcc
+ - make
+ - patch
+ - pciutils
+ - python-numpy
+ - lshw
+ git-repos:
+ - url: http://code.google.com/p/netmap/
+ destination: netmap
+ branch: master
+ steps:
+ - echo 'RUNNING depmod'
+ - depmod
+ - ifconfig -a
+ - lshw -class network
+ - echo 'BUILDING netmap'
+ - cd netmap/LINUX
+ - ./configure --kernel-dir=/lib/modules/`uname -r`/build --kernel-sources=$LINUX_SRC
+ - make
+ - echo 'BUILDING pkt-gen'
+ - make -C ../examples pkt-gen
+ - echo 'INSERTING modules'
+ - rmmod ixgbe || true
+ - insmod netmap.ko
+ - modprobe mdio
+ - lsmod | grep ixgbe && rmmod ixgbe || true
+ - insmod ixgbe/ixgbe.ko
+ - cd ../../
+ - echo 'BRINGING UP interfaces'
+ - common/scripts/netmap-pkt-gen/find_nics.sh $NIC_PATTERN
+ - export IF_0=$(cat ifs | sed -n 1p)
+ - export IF_1=$(cat ifs | sed -n 2p)
+ - echo "IF_0=$IF_0 IF_1=$IF_1"
+ - ifconfig $IF_0 up promisc
+ - ifconfig $IF_1 up promisc
+ - ifconfig -a
+ - lshw -class network
+
+run:
+ steps:
+ - set -x
+ - lava-sync ready
+ - export IF_0=$(cat ifs | sed -n 1p)
+ - export IF_1=$(cat ifs | sed -n 2p)
+ - echo 'RUNNING netmap for 360 seconds'
+ - lava-test-case start-pkt-gen --shell common/scripts/netmap-pkt-gen/start-pkt-gen.sh "$IF_0" pkt-gen-tx "$IF_1" pkt-gen-rx
+ - pgrep pkt-gen
+ - sleep $TEST_TIME
+ - echo 'KILLING pkt-gen'
+ - kill -9 $(ps -ef | grep pkt-gen | grep rx | awk '{print $2}')
+ - kill -9 $(ps -ef | grep pkt-gen | grep tx | awk '{print $2}')
+ - cat pkt-gen-tx
+ - cat pkt-gen-rx
+ - lava-sync l2fwd-done
+ - echo 'PARSING results'
+ - lava-test-case parse-tx-rx --shell common/scripts/netmap-pkt-gen/parse-tx-rx.sh pkt-gen-tx tx_thr pkt-gen-rx rx_thr
+ - ./common/scripts/min_max_avg_parse.py tx_thr "tx_throughput:" "pps"
+ - ./common/scripts/min_max_avg_parse.py rx_thr "rx_throughput:" "pps"
+
+parse:
+ pattern: '^(?P<test_case_id>(rx|tx)_thr.*):\s*(?P<measurement>[0-9.]+)\s+(?P<units>\w+)\s+(?P<result>\w+)'
diff --git a/ubuntu/ovs-odp-dpdk-server-multinode.yaml b/ubuntu/ovs-odp-dpdk-server-multinode.yaml
new file mode 100644
index 0000000..a5f4851
--- /dev/null
+++ b/ubuntu/ovs-odp-dpdk-server-multinode.yaml
@@ -0,0 +1,100 @@
+metadata:
+ format: Lava-Test Test Definition 1.0
+ name: ovs-odp-server-multinode
+ description: "OVS on top of ODP-DPDK - this runs as part of a multinode setup and tests
+ the performance of odp-ovs. This initial effort covers simple PHY-to-PHY
+ forwarding in a setup with two machines connected back to back trough two
+ network interfaces. The other machine will usually run netmap-pkt-gen-multinode
+ to generate packets and measure the rate of packets forwarded by odp-ovs."
+ maintainer:
+ - ciprian.barbu@linaro.org
+ os:
+ - ubuntu
+ scope:
+ - functional
+ - performance
+ devices:
+ - x86
+
+params:
+ LINUX_HEADERS_DEB: "/linux-headers.deb"
+ ODP_OVS_GIT: "git://git.linaro.org/lng/odp-ovs.git"
+ ODP_OVS_REV: "odp-v0"
+ NIC_PATTERN: "82599"
+
+install:
+ deps:
+ - git
+ - binutils
+ - gcc
+ - make
+ - autoconf
+ - libtool
+ - automake
+ - patch
+ - pciutils
+ - python-numpy
+ - libpcap-dev
+ - openssl
+ - libssl-dev
+ - curl
+ - uuid-runtime
+ - bzip2
+ - lshw
+ git-repos:
+ - url: git://git.linaro.org/lng/check-odp
+ steps:
+ - echo 'RUNNING depmod'
+ - depmod
+ - echo 'CLONING odp-ovs'
+ - git clone $ODP_OVS_GIT odp-ovs
+ - cd odp-ovs
+ - git checkout $ODP_OVS_REV
+ - ifconfig -a
+ - lshw -class network
+
+run:
+ steps:
+ - set -x
+ - echo 'COMPILING ODP-DPDK'
+ - cd check-odp
+ - lava-test-case compile-odp-dpdk --shell CLEANUP=0 ./build-dpdk.sh
+ - echo 'COMPILING ODP-OVS'
+ - cd ..
+ - cd odp-ovs
+ - ./boot.sh
+ - lava-test-case configure-odp-ovs --shell ./configure --with-odp=../check-odp/new-build --with-odp-debug=yes --prefix=/usr
+ - lava-test-case make-odp-ovs --shell make -j 4
+ - make install
+ - cd ..
+ - echo 'CONFIGURE hugetlbfs'
+ - lava-test-case set-1024-hugetlbfs --shell 'echo 1024 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages'
+ - mkdir -p /mnt/huge
+ - lava-test-case mount-hugetlbfs --shell mount -t hugetlbfs nodev /mnt/huge
+ - sleep 5
+ - echo 'PREPARE DPDK'
+ - lava-test-case insert-uio --shell modprobe uio
+ - lava-test-case insert-igb-uio --shell insmod check-odp/DPDK/x86_64-native-linuxapp-gcc/kmod/igb_uio.ko
+ - echo 'BIND DPDK NICs'
+ - lava-test-case dpdk-nic-status-before --shell check-odp/DPDK/tools/dpdk_nic_bind.py --status
+ - lava-test-case dpdk-nic-bind --shell ./common/scripts/odp-ovs/ovs-odp-dpdk-nic-bind-$NIC_PATTERN.sh check-odp/DPDK
+ - lava-test-case dpdk-nic-status-after --shell check-odp/DPDK/tools/dpdk_nic_bind.py --status
+ - sleep 5
+ - echo 'STARTING ODP-OVS'
+ - lava-test-case start-odp-ovs --shell 'ODP_PLATFORM_PARAMS="-n 3 -- -p 3" odp-ovs/debian/openvswitch-switch.init start'
+ - echo 'ENABLING ODP mode'
+ - lava-test-case enable-odp-mode --shell 'ovs-vsctl set Open_vSwitch . other_config:odp=true'
+ - echo 'ADDING bridge'
+ - lava-test-case add-bridge --shell 'ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev'
+ - sleep 3
+ - echo 'ADDING ports'
+ - lava-test-case add-port0 --shell 'ovs-vsctl add-port br0 odp:0 -- set Interface odp:0 type=odp'
+ - lava-test-case add-port1 --shell 'ovs-vsctl add-port br0 odp:1 -- set Interface odp:1 type=odp'
+ - sleep 3
+ - echo 'ADDING flows'
+ - lava-test-case show-flows --shell ovs-ofctl show br0
+ - lava-test-case add-flow1 --shell 'ovs-ofctl add-flow br0 in_port=1,action=output:2'
+ - lava-test-case add-flow2 --shell 'ovs-ofctl add-flow br0 in_port=2,action=output:1'
+ - lava-sync ready
+ - lava-sync l2fwd-done
+ - lava-test-case del-br --shell 'ovs-vsctl del-br br0'