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:
Jesper D. Brouer
2020-11-21 18:27:37 +01:00
parent 4671be73a8
commit 68505a2dbd

View File

@@ -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