-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Jakub Kicinski says: ==================== net: sched: update default qdisc visibility after Tx queue cnt changes Matthew noticed that number of children reported by mq does not match number of queues on reconfigured interfaces. For example if mq is instantiated when there is 8 queues it will always show 8 children, regardless of config being changed: # ethtool -L eth0 combined 8 # tc qdisc replace dev eth0 root handle 100: mq # tc qdisc show dev eth0 qdisc mq 100: root qdisc pfifo_fast 0: parent 100:8 bands 3 priomap 1 2 ... qdisc pfifo_fast 0: parent 100:7 bands 3 priomap 1 2 ... qdisc pfifo_fast 0: parent 100:6 bands 3 priomap 1 2 ... qdisc pfifo_fast 0: parent 100:5 bands 3 priomap 1 2 ... qdisc pfifo_fast 0: parent 100:4 bands 3 priomap 1 2 ... qdisc pfifo_fast 0: parent 100:3 bands 3 priomap 1 2 ... qdisc pfifo_fast 0: parent 100:2 bands 3 priomap 1 2 ... qdisc pfifo_fast 0: parent 100:1 bands 3 priomap 1 2 ... # ethtool -L eth0 combined 1 # tc qdisc show dev eth0 qdisc mq 100: root qdisc pfifo_fast 0: parent 100:8 bands 3 priomap 1 2 ... qdisc pfifo_fast 0: parent 100:7 bands 3 priomap 1 2 ... qdisc pfifo_fast 0: parent 100:6 bands 3 priomap 1 2 ... qdisc pfifo_fast 0: parent 100:5 bands 3 priomap 1 2 ... qdisc pfifo_fast 0: parent 100:4 bands 3 priomap 1 2 ... qdisc pfifo_fast 0: parent 100:3 bands 3 priomap 1 2 ... qdisc pfifo_fast 0: parent 100:2 bands 3 priomap 1 2 ... qdisc pfifo_fast 0: parent 100:1 bands 3 priomap 1 2 ... # ethtool -L eth0 combined 32 # tc qdisc show dev eth0 qdisc mq 100: root qdisc pfifo_fast 0: parent 100:8 bands 3 priomap 1 2 ... qdisc pfifo_fast 0: parent 100:7 bands 3 priomap 1 2 ... qdisc pfifo_fast 0: parent 100:6 bands 3 priomap 1 2 ... qdisc pfifo_fast 0: parent 100:5 bands 3 priomap 1 2 ... qdisc pfifo_fast 0: parent 100:4 bands 3 priomap 1 2 ... qdisc pfifo_fast 0: parent 100:3 bands 3 priomap 1 2 ... qdisc pfifo_fast 0: parent 100:2 bands 3 priomap 1 2 ... qdisc pfifo_fast 0: parent 100:1 bands 3 priomap 1 2 ... This patchset fixes this by hashing and unhasing the default child qdiscs as number of queues gets adjusted. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
- Loading branch information
Showing
9 changed files
with
169 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
tools/testing/selftests/drivers/net/netdevsim/tc-mq-visibility.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#!/bin/bash | ||
# SPDX-License-Identifier: GPL-2.0-only | ||
|
||
source ethtool-common.sh | ||
|
||
set -o pipefail | ||
|
||
n_children() { | ||
n=$(tc qdisc show dev $NDEV | grep '^qdisc' | wc -l) | ||
echo $((n - 1)) | ||
} | ||
|
||
tcq() { | ||
tc qdisc $1 dev $NDEV ${@:2} | ||
} | ||
|
||
n_child_assert() { | ||
n=$(n_children) | ||
if [ $n -ne $1 ]; then | ||
echo "ERROR ($root): ${@:2}, expected $1 have $n" | ||
((num_errors++)) | ||
else | ||
((num_passes++)) | ||
fi | ||
} | ||
|
||
|
||
for root in mq mqprio; do | ||
NDEV=$(make_netdev 1 4) | ||
|
||
opts= | ||
[ $root == "mqprio" ] && opts='hw 0 num_tc 1 map 0 0 0 0 queues 1@0' | ||
|
||
tcq add root handle 100: $root $opts | ||
n_child_assert 4 'Init' | ||
|
||
# All defaults | ||
|
||
for n in 3 2 1 2 3 4 1 4; do | ||
ethtool -L $NDEV combined $n | ||
n_child_assert $n "Change queues to $n while down" | ||
done | ||
|
||
ip link set dev $NDEV up | ||
|
||
for n in 3 2 1 2 3 4 1 4; do | ||
ethtool -L $NDEV combined $n | ||
n_child_assert $n "Change queues to $n while up" | ||
done | ||
|
||
# One real one | ||
tcq replace parent 100:4 handle 204: pfifo_fast | ||
n_child_assert 4 "One real queue" | ||
|
||
ethtool -L $NDEV combined 1 | ||
n_child_assert 2 "One real queue, one default" | ||
|
||
ethtool -L $NDEV combined 4 | ||
n_child_assert 4 "One real queue, rest default" | ||
|
||
# Graft some | ||
tcq replace parent 100:1 handle 204: | ||
n_child_assert 3 "Grafted" | ||
|
||
ethtool -L $NDEV combined 1 | ||
n_child_assert 1 "Grafted, one" | ||
|
||
cleanup_nsim | ||
done | ||
|
||
if [ $num_errors -eq 0 ]; then | ||
echo "PASSED all $((num_passes)) checks" | ||
exit 0 | ||
else | ||
echo "FAILED $num_errors/$((num_errors+num_passes)) checks" | ||
exit 1 | ||
fi |