diff options
Diffstat (limited to 'common')
-rwxr-xr-x | common/scripts/netmap-pkt-gen/find_nics.sh | 16 | ||||
-rwxr-xr-x | common/scripts/netmap-pkt-gen/parse-tx-rx.sh | 9 | ||||
-rwxr-xr-x | common/scripts/netmap-pkt-gen/start-pkt-gen.sh | 13 | ||||
-rwxr-xr-x | common/scripts/odp-ovs/ovs-odp-dpdk-nic-bind-82599.sh | 7 |
4 files changed, 45 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 |