tools/testing/selftests/drivers/net/hw/ethtool.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/drivers/net/hw/ethtool.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/drivers/net/hw/ethtool.sh- Extension
.sh- Size
- 6702 bytes
- Lines
- 298
- 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="
same_speeds_autoneg_off
different_speeds_autoneg_off
combination_of_neg_on_and_off
advertise_subset_of_speeds
check_highest_speed_is_chosen
different_speeds_autoneg_on
"
NUM_NETIFS=2
lib_dir=$(dirname "$0")
source "$lib_dir"/../../../net/forwarding/lib.sh
source ethtool_lib.sh
h1_create()
{
simple_if_init $h1 192.0.2.1/24
}
h1_destroy()
{
simple_if_fini $h1 192.0.2.1/24
}
h2_create()
{
simple_if_init $h2 192.0.2.2/24
}
h2_destroy()
{
simple_if_fini $h2 192.0.2.2/24
}
setup_prepare()
{
h1=${NETIFS[p1]}
h2=${NETIFS[p2]}
h1_create
h2_create
}
cleanup()
{
pre_cleanup
h2_destroy
h1_destroy
}
same_speeds_autoneg_off()
{
# Check that when each of the reported speeds is forced, the links come
# up and are operational.
local -a speeds_arr=($(common_speeds_get $h1 $h2 0 0))
for speed in "${speeds_arr[@]}"; do
RET=0
ethtool_set $h1 speed $speed autoneg off
ethtool_set $h2 speed $speed autoneg off
setup_wait_dev_with_timeout $h1
setup_wait_dev_with_timeout $h2
ping_do $h1 192.0.2.2
check_err $? "ping with speed $speed autoneg off"
log_test "force speed $speed on both ends"
done
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.