net/core/skb_fault_injection.c
Source file repositories/reference/linux-study-clean/net/core/skb_fault_injection.c
File Facts
- System
- Linux kernel
- Corpus path
net/core/skb_fault_injection.c- Extension
.c- Size
- 2366 bytes
- Lines
- 107
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/debugfs.hlinux/fault-inject.hlinux/netdevice.hlinux/skbuff.h
Detected Declarations
function should_fail_net_realloc_skbfunction skb_might_reallocfunction fail_skb_realloc_setupfunction reset_settingsfunction devname_writefunction devname_readfunction fail_skb_realloc_debugfsexport skb_might_realloc
Annotated Snippet
static const struct file_operations devname_ops = {
.write = devname_write,
.read = devname_read,
};
static int __init fail_skb_realloc_debugfs(void)
{
umode_t mode = S_IFREG | 0600;
struct dentry *dir;
dir = fault_create_debugfs_attr("fail_skb_realloc", NULL,
&skb_realloc.attr);
if (IS_ERR(dir))
return PTR_ERR(dir);
debugfs_create_file("devname", mode, dir, NULL, &devname_ops);
return 0;
}
late_initcall(fail_skb_realloc_debugfs);
Annotation
- Immediate include surface: `linux/debugfs.h`, `linux/fault-inject.h`, `linux/netdevice.h`, `linux/skbuff.h`.
- Detected declarations: `function should_fail_net_realloc_skb`, `function skb_might_realloc`, `function fail_skb_realloc_setup`, `function reset_settings`, `function devname_write`, `function devname_read`, `function fail_skb_realloc_debugfs`, `export skb_might_realloc`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: pattern implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.