tools/testing/selftests/bpf/benchs/run_bench_xdp_lb.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/bpf/benchs/run_bench_xdp_lb.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/bpf/benchs/run_bench_xdp_lb.sh- Extension
.sh- Size
- 1674 bytes
- Lines
- 80
- 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 group_header
Annotated Snippet
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
source ./benchs/run_common.sh
set -eufo pipefail
WARMUP=${WARMUP:-3}
RUN="sudo ./bench -q -w${WARMUP} -a xdp-lb --machine-readable"
SEP=" +----------------------------------+----------+---------+----------+"
HDR=" | %-32s | %8s | %7s | %8s |\n"
ROW=" | %-32s | %8s | %7s | %8s |\n"
function group_header()
{
printf "%s\n" "$SEP"
printf "$HDR" "$1" "p50" "stddev" "p99"
printf "%s\n" "$SEP"
}
function rval()
{
echo "$1" | sed -nE "s/.*$2=([^ ]+).*/\1/p"
}
function run_scenario()
{
local sc="$1"
shift
local output rline
output=$($RUN --scenario "$sc" "$@" 2>&1) || true
rline=$(echo "$output" | grep '^RESULT ' || true)
if [ -z "$rline" ]; then
printf "$ROW" "$sc" "ERR" "-" "-"
return
fi
printf "$ROW" "$sc" \
"$(rval "$rline" median)" \
"$(rval "$rline" stddev)" \
"$(rval "$rline" p99)"
}
header "XDP load-balancer benchmark"
group_header "Single-flow baseline"
for sc in tcp-v4-lru-hit tcp-v4-ch \
tcp-v6-lru-hit tcp-v6-ch \
udp-v4-lru-hit udp-v6-lru-hit \
tcp-v4v6-lru-hit; do
run_scenario "$sc"
done
group_header "Diverse flows (4K src addrs)"
for sc in tcp-v4-lru-diverse tcp-v4-ch-diverse \
tcp-v6-lru-diverse tcp-v6-ch-diverse \
udp-v4-lru-diverse; do
run_scenario "$sc"
done
group_header "TCP flags"
run_scenario tcp-v4-syn
run_scenario tcp-v4-rst-miss
group_header "LRU stress"
run_scenario tcp-v4-lru-miss
Annotation
- Detected declarations: `function group_header`.
- 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.