tools/testing/selftests/drivers/net/mlxsw/rif_mac_profiles.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/drivers/net/mlxsw/rif_mac_profiles.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/drivers/net/mlxsw/rif_mac_profiles.sh- Extension
.sh- Size
- 4758 bytes
- Lines
- 214
- 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
lib_dir=$(dirname $0)/../../../net/forwarding
ALL_TESTS="
mac_profile_test
"
NUM_NETIFS=4
source $lib_dir/lib.sh
source $lib_dir/tc_common.sh
source $lib_dir/devlink_lib.sh
h1_create()
{
simple_if_init $h1 192.0.2.1/24
ip route add 198.51.100.0/24 vrf v$h1 nexthop via 192.0.2.2
tc qdisc add dev $h1 ingress
}
h1_destroy()
{
tc qdisc del dev $h1 ingress
ip route del 198.51.100.0/24 vrf v$h1
simple_if_fini $h1 192.0.2.1/24
}
h2_create()
{
simple_if_init $h2 198.51.100.1/24
ip route add 192.0.2.0/24 vrf v$h2 nexthop via 198.51.100.2
tc qdisc add dev $h2 ingress
}
h2_destroy()
{
tc qdisc del dev $h2 ingress
ip route del 192.0.2.0/24 vrf v$h2
simple_if_fini $h2 198.51.100.1/24
}
router_create()
{
ip link set dev $rp1 up
ip link set dev $rp2 up
tc qdisc add dev $rp1 clsact
tc qdisc add dev $rp2 clsact
ip address add 192.0.2.2/24 dev $rp1
ip address add 198.51.100.2/24 dev $rp2
}
router_destroy()
{
ip address del 198.51.100.2/24 dev $rp2
ip address del 192.0.2.2/24 dev $rp1
tc qdisc del dev $rp2 clsact
tc qdisc del dev $rp1 clsact
ip link set dev $rp2 down
ip link set dev $rp1 down
}
setup_prepare()
{
h1=${NETIFS[p1]}
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.