tools/testing/selftests/drivers/net/mlxsw/qos_headroom.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/drivers/net/mlxsw/qos_headroom.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/drivers/net/mlxsw/qos_headroom.sh- Extension
.sh- Size
- 8384 bytes
- Lines
- 380
- 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
ALL_TESTS="
test_defaults
test_dcb_ets
test_mtu
test_pfc
test_int_buf
test_tc_priomap
test_tc_mtu
test_tc_sizes
test_tc_int_buf
"
lib_dir=$(dirname $0)/../../../net/forwarding
NUM_NETIFS=0
source $lib_dir/lib.sh
source $lib_dir/devlink_lib.sh
swp=$NETIF_NO_CABLE
cleanup()
{
pre_cleanup
}
get_prio_pg()
{
# Produces a string of numbers "<B0> <B1> ... <B7> ", where BX is number
# of buffer that priority X is mapped to.
dcb -j buffer show dev $swp |
jq -r '[.prio_buffer | .[] | tostring + " "] | add'
}
get_prio_pfc()
{
# Produces a string of numbers "<P0> <P1> ... <P7> ", where PX denotes
# whether priority X has PFC enabled (the value is 1) or disabled (0).
dcb -j pfc show dev $swp |
jq -r '[.prio_pfc | .[] | if . then "1 " else "0 " end] | add'
}
get_prio_tc()
{
# Produces a string of numbers "<T0> <T1> ... <T7> ", where TC is number
# of TC that priority X is mapped to.
dcb -j ets show dev $swp |
jq -r '[.prio_tc | .[] | tostring + " "] | add'
}
get_buf_size()
{
local idx=$1; shift
dcb -j buffer show dev $swp | jq ".buffer_size[$idx]"
}
get_tot_size()
{
dcb -j buffer show dev $swp | jq '.total_size'
}
check_prio_pg()
{
local expect=$1; shift
local current=$(get_prio_pg)
test "$current" = "$expect"
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.