tools/testing/selftests/drivers/net/mlxsw/port_range_scale.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/drivers/net/mlxsw/port_range_scale.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/drivers/net/mlxsw/port_range_scale.sh- Extension
.sh- Size
- 1548 bytes
- Lines
- 96
- 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
# SPDX-License-Identifier: GPL-2.0
PORT_RANGE_NUM_NETIFS=2
port_range_h1_create()
{
simple_if_init $h1
}
port_range_h1_destroy()
{
simple_if_fini $h1
}
port_range_switch_create()
{
simple_if_init $swp1
tc qdisc add dev $swp1 clsact
}
port_range_switch_destroy()
{
tc qdisc del dev $swp1 clsact
simple_if_fini $swp1
}
port_range_rules_create()
{
local count=$1; shift
local should_fail=$1; shift
local batch_file="$(mktemp)"
for ((i = 0; i < count; ++i)); do
cat >> $batch_file <<-EOF
filter add dev $swp1 ingress \
prot ipv4 \
pref 1000 \
flower skip_sw \
ip_proto udp dst_port 1-$((100 + i)) \
action pass
EOF
done
tc -b $batch_file
check_err_fail $should_fail $? "Rule insertion"
rm -f $batch_file
}
__port_range_test()
{
local count=$1; shift
local should_fail=$1; shift
port_range_rules_create $count $should_fail
offload_count=$(tc -j filter show dev $swp1 ingress |
jq "[.[] | select(.options.in_hw == true)] | length")
((offload_count == count))
check_err_fail $should_fail $? "port range offload count"
}
port_range_test()
{
local count=$1; shift
local should_fail=$1; shift
if ! tc_offload_check $PORT_RANGE_NUM_NETIFS; then
check_err 1 "Could not test offloaded functionality"
return
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.