skb_shinfo(skb1)->frags[0].page_offset += len - pos; skb_shinfo(skb1)->frags[0].size -= len - pos; skb_shinfo(skb)->frags[i].size = len - pos; skb_shinfo(skb)->nr_frags++; } k++; } else skb_shinfo(skb)->nr_frags++; pos += size; } skb_shinfo(skb1)->nr_frags ...
skb_shinfo(skb)->frag_list = clone; } } pull_pages: eat = delta; k = 0; //释放frags中的page for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { if (skb_shinfo(skb)->frags[i].size <= eat) { put_page(skb_shinfo(skb)->frags[i].page); eat -= skb_shinfo(skb)->...
skb_shinfo(skb)->nr_frags = i; }while(i < frags) {intrem;if(i ==0)break; rem = skb_shinfo(skb)->frags[i-1].size/2;if(rem ==0)break; skb_shinfo(skb)->frags[i-1].size -= rem; skb_shinfo(skb)->frags[i] = skb_shinfo(skb)->frags[i-1]; get_page(skb_shinfo(skb)-...
len = skb_headlen(skb); nr_frags = skb_shinfo(skb)->nr_frags;for(i =0; i <2&& i < nr_frags; i++) len += skb_shinfo(skb)->frags[i].size;/* HW requires header must reside in 3 buffer */if(unlikely(hdr_len > len)) {if(skb_linearize(skb))return0; } }if(!mss || ...
{inti, k =0;//开始设置sk_buff结构数据区内容constintnfrags = skb_shinfo(skb)->nr_frags; skb_shinfo(skb)->nr_frags =0; skb1->len = skb1->data_len = skb->len -len; skb->len =len; skb->data_len = len -pos;//这是循环拆分分片结构数据区数据for(i =0; i < nfrags; i++...
一个宏 : skb_shinfo 来完成寻找 skb_shared_info 结构指针的操作. 最后,系统初始化 skb_shared_info 结构的成员变量 : atomic_set(&(skb_shinfo(skb)->dataref), 1); skb_shinfo(skb)->nr_frags = 0; skb_shinfo(skb)->tso_size = 0; ...
i) goto end; eat = 0; } k++; } } // nr_frags设置为k skb_shinfo(skb)->nr_frags = k; end: // tail增加data skb->tail += delta; // 非线性数据减去delta skb->data_len -= delta; if (!skb->data_len) skb_zcopy_clear(skb, false); return skb_tail_pointer(skb); } 基本...
一个宏 : skb_shinfo 来完成寻找 skb_shared_info 结构指针的操作. 最后,系统初始化 skb_shared_info 结构的成员变量 : atomic_set(&(skb_shinfo(skb)->dataref), 1); skb_shinfo(skb)->nr_frags = 0; skb_shinfo(skb)->tso_size = 0; ...
一个宏 : skb_shinfo 来完成寻找 skb_shared_info 结构指针的操作. 最后,系统初始化 skb_shared_info 结构的成员变量 : atomic_set(&(skb_shinfo(skb)->dataref), 1); skb_shinfo(skb)->nr_frags = 0; skb_shinfo(skb)->tso_size = 0; ...
intnfrags=skb_shinfo(head_skb)->nr_frags; interr=-ENOMEM; inti=0; intpos; proto=skb_network_protocol(skb); proto=skb_network_protocol(head_skb); if(unlikely(!proto)) returnERR_PTR(-EINVAL); csum=!!can_checksum_protocol(features,proto); ...