-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Jakub Kicinski
committed
May 11, 2022
1 parent
be76955
commit ddccc9e
Showing
2 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters