提交 1f14bd99 编写于 作者: Y Yunsheng Lin 提交者: David S. Miller

net: remove unnecessary NULL checking in napi_consume_skb()

When budget is non-zero, skb_unref() has already handled the
NULL checking.

When budget is zero, the dev_consume_skb_any() has handled NULL
checking in __dev_kfree_skb_irq(), or dev_kfree_skb() which also
ultimately call skb_unref().

So remove the unnecessary checking in napi_consume_skb().
Signed-off-by: NYunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 52731441
...@@ -895,9 +895,6 @@ void __kfree_skb_defer(struct sk_buff *skb) ...@@ -895,9 +895,6 @@ void __kfree_skb_defer(struct sk_buff *skb)
void napi_consume_skb(struct sk_buff *skb, int budget) void napi_consume_skb(struct sk_buff *skb, int budget)
{ {
if (unlikely(!skb))
return;
/* Zero budget indicate non-NAPI context called us, like netpoll */ /* Zero budget indicate non-NAPI context called us, like netpoll */
if (unlikely(!budget)) { if (unlikely(!budget)) {
dev_consume_skb_any(skb); dev_consume_skb_any(skb);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册