tools/testing/selftests/drivers/net/netdevsim/tc-mq-visibility.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/drivers/net/netdevsim/tc-mq-visibility.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/drivers/net/netdevsim/tc-mq-visibility.sh- Extension
.sh- Size
- 1684 bytes
- Lines
- 81
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: tools
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
#!/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"
# Remove real one
tcq del parent 100:4 handle 204:
# Replace default with pfifo
tcq replace parent 100:1 handle 205: pfifo limit 1000
n_child_assert 3 "Deleting real one, replacing default one with pfifo"
ethtool -L $NDEV combined 1
n_child_assert 1 "Grafted, one"
Annotation
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.