User Tools

Site Tools


mywiki:linux:skb

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
mywiki:linux:skb [2021/10/07 11:11] – [skb_headroom(), skb_tailroom()] shaoguohmywiki:linux:skb [2022/04/02 17:29] (current) – external edit 127.0.0.1
Line 47: Line 47:
  
  
-| linear/non-paged skb API | non-linear/paged skb API via skb_shared | +
-| skb_push |  NA | +
-| skb_pull | **p**skb_pull: p means **paged** | +
-| skb_put | pskb_put | +
-| skb_trim | pskb_trim |+
 ====== skb_reserve() ====== ====== skb_reserve() ======
 Prototype / Description:  Prototype / Description: 
 | void skb_reserve(struct sk_buff *skb, unsigned int len); | adjust headroom \\ skb->data += len; \\ skb->tail += len; | | void skb_reserve(struct sk_buff *skb, unsigned int len); | adjust headroom \\ skb->data += len; \\ skb->tail += len; |
 {{:mywiki:linux:skb_reserve.png?direct|}} {{:mywiki:linux:skb_reserve.png?direct|}}
 +| linear/non-paged skb API | non-linear/paged skb API via skb_shared |
 +| skb_push | NA |
 +| skb_pull | **p**skb_pull: p means **paged** |
 +| skb_put | pskb_put |
 +| skb_trim | pskb_trim |
 +
 ====== skb_push() ====== ====== skb_push() ======
 Prototype / Description: Prototype / Description:
Line 118: Line 120:
 } </file> } </file>
  
 +
 +
 +====== other skb APIs ======
 +  * skb_orphan():  使SKB不属于任何传输控制块。
 +     * skb->destructor(skb);
 +     * skb->destructor = NULL;
 +     * skb->sk = NULL;
 +  * skb_cow(): 确保SKB存在指定的headroom空间。如果不足,会重新分配。
 +     * skb_cow - copy header of skb when it is required, iek, if the skb passed lacks sufficient headroom or its data part is shared, data is reallocated. If reallocation fails, an error is returned and original skb is not changed.
 +  * skb_condense(): try to get rid of fragments/frag_list if possible. Can be used to save memory before skb is added to a busy queue. If packet has bytes in frags and enough tail room in skb->head, pull all of them, so that we can free the frags right now and adjust truesize.
mywiki/linux/skb.1633576300.txt.gz · Last modified: (external edit)