tools/testing/selftests/drivers/net/bonding/dev_addr_lists.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/drivers/net/bonding/dev_addr_lists.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/drivers/net/bonding/dev_addr_lists.sh- Extension
.sh- Size
- 2103 bytes
- Lines
- 110
- 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 destroy
Annotated Snippet
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
#
# Test bond device handling of addr lists (dev->uc, mc)
#
ALL_TESTS="
bond_cleanup_mode1
bond_cleanup_mode4
bond_listen_lacpdu_multicast_case_down
bond_listen_lacpdu_multicast_case_up
"
REQUIRE_MZ=no
NUM_NETIFS=0
lib_dir=$(dirname "$0")
source "$lib_dir"/../../../net/forwarding/lib.sh
source "$lib_dir"/lag_lib.sh
destroy()
{
local ifnames=(dummy1 dummy2 bond1 mv0)
local ifname
for ifname in "${ifnames[@]}"; do
ip link del "$ifname" &>/dev/null
done
}
cleanup()
{
pre_cleanup
destroy
}
# bond driver control paths vary between modes that have a primary slave
# (bond_uses_primary()) and others. Test both kinds of modes.
bond_cleanup_mode1()
{
RET=0
test_LAG_cleanup "bonding" "active-backup"
}
bond_cleanup_mode4() {
RET=0
test_LAG_cleanup "bonding" "802.3ad"
}
bond_listen_lacpdu_multicast()
{
# Initial state of bond device, up | down
local init_state=$1
local lacpdu_mc="01:80:c2:00:00:02"
ip link add dummy1 type dummy
ip link add bond1 "$init_state" type bond mode 802.3ad
ip link set dev dummy1 master bond1
if [ "$init_state" = "down" ]; then
ip link set dev bond1 up
fi
grep_bridge_fdb "$lacpdu_mc" bridge fdb show brport dummy1 >/dev/null
check_err $? "LACPDU multicast address not present on slave (1)"
Annotation
- Detected declarations: `function destroy`.
- 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.