Commit 2d947238 authored by Joanne Hugé's avatar Joanne Hugé

Add script to add ETF and pfast qdiscs

parent 32e46196
#!/bin/bash
usage() {
echo "Usage: $0 -e delta|-p" 1>&2;
exit 1;
}
while getopts "e:p" opt; do
case "${opt}" in
e )
delta=${OPTARG}
use_etf=1
;;
p )
use_pfast=1
;;
* )
usage
;;
esac
done
shift $((OPTIND-1))
if [ -z "${use_etf}" ] && [ -z "${use_pfast}" ]; then
usage
fi
if [ -n "${use_etf}" ] && [ -n "${use_pfast}" ]; then
usage
fi
if [ -n "${use_etf}" ]; then
echo "Creating ETF qdisc with delta $delta"
tc qdisc del root dev eth0;
tc qdisc add dev eth0 parent root handle 100 prio bands 2 priomap 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1;
tc qdisc add dev eth0 parent 100:1 etf clockid CLOCK_TAI delta $delta;
tc qdisc show dev eth0;
elif [ -n "${use_pfast}" ]; then
echo "Creating pfast qdisc"
tc qdisc del root dev eth0;
tc qdisc show;
fi
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment