mirror of
https://github.com/xdp-project/bpf-examples.git
synced 2024-05-06 15:54:53 +00:00
traffic-pacing-edt: tc_fq_pacer.sh select between MQ and single FQ
For some reason cannot get correct scheduling with FQ in a MQ setup. In production traffic is Q-in-Q double tagged VLAN traffic. Perhaps the RX-hash is doing strange stuff, or BPF-prog concurrency is wrong. Due to Q-in-Q NIC RSS cause most packets to hit CPU-6 for some strange reason. Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
This commit is contained in:
@@ -22,6 +22,14 @@ export TC=tc
|
||||
# Default verbose
|
||||
VERBOSE=1
|
||||
|
||||
# Select between multiq or single root qdisc
|
||||
if [[ -z $1 ]]; then
|
||||
if [[ -z $REMOVE ]]; then
|
||||
err 1 "Specify root qdisc system: single or mq (multi-queue)"
|
||||
fi
|
||||
fi
|
||||
TYPE=$1
|
||||
|
||||
# Delete existing root qdisc
|
||||
call_tc_allow_fail qdisc del dev "$DEV" root
|
||||
|
||||
@@ -29,20 +37,41 @@ if [[ -n $REMOVE ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# MQ (Multi-Queue) as root qdisc
|
||||
call_tc qdisc replace dev $DEV root handle 7FFF: mq
|
||||
function use_multiq()
|
||||
{
|
||||
# MQ (Multi-Queue) as root qdisc
|
||||
call_tc qdisc replace dev $DEV root handle 7FFF: mq
|
||||
|
||||
# Add FQ-pacer qdisc on each NIC avail TX-queue
|
||||
i=0
|
||||
for dir in /sys/class/net/$DEV/queues/tx-*; do
|
||||
# Details: cause-off-by-one, as tx-0 becomes handle 1:
|
||||
((i++)) || true
|
||||
#call_tc qdisc add dev $DEV parent 7FFF:$i handle $i: fq
|
||||
#
|
||||
# The higher 'flow_limit' is needed for high-BW pacing
|
||||
call_tc qdisc add dev $DEV parent 7FFF:$i handle $i: fq \
|
||||
flow_limit 1000
|
||||
#
|
||||
# quantum $((1514*4)) initial_quantum $((1514*20))
|
||||
# call_tc qdisc add dev $DEV parent 7FFF:$i handle $i: fq maxrate 930mbit
|
||||
done
|
||||
# Add FQ-pacer qdisc on each NIC avail TX-queue
|
||||
i=0
|
||||
for dir in /sys/class/net/$DEV/queues/tx-*; do
|
||||
# Details: cause-off-by-one, as tx-0 becomes handle 1:
|
||||
((i++)) || true
|
||||
#call_tc qdisc add dev $DEV parent 7FFF:$i handle $i: fq
|
||||
#
|
||||
# The higher 'flow_limit' is needed for high-BW pacing
|
||||
call_tc qdisc add dev $DEV parent 7FFF:$i handle $i: fq \
|
||||
flow_limit 1000
|
||||
#
|
||||
# quantum $((1514*4)) initial_quantum $((1514*20))
|
||||
# call_tc qdisc add dev $DEV parent 7FFF:$i handle $i: fq maxrate 930mbit
|
||||
done
|
||||
}
|
||||
|
||||
function use_single_fq_pacer()
|
||||
{
|
||||
call_tc qdisc replace dev $DEV root handle 7FFF: fq \
|
||||
flow_limit 1000
|
||||
}
|
||||
|
||||
case "$TYPE" in
|
||||
mq | multiq )
|
||||
use_multiq
|
||||
;;
|
||||
single | fq )
|
||||
use_single_fq_pacer
|
||||
;;
|
||||
* )
|
||||
err 1 "Unknown type: ${TYPE}"
|
||||
;;
|
||||
esac
|
||||
|
Reference in New Issue
Block a user