Merge tag 'block-6.0-2022-08-12' of git://git.kernel.dk/linux-block
[linux-2.6-microblaze.git] / Documentation / networking / skbuff.rst
1 .. SPDX-License-Identifier: GPL-2.0
2
3 struct sk_buff
4 ==============
5
6 :c:type:`sk_buff` is the main networking structure representing
7 a packet.
8
9 Basic sk_buff geometry
10 ----------------------
11
12 .. kernel-doc:: include/linux/skbuff.h
13    :doc: Basic sk_buff geometry
14
15 Shared skbs and skb clones
16 --------------------------
17
18 :c:member:`sk_buff.users` is a simple refcount allowing multiple entities
19 to keep a struct sk_buff alive. skbs with a ``sk_buff.users != 1`` are referred
20 to as shared skbs (see skb_shared()).
21
22 skb_clone() allows for fast duplication of skbs. None of the data buffers
23 get copied, but caller gets a new metadata struct (struct sk_buff).
24 &skb_shared_info.refcount indicates the number of skbs pointing at the same
25 packet data (i.e. clones).
26
27 dataref and headerless skbs
28 ---------------------------
29
30 .. kernel-doc:: include/linux/skbuff.h
31    :doc: dataref and headerless skbs
32
33 Checksum information
34 --------------------
35
36 .. kernel-doc:: include/linux/skbuff.h
37    :doc: skb checksums