summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2022-05-10 17:48:40 -0700
committerJakub Kicinski <kuba@kernel.org>2022-05-10 17:48:41 -0700
commit4c0c6e4cf775653d597ba3ce48c5a137d5849443 (patch)
tree78f8c270eb81e3bf7b55b4dad23cf310f6a4b5b0 /Documentation
parentbe76955dea93fe7ee9e0a6f961a7185290a2417f (diff)
parent9facd94114b59afebd405e74b3bc2bf184efe986 (diff)
Merge branch 'docs-document-some-aspects-of-struct-sk_buff'
Jakub Kicinski says: ==================== docs: document some aspects of struct sk_buff This small set creates a place to render sk_buff documentation, documents one random thing (data-only skbs) and converts the big checksum comment to kdoc. ==================== Link: https://lore.kernel.org/r/20220323233715.2104106-1-kuba@kernel.org/ Link: https://lore.kernel.org/r/20220324231312.2241166-1-kuba@kernel.org/ Link: https://lore.kernel.org/r/20220509160456.1058940-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/networking/index.rst1
-rw-r--r--Documentation/networking/skbuff.rst37
2 files changed, 38 insertions, 0 deletions
diff --git a/Documentation/networking/index.rst b/Documentation/networking/index.rst
index 72cf33579b78..a1c271fe484e 100644
--- a/Documentation/networking/index.rst
+++ b/Documentation/networking/index.rst
@@ -97,6 +97,7 @@ Contents:
sctp
secid
seg6-sysctl
+ skbuff
smc-sysctl
statistics
strparser
diff --git a/Documentation/networking/skbuff.rst b/Documentation/networking/skbuff.rst
new file mode 100644
index 000000000000..5b74275a73a3
--- /dev/null
+++ b/Documentation/networking/skbuff.rst
@@ -0,0 +1,37 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+struct sk_buff
+==============
+
+:c:type:`sk_buff` is the main networking structure representing
+a packet.
+
+Basic sk_buff geometry
+----------------------
+
+.. kernel-doc:: include/linux/skbuff.h
+ :doc: Basic sk_buff geometry
+
+Shared skbs and skb clones
+--------------------------
+
+:c:member:`sk_buff.users` is a simple refcount allowing multiple entities
+to keep a struct sk_buff alive. skbs with a ``sk_buff.users != 1`` are referred
+to as shared skbs (see skb_shared()).
+
+skb_clone() allows for fast duplication of skbs. None of the data buffers
+get copied, but caller gets a new metadata struct (struct sk_buff).
+&skb_shared_info.refcount indicates the number of skbs pointing at the same
+packet data (i.e. clones).
+
+dataref and headerless skbs
+---------------------------
+
+.. kernel-doc:: include/linux/skbuff.h
+ :doc: dataref and headerless skbs
+
+Checksum information
+--------------------
+
+.. kernel-doc:: include/linux/skbuff.h
+ :doc: skb checksums