netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][net-next] net: avoid to call skb_queue_len again
@ 2014-12-05  9:49 roy.qing.li
  2014-12-05 13:24 ` Eric Dumazet
  2014-12-05 14:06 ` Sergei Shtylyov
  0 siblings, 2 replies; 8+ messages in thread
From: roy.qing.li @ 2014-12-05  9:49 UTC (permalink / raw)
  To: netdev

From: Li RongQing <roy.qing.li@gmail.com>

the queue length of sd->input_pkt_queue has been putted into qlen,
and impossible to change, since hold the lock

Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
---
 net/core/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 0814a56..b954400 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);
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-12-08 16:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-05  9:49 [PATCH][net-next] net: avoid to call skb_queue_len again roy.qing.li
2014-12-05 13:24 ` Eric Dumazet
2014-12-05 14:06 ` Sergei Shtylyov
2014-12-05 14:31   ` Eric Dumazet
2014-12-08  0:46     ` Li RongQing
2014-12-08 11:28       ` Sergei Shtylyov
2014-12-08 15:10         ` Eric Dumazet
2014-12-08 16:51           ` Sergei Shtylyov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).