consume_skb 表示 skb是正常释放。 kfree_skb 表示因为某种错误报文被丢弃。 这只会带来某些网络统计数据上的区别,例如使用drop_watch查看有多少异常丢包的时候。 通过源码上也可以看到,两者实现基本一致,除了调用不同的统计分析函数: trace_consume_skb, trace_kfree_skb /** * consume_skb - free an skbuff *...
根据内核代码对于dev_kfree_skb(其实是consume_skb的包装)的注释: 1/**2* consume_skb - free an skbuff3* @skb: buffer to free4*5* Drop a ref to the buffer and free it if the usage count has hit zero6* Functions identically to kfree_skb, but kfree_skb assumes that the frame7* is...
51CTO博客已为您找到关于kfree_skb的相关内容,包含IT学习相关文档代码介绍、相关教程视频课程,以及kfree_skb问答内容。更多kfree_skb相关解答可以来51CTO博客参与分享和学习,帮助广大IT技术人实现成长和进步。
*/voidconsume_skb(struct sk_buff *skb){if(unlikely(!skb))return;elseif(likely(!atomic_dec_and_test(&skb->users)))return;__kfree_skb(skb); } EXPORT_SYMBOL(consume_skb); 开发者ID:foxwolf,项目名称:yjd,代码行数:18,代码来源:skbuff.c 示例4: dccp_disconnect ▲点赞 1▼ intdccp_disconne...
dev_kfree_skb && consume_skb –减少skb引用,为0则释放,成功状态下释放skb使用; 1/**2* consume_skb - free an skbuff3* @skb: buffer to free4*5* Drop a ref to the buffer and free it if the usage count has hit zero6* Functions identically to kfree_skb, but kfree_skb assumes that...
Modified kfree_skb() void kfree_skb(struct sk_buff *skb) { //if (!skb_unref(skb)) // return; trace_kfree_skb(skb, __builtin_return_address(0)); __kfree_skb(skb); } Original consume_skb() void consume_skb(struct sk_buff *skb) { if (!skb_unref(skb)) return; trace_con...
if (!skb) return 0; netif_rx(skb); skb_get(skb); if (netif_rx(skb) == NET_RX_SUCCESS) dev_consume_skb_any(skb); else dev_kfree_skb_any(skb); return len; } 0 comments on commit 2283f79 Please sign in to comment. Footer...
*/kfree_skb(skb);returnerr; } 开发者ID:mikebyrne,项目名称:linux-2.6,代码行数:62,代码来源:ip6_output.c 示例6: ip_local_deliver_finish ▲点赞 1▼ staticinlineintip_local_deliver_finish(struct sk_buff *skb){intihl = skb->nh.iph->ihl*4;#ifdefCONFIG_NETFILTER_DEBUGnf_debug_ip_local...
*/kfree_skb(skb);returnerr; } 开发者ID:mikebyrne,项目名称:linux-2.6,代码行数:62,代码来源:ip6_output.c 示例6: ip_local_deliver_finish ▲点赞 1▼ staticinlineintip_local_deliver_finish(struct sk_buff *skb){intihl = skb->nh.iph->ihl*4;#ifdefCONFIG_NETFILTER_DEBUGnf_debug_ip_local...
lp->stats.rx_bytes += length;/* Alloc new skb for rx_frame ringbuffer */newskb = dev_alloc_skb( PKT_BUF_SZ );if(newskb ==NULL) {/* We assume that we can consume and produce the RX ring * buffer at the same time. In this case, we cannot ...