# bench kernel
#-----------------
modprobe canethgw
+mkcegwdev
-cegw --listen udp@127.0.0.1:10501
-cegw --add -s can@vcan0 -d udp@127.0.0.1:10502
-cegw --add -s udp@127.0.0.1:10502 -d can@vcan0
+cegw vcan0 127.0.0.1:10501 127.0.0.1:10502 &
+JOB=$!
sleep $SLEEP
-echo "#kernel udp->can: " | tee -a result | cut -c 2-
+echo "#kernel udp->can" | tee -a result | cut -c 2-
cegwbench -s udp@127.0.0.1:10501 -d can@vcan0 -n $N -m $MODE -t 1 >> $RESULTFILE
sleep $SLEEP
-echo "#kernel can->udp: " | tee -a result | cut -c 2-
+echo "#kernel can->udp" | tee -a result | cut -c 2-
cegwbench -s can@vcan0 -d udp@127.0.0.1:10502 -n $N -m $MODE -t 1 >> $RESULTFILE
sleep $SLEEP
+kill $JOB
modprobe -r canethgw
#-----------------
PID=$!
sleep $SLEEP
-echo "#user udp->can: " | tee -a result | cut -c 2-
+echo "#user udp->can" | tee -a result | cut -c 2-
cegwbench -s udp@127.0.0.1:10501 -d can@vcan0 -n $N -m $MODE -t 1 >> $RESULTFILE
sleep $SLEEP
-echo "#user can->udp: " | tee -a result | cut -c 2-
+echo "#user can->udp" | tee -a result | cut -c 2-
cegwbench -s can@vcan0 -d udp@127.0.0.1:10502 -n $N -m $MODE -t 1 >> $RESULTFILE
sleep $SLEEP