summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlias Apalodimas <ilias.apalodimas@linaro.org>2018-10-25 15:06:29 +0300
committerIlias Apalodimas <ilias.apalodimas@linaro.org>2018-10-25 15:06:29 +0300
commit77005ce60d7eaccb2b634853e96b1841e1f24f54 (patch)
treecfe6e75a793f76bfc1ad2a51ebd00527cc6b56ba
parentb6bdc737a332cbe9e90b3c641de8abf43209838c (diff)
downloadlava-sessions-77005ce60d7eaccb2b634853e96b1841e1f24f54.tar.gz
use batch file for tc convifguration
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
-rwxr-xr-xscripts/setup-taprio.sh25
1 files changed, 16 insertions, 9 deletions
diff --git a/scripts/setup-taprio.sh b/scripts/setup-taprio.sh
index 76455f9..684b0ff 100755
--- a/scripts/setup-taprio.sh
+++ b/scripts/setup-taprio.sh
@@ -2,16 +2,23 @@
. scripts/lava-common.sh
+batch='taprio.batch'
iface=$(find_vland_iface)
-i=$((`date +%s%N` + 37000000000 + (2 * 60 * 1000000000)))
+# 37 seconds is the TAI-UTC offset. Start it after 5 seconds
+i=$((`date +%s%N` + 37000000000 + (5 * 1000000000)))
+# round it down
base=$(($i - ($i % 1000000000)))
-tc qdisc replace dev "$iface" parent root handle 100 taprio \
- num_tc 3 \
- map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \
- queues 1@0 1@1 2@2 \
- base-time $base \
- sched-entry S 01 300000 \
- sched-entry S 02 300000 \
- sched-entry S 04 400000 \
+cat > $batch <<EOF
+qdisc replace dev "$iface" parent root handle 100 taprio \
+ num_tc 3 \
+ map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \
+ queues 1@0 1@1 2@2 \
+ base-time "$base" \
+ sched-entry S 01 300000 \
+ sched-entry S 02 300000 \
+ sched-entry S 04 400000 \
clockid CLOCK_TAI
+EOF
+
+tc -b $batch