tools/testing/selftests/bpf/progs/test_tc_link.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/bpf/progs/test_tc_link.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/bpf/progs/test_tc_link.c- Extension
.c- Size
- 2348 bytes
- Lines
- 130
- 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
stdbool.hlinux/bpf.hlinux/if_ether.hlinux/stddef.hlinux/if_packet.hbpf/bpf_endian.hbpf/bpf_helpers.hbpf/bpf_core_read.h
Detected Declarations
struct sk_buffstruct net_devicefunction tc1function tc2function tc3function tc4function tc5function tc6function tc7function tc8
Annotated Snippet
struct sk_buff {
struct net_device *dev;
};
struct net_device {
unsigned short needed_headroom;
unsigned short needed_tailroom;
};
SEC("tc/egress")
int tc8(struct __sk_buff *skb)
{
struct net_device *dev = BPF_CORE_READ((struct sk_buff *)skb, dev);
seen_tc8 = true;
mark = skb->mark;
prio = skb->priority;
headroom = BPF_CORE_READ(dev, needed_headroom);
tailroom = BPF_CORE_READ(dev, needed_tailroom);
return TCX_PASS;
}
Annotation
- Immediate include surface: `stdbool.h`, `linux/bpf.h`, `linux/if_ether.h`, `linux/stddef.h`, `linux/if_packet.h`, `bpf/bpf_endian.h`, `bpf/bpf_helpers.h`, `bpf/bpf_core_read.h`.
- Detected declarations: `struct sk_buff`, `struct net_device`, `function tc1`, `function tc2`, `function tc3`, `function tc4`, `function tc5`, `function tc6`, `function tc7`, `function tc8`.
- 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.