tools/testing/selftests/drivers/net/mlxsw/spectrum/devlink_resources.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/drivers/net/mlxsw/spectrum/devlink_resources.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/drivers/net/mlxsw/spectrum/devlink_resources.sh- Extension
.sh- Size
- 2376 bytes
- Lines
- 121
- 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
function profiles_test
Annotated Snippet
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
lib_dir=$(dirname $0)/../../../../net/forwarding
NUM_NETIFS=1
source $lib_dir/lib.sh
source devlink_lib_spectrum.sh
setup_prepare()
{
devlink_sp_read_kvd_defaults
}
cleanup()
{
pre_cleanup
devlink_sp_size_kvd_to_default
}
trap cleanup EXIT
setup_prepare
profiles_test()
{
local i
log_info "Running profile tests"
for i in $KVD_PROFILES; do
RET=0
devlink_sp_resource_kvd_profile_set $i
log_test "'$i' profile"
done
# Default is explicitly tested at end to ensure it's actually applied
RET=0
devlink_sp_resource_kvd_profile_set "default"
log_test "'default' profile"
}
resources_min_test()
{
local size
local i
local j
log_info "Running KVD-minimum tests"
for i in $KVD_CHILDREN; do
RET=0
size=$(devlink_resource_get kvd "$i" | jq '.["size_min"]')
devlink_resource_size_set "$size" kvd "$i"
# In case of linear, need to minimize sub-resources as well
if [[ "$i" == "linear" ]]; then
for j in $KVDL_CHILDREN; do
devlink_resource_size_set 0 kvd linear "$j"
done
fi
devlink_reload
devlink_sp_size_kvd_to_default
log_test "'$i' minimize [$size]"
done
}
resources_max_test()
{
Annotation
- Detected declarations: `function profiles_test`.
- 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.