tools/testing/selftests/drivers/net/mlxsw/fib_offload.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/drivers/net/mlxsw/fib_offload.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/drivers/net/mlxsw/fib_offload.sh- Extension
.sh- Size
- 10164 bytes
- Lines
- 350
- 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
#
# Test unicast FIB offload indication.
lib_dir=$(dirname $0)/../../../net/forwarding
ALL_TESTS="
ipv6_route_add
ipv6_route_replace
ipv6_route_nexthop_group_share
ipv6_route_rate
"
NUM_NETIFS=4
source $lib_dir/lib.sh
source $lib_dir/devlink_lib.sh
tor1_create()
{
simple_if_init $tor1_p1 2001:db8:1::2/128 2001:db8:1::3/128
}
tor1_destroy()
{
simple_if_fini $tor1_p1 2001:db8:1::2/128 2001:db8:1::3/128
}
tor2_create()
{
simple_if_init $tor2_p1 2001:db8:2::2/128 2001:db8:2::3/128
}
tor2_destroy()
{
simple_if_fini $tor2_p1 2001:db8:2::2/128 2001:db8:2::3/128
}
spine_create()
{
ip link set dev $spine_p1 up
ip link set dev $spine_p2 up
__addr_add_del $spine_p1 add 2001:db8:1::1/64
__addr_add_del $spine_p2 add 2001:db8:2::1/64
}
spine_destroy()
{
__addr_add_del $spine_p2 del 2001:db8:2::1/64
__addr_add_del $spine_p1 del 2001:db8:1::1/64
ip link set dev $spine_p2 down
ip link set dev $spine_p1 down
}
ipv6_offload_check()
{
local pfx="$1"; shift
local expected_num=$1; shift
local num
# Try to avoid races with route offload
sleep .1
num=$(ip -6 route show match ${pfx} | grep "offload" | wc -l)
if [ $num -eq $expected_num ]; then
return 0
fi
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.