tools/testing/selftests/net/psock_snd.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/net/psock_snd.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/net/psock_snd.sh- Extension
.sh- Size
- 2252 bytes
- Lines
- 96
- 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
#
# Run a series of packet socket send regression tests
set -e
readonly mtu=1500
readonly iphlen=20
readonly udphlen=8
readonly vnet_hlen=10
readonly eth_hlen=14
readonly mss="$((${mtu} - ${iphlen} - ${udphlen}))"
readonly mss_exceeds="$((${mss} + 1))"
readonly max_mtu=65535
readonly max_mss="$((${max_mtu} - ${iphlen} - ${udphlen}))"
readonly max_mss_exceeds="$((${max_mss} + 1))"
# functional checks (not a full cross-product)
echo "dgram"
./in_netns.sh ./psock_snd -d
echo "dgram bind"
./in_netns.sh ./psock_snd -d -b
echo "raw"
./in_netns.sh ./psock_snd
echo "raw bind"
./in_netns.sh ./psock_snd -b
echo "raw qdisc bypass"
./in_netns.sh ./psock_snd -q
echo "raw vlan"
./in_netns.sh ./psock_snd -V
echo "raw vnet hdr"
./in_netns.sh ./psock_snd -v
echo "raw csum_off"
./in_netns.sh ./psock_snd -v -c
echo "raw csum_off with bad offset (expected to fail)"
(! ./in_netns.sh ./psock_snd -v -c -C)
# bounds check: send {max, max + 1, min, min - 1} lengths
echo "raw min size"
./in_netns.sh ./psock_snd -l 0
echo "raw mtu size"
./in_netns.sh ./psock_snd -l "${mss}"
echo "raw mtu size + 1 (expected to fail)"
(! ./in_netns.sh ./psock_snd -l "${mss_exceeds}")
# fails due to ARPHRD_ETHER check in packet_extra_vlan_len_allowed
#
# echo "raw vlan mtu size"
# ./in_netns.sh ./psock_snd -V -l "${mss}"
echo "raw vlan mtu size + 1 (expected to fail)"
(! ./in_netns.sh ./psock_snd -V -l "${mss_exceeds}")
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.