From: Li RongQing Date: Mon, 8 Dec 2014 01:42:55 +0000 (+0800) Subject: net: avoid to call skb_queue_len again X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e008f3f07ffba2be471ffd79bd1922af0042f936;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git net: avoid to call skb_queue_len again the queue length of sd->input_pkt_queue has been put into qlen, and impossible to change, since hold the lock Signed-off-by: Li RongQing Acked-by: Eric Dumazet Cc: Sergei Shtylyov Signed-off-by: David S. Miller --- diff --git a/net/core/dev.c b/net/core/dev.c index dd3bf582e6f0..3f191da383f6 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -3297,7 +3297,7 @@ static int enqueue_to_backlog(struct sk_buff *skb, int cpu, rps_lock(sd); qlen = skb_queue_len(&sd->input_pkt_queue); if (qlen <= netdev_max_backlog && !skb_flow_limit(skb, qlen)) { - if (skb_queue_len(&sd->input_pkt_queue)) { + if (qlen) { enqueue: __skb_queue_tail(&sd->input_pkt_queue, skb); input_queue_tail_incr_save(sd, qtail);