include/linux/skbuff.h
Source file repositories/reference/linux-study-clean/include/linux/skbuff.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/skbuff.h- Extension
.h- Size
- 156798 bytes
- Lines
- 5463
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/compiler.hlinux/time.hlinux/bug.hlinux/bvec.hlinux/cache.hlinux/rbtree.hlinux/socket.hlinux/refcount.hlinux/atomic.hasm/types.hlinux/spinlock.hnet/checksum.hlinux/rcupdate.hlinux/dma-mapping.hlinux/netdev_features.hnet/flow_dissector.hlinux/in6.hlinux/if_packet.hlinux/llist.hlinux/page_frag_cache.hnet/flow.hlinux/netfilter/nf_conntrack_common.hnet/net_debug.hnet/dropreason-core.hnet/netmem.h
Detected Declarations
struct net_devicestruct scatterliststruct pipe_inode_infostruct iov_iterstruct napi_structstruct bpf_progstruct skb_extstruct ts_configstruct nf_bridge_infostruct tc_skb_extstruct sk_buff_headstruct sk_buffstruct skb_shared_hwtstampsstruct ubuf_info_opsstruct ubuf_infostruct ubuf_info_msgzcstruct mmpinstruct xsk_tx_metadata_complstruct skb_shared_infostruct sk_buffstruct sk_buff_fclonesstruct skb_seq_statestruct bpf_flow_dissectorstruct net_devmem_dmabuf_bindingstruct skb_extenum skb_tstamp_typeenum pkt_hash_typesenum skb_ext_idfunction skb_frag_sizefunction skb_frag_size_setfunction skb_frag_size_addfunction skb_frag_size_subfunction skb_frag_must_loopfunction skb_pfmemallocfunction skb_dst_check_unsetfunction skb_dstref_stealfunction skb_dstref_restorefunction skb_dst_dropfunction skb_dst_set_noreffunction skb_dst_is_noreffunction skb_pkt_type_okfunction skb_napi_idfunction skb_wifi_acked_validfunction skb_unreffunction skb_data_unreffunction kfree_skb_reasonfunction kfree_skbfunction kfree_skb_list
Annotated Snippet
struct nf_bridge_info {
enum {
BRNF_PROTO_UNCHANGED,
BRNF_PROTO_8021Q,
BRNF_PROTO_PPPOE
} orig_proto:8;
u8 pkt_otherhost:1;
u8 in_prerouting:1;
u8 bridged_dnat:1;
u8 sabotage_in_done:1;
__u16 frag_max_size;
int physinif;
/* always valid & non-NULL from FORWARD on, for physdev match */
struct net_device *physoutdev;
union {
/* prerouting: detect dnat in orig/reply direction */
__be32 ipv4_daddr;
struct in6_addr ipv6_daddr;
/* after prerouting + nat detected: store original source
* mac since neigh resolution overwrites it, only used while
* skb is out in neigh layer.
*/
char neigh_header[8];
};
};
#endif
#if IS_ENABLED(CONFIG_NET_TC_SKB_EXT)
/* Chain in tc_skb_ext will be used to share the tc chain with
* ovs recirc_id. It will be set to the current chain by tc
* and read by ovs to recirc_id.
*/
struct tc_skb_ext {
union {
u64 act_miss_cookie;
__u32 chain;
};
__u16 mru;
__u16 zone;
u8 post_ct:1;
u8 post_ct_snat:1;
u8 post_ct_dnat:1;
u8 act_miss:1; /* Set if act_miss_cookie is used */
u8 l2_miss:1; /* Set by bridge upon FDB or MDB miss */
};
#endif
struct sk_buff_head {
/* These two members must be first to match sk_buff. */
struct_group_tagged(sk_buff_list, list,
struct sk_buff *next;
struct sk_buff *prev;
);
__u32 qlen;
spinlock_t lock;
};
struct sk_buff;
#ifndef CONFIG_MAX_SKB_FRAGS
# define CONFIG_MAX_SKB_FRAGS 17
#endif
#define MAX_SKB_FRAGS CONFIG_MAX_SKB_FRAGS
/* Set skb_shinfo(skb)->gso_size to this in case you want skb_segment to
* segment using its current segmentation instead.
*/
#define GSO_BY_FRAGS 0xFFFF
typedef struct skb_frag {
netmem_ref netmem;
unsigned int len;
unsigned int offset;
} skb_frag_t;
/**
* skb_frag_size() - Returns the size of a skb fragment
* @frag: skb fragment
*/
static inline unsigned int skb_frag_size(const skb_frag_t *frag)
{
return frag->len;
}
/**
* skb_frag_size_set() - Sets the size of a skb fragment
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/compiler.h`, `linux/time.h`, `linux/bug.h`, `linux/bvec.h`, `linux/cache.h`, `linux/rbtree.h`, `linux/socket.h`.
- Detected declarations: `struct net_device`, `struct scatterlist`, `struct pipe_inode_info`, `struct iov_iter`, `struct napi_struct`, `struct bpf_prog`, `struct skb_ext`, `struct ts_config`, `struct nf_bridge_info`, `struct tc_skb_ext`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- 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.