Skip to contentSkip to conversation

net: avoid to call skb_queue_len again

PATCH Superseded [email protected] 3 participants 8 messages Dec 5, 2014 – Dec 8, 2014

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: avoid to call skb_queue_len again

From: Li RongQing <[email protected]>

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

---
 net/core/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/dev.c +1 -1
index 0814a56..b954400 100644
@@ -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);
Signature · 1 line
2.1.0
Acked-by on v1 1/1
#1 lore raw
Quoted 15 lines · On Fri, 2014-12-05 at 17:49 +0800, [email protected] wrote:

From: Li RongQing <[email protected]>

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

---
 net/core/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/dev.c +0 -0
index 0814a56..b954400 100644

net/core/dev.c static int enqueue_to_backlog(struct sk_buff *skb, int cpu, · line 3303

Quoted 8 lines
net/core/dev.c +1 -1
@@ -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);

Thanks !

#3 lore raw
Quoted 6 lines · Sergei Shtylyov

Hello.

Quoted 1 line · On 12/5/2014 12:49 PM, [email protected] wrote:

From: Li RongQing <[email protected]>

Quoted 7 lines
Quoted 1 line

the queue length of sd->input_pkt_queue has been putted into qlen,

s/putted/put/, it's irregular verb.

Quoted 1 line

and impossible to change, since hold the lock

I can't parse that. Who holds the lock?

This thread/cpu holds the lock to manipulate input_pkt_queue.

Otherwise, the following would break horribly....

__skb_queue_tail(&sd->input_pkt_queue, skb);

#4 lore raw
Quoted 11 lines · Eric Dumazet
Quoted 10 lines · Sergei Shtylyov

Hello.

Quoted 3 lines · On 12/5/2014 12:49 PM, [email protected] wrote:

From: Li RongQing <[email protected]>

the queue length of sd->input_pkt_queue has been putted into qlen,

s/putted/put/, it's irregular verb.

I will fix it and resend this patch

Quoted 11 lines
Quoted 3 lines
Quoted 1 line

and impossible to change, since hold the lock

I can't parse that. Who holds the lock?

This thread/cpu holds the lock to manipulate input_pkt_queue.

Otherwise, the following would break horribly....

__skb_queue_tail(&sd->input_pkt_queue, skb);

Thanks Eric

-Roy

Quoted 1 line
#5 lore raw

Hello.

Quoted 12 lines · Li RongQing
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

From: Li RongQing <[email protected]>

the queue length of sd->input_pkt_queue has been putted into qlen,

s/putted/put/, it's irregular verb.

I will fix it and resend this patch

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

and impossible to change, since hold the lock

I can't parse that. Who holds the lock?

Quoted 7 lines
Quoted 5 lines

This thread/cpu holds the lock to manipulate input_pkt_queue.

Otherwise, the following would break horribly....

__skb_queue_tail(&sd->input_pkt_queue, skb);

Thanks Eric

I expect you to also refine the description, so that it's meaningful,
unlike now.

Quoted 1 line

-Roy

WBR, Sergei

#6 lore raw
Quoted 3 lines · Sergei Shtylyov

I expect you to also refine the description, so that it's meaningful,
unlike now.

It seems obvious to me Li is not a native English speaker. I understood the patch very well, and the changelog seemed fine to me.

What about you provide this description instead, since you seem to care very much ?

Thanks !

#7 lore raw

Hello.

Quoted 4 lines · Eric Dumazet
Quoted 2 lines

I expect you to also refine the description, so that it's meaningful,
unlike now.

It seems obvious to me Li is not a native English speaker.

Me neither. :-)
However, the good command of English language was a requirement when I was
first hired to do the Linux development.

Quoted 2 lines

I understood
the patch very well, and the changelog seemed fine to me.

Oh, if you say so...

Quoted 2 lines

What about you provide this description instead, since you seem to care very much ?

I mostly care for others; I don't suppose much people except you are able
to understand the current variant. And I now have neither enough time nor enough understanding to write a proper description for this patch. I can only suggest that you refine the description for others if you can understand it so well.

Quoted 1 line

Thanks !

Not at all.

WBR, Sergei