Commit b9f463d6 authored by Edward Cree's avatar Edward Cree Committed by David S. Miller

net: don't bother calling list RX functions on empty lists

Generally the check should be very cheap, as the sk_buff_head is in cache.
Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5fa12739
...@@ -4887,6 +4887,7 @@ static void __netif_receive_skb_list(struct list_head *head) ...@@ -4887,6 +4887,7 @@ static void __netif_receive_skb_list(struct list_head *head)
/* Handle the previous sublist */ /* Handle the previous sublist */
list_cut_before(&sublist, head, &skb->list); list_cut_before(&sublist, head, &skb->list);
if (!list_empty(&sublist))
__netif_receive_skb_list_core(&sublist, pfmemalloc); __netif_receive_skb_list_core(&sublist, pfmemalloc);
pfmemalloc = !pfmemalloc; pfmemalloc = !pfmemalloc;
/* See comments in __netif_receive_skb */ /* See comments in __netif_receive_skb */
...@@ -4897,6 +4898,7 @@ static void __netif_receive_skb_list(struct list_head *head) ...@@ -4897,6 +4898,7 @@ static void __netif_receive_skb_list(struct list_head *head)
} }
} }
/* Handle the remaining sublist */ /* Handle the remaining sublist */
if (!list_empty(head))
__netif_receive_skb_list_core(head, pfmemalloc); __netif_receive_skb_list_core(head, pfmemalloc);
/* Restore pflags */ /* Restore pflags */
if (pfmemalloc) if (pfmemalloc)
...@@ -5058,6 +5060,8 @@ void netif_receive_skb_list(struct list_head *head) ...@@ -5058,6 +5060,8 @@ void netif_receive_skb_list(struct list_head *head)
{ {
struct sk_buff *skb; struct sk_buff *skb;
if (list_empty(head))
return;
list_for_each_entry(skb, head, list) list_for_each_entry(skb, head, list)
trace_netif_receive_skb_list_entry(skb); trace_netif_receive_skb_list_entry(skb);
netif_receive_skb_list_internal(head); netif_receive_skb_list_internal(head);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment