tools/testing/selftests/drivers/net/team/non_ether_header_ops.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/drivers/net/team/non_ether_header_ops.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/drivers/net/team/non_ether_header_ops.sh- Extension
.sh- Size
- 1191 bytes
- Lines
- 42
- 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
# shellcheck disable=SC2154
#
# Reproduce the non-Ethernet header_ops confusion scenario with:
# g0 (gre) -> b0 (bond) -> t0 (team)
#
# Before the fix, direct header_ops inheritance in this stack could call
# callbacks with the wrong net_device context and crash.
lib_dir=$(dirname "$0")
source "$lib_dir"/../../../net/lib.sh
trap cleanup_all_ns EXIT
setup_ns ns1
ip -n "$ns1" link add d0 type dummy
ip -n "$ns1" addr add 10.10.10.1/24 dev d0
ip -n "$ns1" link set d0 up
ip -n "$ns1" link add g0 type gre local 10.10.10.1
ip -n "$ns1" link add b0 type bond mode active-backup
ip -n "$ns1" link add t0 type team
ip -n "$ns1" link set g0 master b0
ip -n "$ns1" link set b0 master t0
ip -n "$ns1" link set g0 up
ip -n "$ns1" link set b0 up
ip -n "$ns1" link set t0 up
# IPv6 address assignment triggers MLD join reports that call
# dev_hard_header() on t0, exercising the inherited header_ops path.
ip -n "$ns1" -6 addr add 2001:db8:1::1/64 dev t0 nodad
for i in $(seq 1 20); do
ip netns exec "$ns1" ping -6 -I t0 ff02::1 -c1 -W1 &>/dev/null || true
done
echo "PASS: non-Ethernet header_ops stacking did not crash"
exit "$EXIT_STATUS"
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.