· void skb_clone_fraglist(struct sk_buff *skb) · void skb_drop_fraglist(struct sk_buff *skb) · void copy_skb_header(struct sk_buff *new, const struct sk_buff *old) · pskb_expand_head(struct sk_buff *skb, int nhead, int ntail, gfp_t gfp_mask) · int skb_copy_bits(const...
skb_frag_t*nskb_frag; inthsize; intsize; len=skb->len-offset; len=head_skb->len-offset; if(len>mss) len=mss; hsize=skb_headlen(skb)-offset; hsize=skb_headlen(head_skb)-offset; if(hsize<0) hsize=0; if(hsize>len||!sg)
·void skb_drop_fraglist(struct sk_buff *skb) ·void copy_skb_header(struct sk_buff *new, const struct sk_buff *old) ·pskb_expand_head(struct sk_buff *skb, int nhead, int ntail, gfp_t gfp_mask) ·int skb_copy_bits(const struct sk_buff *skb, int offset, void *to, int len...
struct iwl_cmd_meta *out_meta){inti;for(i =0; i < skb_shinfo(skb)->nr_frags; i++) {constskb_frag_t*frag = &skb_shinfo(skb)->frags[i];dma_addr_ttb_phys;inttb_idx;if(!skb_frag_size(frag))continue; tb_phys = skb_frag_dma_map(trans->dev, frag,0,skb_frag_size(frag),...
skb_frag_t frags[MAX_SKB_FRAGS]; }; 我们只要把 end 从 char* 转换成skb_shared_info* ,就能访问到这个结构 Linux 提供一个宏来做这种转换: #define skb_shinfo(SKB) ((struct skb_shared_info *)((SKB)->end)) 那么,这个隐藏的结构用意何在?
skb->next = skb_shinfo(skb)->frag_list;skb_frag_list_init(skb); skb->len -= flen; skb->data_len -= flen; skb->truesize -= flen; skb_reserve(rskb, MAX_PHONET_HEADER +3);returnpipe_skb_send(sk, rskb); } 开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:30,代码来源...
const skb_frag_t *f = &skb_shinfo(skb)->frags[seg]; @@ -3391,6 +3409,9 @@ int skb_store_bits(struct sk_buff *skb, int offset, const void *from, int len) from += copy; } if (!skb_frags_readable(skb)) goto fault; for (i = 0; i < skb_shinfo(skb)->nr_frags; i+...
intsize = skb_frag_size(&skb_shinfo(skb)->frags[i]); if(size <= eat) { // 释放对frag(skb->frags[i])的引用。 skb_frag_unref(skb, i); eat-= size; }else{ skb_frag_t*frag = &skb_shinfo(skb)->frags[k]; // 这里把不需要拷贝到线性区的frags[k]拷贝到frags[i] ...
[SK_BUFF]: Introduce skb_network_offset() For the quite common 'skb->nh.raw - skb->data' sequence. Signed-off-by: Arnaldo Carvalho de Melo <[EMAIL PROTECTED]> Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- drivers/isdn/i4l/isdn_net.c | 2 +- drivers/net/atl1/atl1_...
(2)sk_buff->data_len: data_len只计算分片中数据的长度,即skb_shared_info中有效数据总长度(包括frag_list,frags[]中的扩展数据),一般为0 (3)sk_buff->truesize:这是缓冲区的总长度,包括sk_buff结构和数据部分。如果申请一个len字节的缓冲区,alloc_skb函数会把它初始化成len+sizeof(sk_buff)。当skb-...