From 79f8357de009a8b24c7060811846f124d9ddde6a Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Mon, 15 Jun 2009 18:30:18 +0200 Subject: [PATCH] Added tests with ethernet load --- canping | 2 +- tests/_lib.sh | 15 ++++++++++++--- tests/ethflood.sh | 26 ++++++++++++++++++++++++++ tests/ethflood64k.sh | 25 +++++++++++++++++++++++++ tests/ethload.sh | 30 ++++++++++++++++++++++++++++++ tests/ethload300MHz.sh | 32 ++++++++++++++++++++++++++++++++ tests/ethloadsend.sh | 25 +++++++++++++++++++++++++ tests/rtt-300MHz.sh | 4 ++-- tests/rtt-overload.sh | 6 ++++-- tests/rtt-virtual-300MHz.sh | 4 ++-- tests/rtt-virtual.sh | 4 ++-- tests/rtt.sh | 4 ++-- 12 files changed, 163 insertions(+), 14 deletions(-) create mode 100755 tests/ethflood.sh create mode 100755 tests/ethflood64k.sh create mode 100755 tests/ethload.sh create mode 100755 tests/ethload300MHz.sh create mode 100755 tests/ethloadsend.sh diff --git a/canping b/canping index f09a8c7..6991851 160000 --- a/canping +++ b/canping @@ -1 +1 @@ -Subproject commit f09a8c7c0507c66ca87474479ed6f1185aa76bde +Subproject commit 6991851c166330d9dd36cc88cbb1ef839f5c0c7c diff --git a/tests/_lib.sh b/tests/_lib.sh index 47facb0..183f189 100644 --- a/tests/_lib.sh +++ b/tests/_lib.sh @@ -11,10 +11,18 @@ set -e PATH=$PWD/../_compiled/bin/:$PATH +RTPRIO=60 + +boost_irq_prio() { + local P=${1:-50} + CAN_IRQ=`sed -ne '/can/ s/:.*//p' /proc/interrupts` + if [ -n "$CAN_IRQ" ]; then + schedtool -F -p $P `pidof IRQ-${CAN_IRQ/ /}` + fi +} + rmmod_can() { - modprobe -r lincan - modprobe -r kvaser_pci - modprobe -r vcan + modprobe -r lincan kvaser_pci vcan } prepare_lincan_hw() { @@ -63,6 +71,7 @@ run_tests() { tests=${TESTS:-socketcan_hw lincan_hw} for i in $tests; do cpufreq-set -f 2400MHz + boost_irq_prio 50 prepare_$i t done diff --git a/tests/ethflood.sh b/tests/ethflood.sh new file mode 100755 index 0000000..e2c1edd --- /dev/null +++ b/tests/ethflood.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +. _lib.sh + +t() { + ssh root@${SSH_CONNECTION%% *} 'ping -qf "${SSH_CONNECTION%% *}"' & + PID_PING=$! + boost_irq_prio + PID_S=`vca_canping -s 1 -b -R FF:$RTPRIO -d $CAN1` + vca_canping -m 1 -R FF:$RTPRIO -v -g $DRIVER -t 1 -d $CAN0 -w 2 -c 10000 + kill $PID_S + kill $PID_PING +} + + + +PLOT_CMD=' +set title "Round-trip time with ethenet load - ping -f (`uname -r`)" +set logscale y +set grid +set xlabel "Time [{/Symbol m}s]" +set ylabel "Latency profile [messages]" +plot [0:] "socketcan-1000.dat" with lp title "Socketcan",\ + "lincan-1000.dat" with lp title "Lincan" +' + diff --git a/tests/ethflood64k.sh b/tests/ethflood64k.sh new file mode 100755 index 0000000..9702093 --- /dev/null +++ b/tests/ethflood64k.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +. _lib.sh + +t() { + ssh root@${SSH_CONNECTION%% *} 'ping -qfs 64000 "${SSH_CONNECTION%% *}"' & + PID_PING=$! + PID_S=`vca_canping -s 1 -b -R FF:$RTPRIO -d $CAN1` + vca_canping -m 1 -R FF:$RTPRIO -v -g $DRIVER -t 1 -d $CAN0 -w 2 -c 10000 + kill $PID_S + kill $PID_PING +} + + + +PLOT_CMD=' +set title "Round-trip time with ethenet load - ping -fs 64000 (`uname -r`)" +set logscale y +set grid +set xlabel "Time [{/Symbol m}s]" +set ylabel "Latency profile [messages]" +plot [0:] "socketcan-1000.dat" with lp title "Socketcan",\ + "lincan-1000.dat" with lp title "Lincan" +' + diff --git a/tests/ethload.sh b/tests/ethload.sh new file mode 100755 index 0000000..a5e57f6 --- /dev/null +++ b/tests/ethload.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +. _lib.sh + +t() { + for i in norm boost; do + ssh root@${SSH_CONNECTION%% *} 'find -L /usr/src/linux -type f -exec cat "{}" ";"' > /dev/null & + PID_LOAD=$! + [ $i == "boost" ] && boost_irq_prio 90 + PID_S=`vca_canping -s 1 -b -R FF:$RTPRIO -d $CAN1` + vca_canping -m 1 -R FF:$RTPRIO -v -g $DRIVER-$i -t 1 -d $CAN0 -w 2 -c 10000 + kill $PID_S + kill $PID_LOAD + done +} + + + +PLOT_CMD=' +set title "Round-trip time with receive ethenet load (`uname -r`)" +set logscale y +set grid +set xlabel "Time [{/Symbol m}s]" +set ylabel "Latency profile [messages]" +plot [0:] "socketcan-norm-1000.dat" with lp title "Socketcan",\ + "lincan-norm-1000.dat" with lp title "Lincan",\ + "socketcan-boost-1000.dat" with lp title "Socketcan boosted IRQ prio",\ + "lincan-boost-1000.dat" with lp title "Lincan boosted IRQ prio" +' + diff --git a/tests/ethload300MHz.sh b/tests/ethload300MHz.sh new file mode 100755 index 0000000..8ce6775 --- /dev/null +++ b/tests/ethload300MHz.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +. _lib.sh + +t() { + for i in norm boost; do + ssh root@${SSH_CONNECTION%% *} 'find -L /usr/src/linux -type f -exec cat "{}" ";"' > /dev/null & + PID_LOAD=$! + [ $i == "boost" ] && boost_irq_prio 90 + cpufreq-set -f 300MHz + PID_S=`vca_canping -s 1 -b -R FF:$RTPRIO -d $CAN1` + vca_canping -m 1 -R FF:$RTPRIO -v -g $DRIVER-$i -t 1 -d $CAN0 -w 2 -c 10000 + cpufreq-set -f 2400MHz + kill $PID_S + kill $PID_LOAD + done +} + + + +PLOT_CMD=' +set title "Round-trip time with receive ethenet load (`uname -r`, CPU\\@300 MHz)" +set logscale y +set grid +set xlabel "Time [{/Symbol m}s]" +set ylabel "Latency profile [messages]" +plot [0:] "socketcan-norm-1000.dat" with lp title "Socketcan",\ + "lincan-norm-1000.dat" with lp title "Lincan",\ + "socketcan-boost-1000.dat" with lp title "Socketcan boosted IRQ prio",\ + "lincan-boost-1000.dat" with lp title "Lincan boosted IRQ prio" +' + diff --git a/tests/ethloadsend.sh b/tests/ethloadsend.sh new file mode 100755 index 0000000..a720202 --- /dev/null +++ b/tests/ethloadsend.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +. _lib.sh + +t() { + ( find -L /usr/src/linux -type f -exec cat '{}' ';'|ssh root@${SSH_CONNECTION%% *} 'cat > /dev/null' ) & + PID_LOAD=$! + PID_S=`vca_canping -s 1 -b -R FF:$RTPRIO -d $CAN1` + vca_canping -m 1 -R FF:$RTPRIO FF:$RTPRIO -v -g $DRIVER -t 1 -d $CAN0 -w 2 -c 10000 + kill $PID_S + kill $PID_LOAD +} + + + +PLOT_CMD=' +set title "Round-trip time with receive ethenet load (`uname -r`)" +set logscale y +set grid +set xlabel "Time [{/Symbol m}s]" +set ylabel "Latency profile [messages]" +plot [0:] "socketcan-1000.dat" with lp title "Socketcan",\ + "lincan-1000.dat" with lp title "Lincan" +' + diff --git a/tests/rtt-300MHz.sh b/tests/rtt-300MHz.sh index c6a65c6..aaac12a 100755 --- a/tests/rtt-300MHz.sh +++ b/tests/rtt-300MHz.sh @@ -3,9 +3,9 @@ . _lib.sh t() { - PID_S=`vca_canping -s 1 -b -r -d $CAN1` + PID_S=`vca_canping -s 1 -b -R FF:$RTPRIO -d $CAN1` cpufreq-set -f 300MHz - vca_canping -m 1 -r -v -g $DRIVER -t 1 -d $CAN0 -w 2 -c 10000 + vca_canping -m 1 -R FF:$RTPRIO -v -g $DRIVER -t 1 -d $CAN0 -w 2 -c 10000 cpufreq-set -f 2400Mhz kill $PID_S } diff --git a/tests/rtt-overload.sh b/tests/rtt-overload.sh index 7aad504..52b1a97 100755 --- a/tests/rtt-overload.sh +++ b/tests/rtt-overload.sh @@ -5,11 +5,13 @@ C=100 t() { - PID_S=`vca_canping -s $C -b -r -d $CAN1` - vca_canping -m $C -r -v -g $DRIVER -t 1 -d $CAN0 -w 500 -c 10 + PID_S=`vca_canping -s $C -b -R FF:$RTPRIO -d $CAN0` + vca_canping -m $C -R FF:$RTPRIO -v -g $DRIVER -t 1 -d $CAN0 -w 500 -c 10 kill $PID_S } +TESTS="lincan_virtual socketcan_virtual" + PLOT_CMD=" diff --git a/tests/rtt-virtual-300MHz.sh b/tests/rtt-virtual-300MHz.sh index b001d6b..951af92 100755 --- a/tests/rtt-virtual-300MHz.sh +++ b/tests/rtt-virtual-300MHz.sh @@ -3,9 +3,9 @@ . _lib.sh t() { - PID_S=`vca_canping -s 1 -b -r -d $CAN0` + PID_S=`vca_canping -s 1 -b -R FF:$RTPRIO -d $CAN0` cpufreq-set -f 300MHz - vca_canping -m 1 -r -v -g $DRIVER -t 1 -d $CAN0 -w 5 -c 10000 + vca_canping -m 1 -R FF:$RTPRIO -v -g $DRIVER -t 1 -d $CAN0 -w 5 -c 10000 cpufreq-set -f 2400MHz kill $PID_S } diff --git a/tests/rtt-virtual.sh b/tests/rtt-virtual.sh index fb42e3c..a057e28 100755 --- a/tests/rtt-virtual.sh +++ b/tests/rtt-virtual.sh @@ -3,8 +3,8 @@ . _lib.sh t() { - PID_S=`vca_canping -s 1 -b -r -d $CAN0` - vca_canping -m 1 -r -v -g $DRIVER -t 1 -d $CAN0 -w 1 -c 10000 + PID_S=`vca_canping -s 1 -b -R FF:$RTPRIO -d $CAN0` + vca_canping -m 1 -R FF:$RTPRIO -v -g $DRIVER -t 1 -d $CAN0 -w 1 -c 10000 kill $PID_S } diff --git a/tests/rtt.sh b/tests/rtt.sh index 7397869..0b78118 100755 --- a/tests/rtt.sh +++ b/tests/rtt.sh @@ -3,8 +3,8 @@ . _lib.sh t() { - PID_S=`vca_canping -s 1 -b -r -d $CAN1` - vca_canping -m 1 -r -v -g $DRIVER -t 1 -d $CAN0 -w 2 -c 10000 + PID_S=`vca_canping -s 1 -b -R FF:$RTPRIO -d $CAN1` + vca_canping -m 1 -R FF:$RTPRIO -v -g $DRIVER -t 1 -d $CAN0 -w 2 -c 10000 kill $PID_S } -- 2.39.2