tools/testing/selftests/net/test_ingress_egress_chaining.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/net/test_ingress_egress_chaining.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/net/test_ingress_egress_chaining.sh- Extension
.sh- Size
- 2193 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 fail
Annotated Snippet
function fail() {
echo "FAIL: $@" >> /dev/stderr
exit 1
}
function cleanup() {
killall -q -9 udpgso_bench_rx
ip link del $veth1 &> /dev/null
ip link del $veth2 &> /dev/null
ip netns del $ns &> /dev/null
}
trap cleanup EXIT
function config() {
echo "Setup veth pairs [$veth1, $peer1], and veth pair [$veth2, $peer2]"
ip link add $veth1 type veth peer name $peer1
ip link add $veth2 type veth peer name $peer2
ip addr add $ip_peer1/24 dev $peer1
ip link set $peer1 up
ip netns add $ns
ip link set dev $peer2 netns $ns
ip netns exec $ns ip addr add $ip_peer2/24 dev $peer2
ip netns exec $ns ip link set $peer2 up
ip link set $veth1 up
ip link set $veth2 up
echo "Add tc filter ingress->egress forwarding $veth1 <-> $veth2"
tc qdisc add dev $veth2 ingress
tc qdisc add dev $veth1 ingress
tc filter add dev $veth2 ingress prio 1 proto all flower \
action mirred egress redirect dev $veth1
tc filter add dev $veth1 ingress prio 1 proto all flower \
action mirred egress redirect dev $veth2
echo "Add tc filter egress->ingress forwarding $peer1 -> $veth1, bypassing the veth pipe"
tc qdisc add dev $peer1 clsact
tc filter add dev $peer1 egress prio 20 proto ip flower \
action mirred ingress redirect dev $veth1
}
function test_run() {
echo "Run tcp traffic"
./udpgso_bench_rx -t &
sleep 1
ip netns exec $ns timeout -k 2 10 ./udpgso_bench_tx -t -l 2 -4 -D $ip_peer1 || fail "traffic failed"
echo "Test passed"
}
config
test_run
trap - EXIT
cleanup
Annotation
- Detected declarations: `function fail`.
- 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.