tools/testing/selftests/drivers/net/mlxsw/sharedbuffer.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/drivers/net/mlxsw/sharedbuffer.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/drivers/net/mlxsw/sharedbuffer.sh- Extension
.sh- Size
- 5370 bytes
- Lines
- 244
- 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="
port_pool_test
port_tc_ip_test
port_tc_arp_test
"
NUM_NETIFS=2
source ../../../net/forwarding/lib.sh
source ../../../net/forwarding/devlink_lib.sh
source mlxsw_lib.sh
SB_POOL_ING=0
SB_POOL_EGR_CPU=10
SB_ITC_CPU_IP=2
SB_ITC_CPU_ARP=2
SB_ITC=0
h1_create()
{
simple_if_init $h1 192.0.1.1/24
tc qdisc add dev $h1 clsact
# Add egress filter on $h1 that will guarantee that the packet sent,
# will be the only packet being passed to the device.
tc filter add dev $h1 egress pref 2 handle 102 matchall action drop
}
h1_destroy()
{
tc filter del dev $h1 egress pref 2 handle 102 matchall action drop
tc qdisc del dev $h1 clsact
simple_if_fini $h1 192.0.1.1/24
}
h2_create()
{
simple_if_init $h2 192.0.1.2/24
tc qdisc add dev $h2 clsact
# Add egress filter on $h2 that will guarantee that the packet sent,
# will be the only packet being passed to the device.
tc filter add dev $h2 egress pref 1 handle 101 matchall action drop
}
h2_destroy()
{
tc filter del dev $h2 egress pref 1 handle 101 matchall action drop
tc qdisc del dev $h2 clsact
simple_if_fini $h2 192.0.1.2/24
}
sb_occ_pool_check()
{
local dl_port=$1; shift
local pool=$1; shift
local exp_max_occ=$1
local max_occ
local err=0
max_occ=$(devlink sb -j occupancy show $dl_port \
| jq -e ".[][][\"pool\"][\"$pool\"][\"max\"]")
if [[ "$max_occ" -ne "$exp_max_occ" ]]; then
err=1
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.