tools/testing/selftests/net/udpgso.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/net/udpgso.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/net/udpgso.c- Extension
.c- Size
- 13368 bytes
- Lines
- 626
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
stddef.harpa/inet.herror.herrno.hnet/if.hlinux/in.hlinux/netlink.hlinux/rtnetlink.hnetinet/if_ether.hnetinet/ip.hnetinet/ip6.hnetinet/udp.hstdbool.hstdlib.hstdio.hstring.hsys/ioctl.hsys/socket.hsys/stat.hsys/time.hsys/types.hunistd.h
Detected Declarations
struct testcasefunction set_pmtu_discoverfunction get_path_mtufunction __send_onefunction send_onefunction recv_onefunction run_onefunction run_allfunction run_testfunction run_test_v4function run_test_v6function parse_optsfunction main
Annotated Snippet
struct testcase {
int tlen; /* send() buffer size, may exceed mss */
bool tfail; /* send() call is expected to fail */
int gso_len; /* mss after applying gso */
int r_num_mss; /* recv(): number of calls of full mss */
int r_len_last; /* recv(): size of last non-mss dgram, if any */
bool v6_ext_hdr; /* send() dgrams with IPv6 extension headers */
};
const struct in6_addr addr6 = {
{ { 0xfd, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 } }, /* fd00::1 */
};
const struct in_addr addr4 = {
__constant_htonl(0x0a000001), /* 10.0.0.1 */
};
static const char ipv6_hopopts_pad1[8] = { 0 };
struct testcase testcases_v4[] = {
{
/* no GSO: send a single byte */
.tlen = 1,
.r_len_last = 1,
},
{
/* no GSO: send a single MSS */
.tlen = CONST_MSS_V4,
.r_num_mss = 1,
},
{
/* no GSO: send a single MSS + 1B: fail */
.tlen = CONST_MSS_V4 + 1,
.tfail = true,
},
{
/* send a single MSS: will fall back to no GSO */
.tlen = CONST_MSS_V4,
.gso_len = CONST_MSS_V4,
.r_num_mss = 1,
},
{
/* datalen <= MSS < gso_len: will fall back to no GSO */
.tlen = CONST_MSS_V4,
.gso_len = CONST_MSS_V4 + 1,
.r_num_mss = 0,
.r_len_last = CONST_MSS_V4,
},
{
/* MSS < datalen < gso_len: fail */
.tlen = CONST_MSS_V4 + 1,
.gso_len = CONST_MSS_V4 + 2,
.tfail = true,
},
{
/* send a single MSS + 1B */
.tlen = CONST_MSS_V4 + 1,
.gso_len = CONST_MSS_V4,
.r_num_mss = 1,
.r_len_last = 1,
},
{
/* send exactly 2 MSS */
.tlen = CONST_MSS_V4 * 2,
.gso_len = CONST_MSS_V4,
.r_num_mss = 2,
},
{
/* send 2 MSS + 1B */
.tlen = (CONST_MSS_V4 * 2) + 1,
.gso_len = CONST_MSS_V4,
.r_num_mss = 2,
.r_len_last = 1,
},
{
/* send MAX segs */
.tlen = (ETH_MAX_MTU / CONST_MSS_V4) * CONST_MSS_V4,
.gso_len = CONST_MSS_V4,
.r_num_mss = (ETH_MAX_MTU / CONST_MSS_V4),
},
{
/* send MAX bytes */
.tlen = ETH_MAX_MTU - CONST_HDRLEN_V4,
.gso_len = CONST_MSS_V4,
.r_num_mss = CONST_MAX_SEGS_V4,
.r_len_last = ETH_MAX_MTU - CONST_HDRLEN_V4 -
(CONST_MAX_SEGS_V4 * CONST_MSS_V4),
},
{
Annotation
- Immediate include surface: `stddef.h`, `arpa/inet.h`, `error.h`, `errno.h`, `net/if.h`, `linux/in.h`, `linux/netlink.h`, `linux/rtnetlink.h`.
- Detected declarations: `struct testcase`, `function set_pmtu_discover`, `function get_path_mtu`, `function __send_one`, `function send_one`, `function recv_one`, `function run_one`, `function run_all`, `function run_test`, `function run_test_v4`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
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.