= 1; if (skb_cloned(skb)) { if (skb_orphan_frags(skb, gfp_mask)) goto nofrags; if (skb_zcopy(skb)) refcount_inc(&skb_uarg(skb)->refcnt); for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) skb_frag_ref(skb, i); if (skb_has_frag_list(skb)) skb_clone_fraglist(sk...
*/if(skb_has_frag_list(skb)) {structsk_buff*frag, *frag2;intfirst_len = skb_pagelen(skb);if(first_len - hlen > mtu || ((first_len - hlen) &7) || ip_is_fragment(iph) || skb_cloned(skb))gotoslow_path; skb_walk_frags(skb, frag) {/* Correct geometry. */if(frag->len ...
*/// 一个小优化,frag_list没有就直接从frags开始if(!skb_has_frag_list(skb))gotopull_pages;// eat被赋值为传入的delta,而不是上面算出来的需要多少字节eat = delta;// nr_frags是frags有效的字段数for(i =0; i <skb_shinfo(skb)->nr_frags; i++) {// 拿到page中数据的长度intsize =skb_frag...
1/**2* skb_clone - duplicate an sk_buff3* @skb: buffer to clone4* @gfp_mask: allocation priority5*6* Duplicate an &sk_buff. The new one is not owned by a socket. Both7* copies share the same packet data but not structure. The new8* buffer has a reference count of 1. If t...
*/if(skb_has_frag_list(head)) {structsk_buff*clone;inti, plen =0; clone =alloc_skb(0, GFP_ATOMIC);if(!clone)gotoout_oom; clone->next = head->next; head->next = clone; skb_shinfo(clone)->frag_list = skb_shinfo(head)->frag_list; ...
第二就是什么时候会使用no-linear,frag_list在处理IP分片时被使用,可以查看内核中的ip_fragment->ip_do_fragment函数,[1][2][3]中对这个部分的描述并不够详细,或者说对frags对描述还不够详细。
skb_frag_ref(skb, i); if(skb_has_frag_list(skb)) skb_clone_fraglist(skb); // 如果引用计数为0就free包括非线性区内的所有数据 skb_release_data(skb); }else{ // 把原来的data free掉 skb_free_head(skb); } //不知道这个off有什么意义,可能与NET_SKBUFF_DATA_USES_OFFSET有关 ...
bool full_pkt) } if (full_pkt && skb_has_frag_list(skb)) { - printk("skb fraglist:\n"); + pr_info("skb fraglist:\n"); skb_walk_frags(skb, list_skb) skb_dump(level, list_skb, true); } -- 1.8.3.1
Ian reported several skb corruptions triggered by rx-gro-list, collecting different oops alike: [ 62.624003] BUG: kernel NULL pointer dereference, address: 00000000000000c0 [ 62.631083] #PF: supervisor read access in kernel mode [ 62.636312] #PF: error_code(0x0000) - not-present page [ 62.6415...
if (WARN_ON_ONCE(skb_shinfo(skb)->gso_type & SKB_GSO_FRAGLIST)) return NULL; @@ -2483,6 +2489,9 @@ struct sk_buff *skb_copy_expand(const struct sk_buff *skb, struct sk_buff *n; int oldheadroom; if (!skb_frags_readable(skb)) return NULL; if (WARN_ON_ONCE(skb_shinfo(skb...