Skip to content

Commit

Permalink
Merge branch 'docs-document-some-aspects-of-struct-sk_buff'
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jakub Kicinski committed May 11, 2022
2 parents be76955 + 9facd94 commit 4c0c6e4
Show file tree
Hide file tree
Showing 3 changed files with 232 additions and 107 deletions.
1 change: 1 addition & 0 deletions Documentation/networking/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ Contents:
sctp
secid
seg6-sysctl
skbuff
smc-sysctl
statistics
strparser
Expand Down
37 changes: 37 additions & 0 deletions Documentation/networking/skbuff.rst
Original file line number Diff line number Diff line change
@@ -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
Loading

0 comments on commit 4c0c6e4

Please sign in to comment.