diff options
author | Jakub Kicinski <kuba@kernel.org> | 2022-05-09 09:04:54 -0700 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-05-10 17:48:31 -0700 |
commit | ddccc9ef55992716ad477d38fbcd9f8f1d34fc67 (patch) | |
tree | 4bfea333e50b020b900ce7199b287347a5f2ac66 /Documentation/networking | |
parent | be76955dea93fe7ee9e0a6f961a7185290a2417f (diff) | |
download | linux-stable-ddccc9ef55992716ad477d38fbcd9f8f1d34fc67.tar.gz linux-stable-ddccc9ef55992716ad477d38fbcd9f8f1d34fc67.tar.bz2 linux-stable-ddccc9ef55992716ad477d38fbcd9f8f1d34fc67.zip |
skbuff: add a basic intro doc
Add basic skb documentation. It's mostly an intro to the subsequent
patches - it would looks strange if we documented advanced topics
without covering the basics in any way.
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'Documentation/networking')
-rw-r--r-- | Documentation/networking/skbuff.rst | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Documentation/networking/skbuff.rst b/Documentation/networking/skbuff.rst new file mode 100644 index 000000000000..b4a008feceb4 --- /dev/null +++ b/Documentation/networking/skbuff.rst @@ -0,0 +1,25 @@ +.. 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). |