tools/testing/selftests/net/lwt_dst_cache_ref_loop.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/net/lwt_dst_cache_ref_loop.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/net/lwt_dst_cache_ref_loop.sh- Extension
.sh- Size
- 6081 bytes
- Lines
- 247
- 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+
#
# Author: Justin Iurman <justin.iurman@uliege.be>
#
# WARNING
# -------
# This is just a dummy script that triggers encap cases with possible dst cache
# reference loops in affected lwt users (see list below). Some cases are
# pathological configurations for simplicity, others are valid. Overall, we
# don't want this issue to happen, no matter what. In order to catch any
# reference loops, kmemleak MUST be used. The results alone are always blindly
# successful, don't rely on them. Note that the following tests may crash the
# kernel if the fix to prevent lwtunnel_{input|output|xmit}() reentry loops is
# not present.
#
# Affected lwt users so far (please update accordingly if needed):
# - ila_lwt (output only)
# - ioam6_iptunnel (output only)
# - rpl_iptunnel (both input and output)
# - seg6_iptunnel (both input and output)
source lib.sh
check_compatibility()
{
setup_ns tmp_node &>/dev/null
if [ $? != 0 ]; then
echo "SKIP: Cannot create netns."
exit $ksft_skip
fi
ip link add name veth0 netns $tmp_node type veth \
peer name veth1 netns $tmp_node &>/dev/null
local ret=$?
ip -netns $tmp_node link set veth0 up &>/dev/null
ret=$((ret + $?))
ip -netns $tmp_node link set veth1 up &>/dev/null
ret=$((ret + $?))
if [ $ret != 0 ]; then
echo "SKIP: Cannot configure links."
cleanup_ns $tmp_node
exit $ksft_skip
fi
lsmod 2>/dev/null | grep -q "ila"
ila_lsmod=$?
[ $ila_lsmod != 0 ] && modprobe ila &>/dev/null
ip -netns $tmp_node route add 2001:db8:1::/64 \
encap ila 1:2:3:4 csum-mode no-action ident-type luid \
hook-type output \
dev veth0 &>/dev/null
ip -netns $tmp_node route add 2001:db8:2::/64 \
encap ioam6 trace prealloc type 0x800000 ns 0 size 4 \
dev veth0 &>/dev/null
ip -netns $tmp_node route add 2001:db8:3::/64 \
encap rpl segs 2001:db8:3::1 dev veth0 &>/dev/null
ip -netns $tmp_node route add 2001:db8:4::/64 \
encap seg6 mode inline segs 2001:db8:4::1 dev veth0 &>/dev/null
ip -netns $tmp_node -6 route 2>/dev/null | grep -q "encap ila"
skip_ila=$?
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.