Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <roy.qing.li@gmail.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Li RongQing and committed by
David S. Miller
e008f3f0 5d6201e1

+1 -1
+1 -1
net/core/dev.c
··· 3297 3297 rps_lock(sd); 3298 3298 qlen = skb_queue_len(&sd->input_pkt_queue); 3299 3299 if (qlen <= netdev_max_backlog && !skb_flow_limit(skb, qlen)) { 3300 - if (skb_queue_len(&sd->input_pkt_queue)) { 3300 + if (qlen) { 3301 3301 enqueue: 3302 3302 __skb_queue_tail(&sd->input_pkt_queue, skb); 3303 3303 input_queue_tail_incr_save(sd, qtail);