net: avoid to call skb_queue_len again
authorLi RongQing <roy.qing.li@gmail.com>
Mon, 8 Dec 2014 01:42:55 +0000 (09:42 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 9 Dec 2014 22:03:19 +0000 (17:03 -0500)
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>
net/core/dev.c

index dd3bf582e6f0a180c7fb0135fde35b3f0c6a8ac6..3f191da383f6197dedc6dcf5468d7b646d29a85a 100644 (file)
@@ -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);