netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 net-next] tc: remove unused redirect ttl
@ 2015-05-01  3:11 Alexei Starovoitov
  2015-05-01  8:57 ` Florian Westphal
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Alexei Starovoitov @ 2015-05-01  3:11 UTC (permalink / raw)
  To: David S. Miller
  Cc: Jamal Hadi Salim, Daniel Borkmann, Florian Westphal, netdev

improves ingress+u32 performance from 22.4 Mpps to 22.9 Mpps

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
---
The code is from Jamal. I only did testing and benchmarking.

V1->V2: missed removal of unused 'dev' variable.

 include/uapi/linux/pkt_cls.h |    2 ++
 net/core/dev.c               |    9 ---------
 2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/include/uapi/linux/pkt_cls.h b/include/uapi/linux/pkt_cls.h
index bf08e76bf505..f6344a522cd6 100644
--- a/include/uapi/linux/pkt_cls.h
+++ b/include/uapi/linux/pkt_cls.h
@@ -62,11 +62,13 @@ bits 9,10,11: redirect counter -  redirect TTL. Loop avoidance
 #define SET_TC_NCLS(v)   ( TC_NCLS | (v & ~TC_NCLS))
 #define CLR_TC_NCLS(v)   ( v & ~TC_NCLS)
 
+#ifndef __KERNEL__
 #define S_TC_RTTL          _TC_MAKE32(9)
 #define M_TC_RTTL          _TC_MAKEMASK(3,S_TC_RTTL)
 #define G_TC_RTTL(x)       _TC_GETVALUE(x,S_TC_RTTL,M_TC_RTTL)
 #define V_TC_RTTL(x)       _TC_MAKEVALUE(x,S_TC_RTTL)
 #define SET_TC_RTTL(v,n)   ((V_TC_RTTL(n)) | (v & ~M_TC_RTTL))
+#endif
 
 #define S_TC_AT          _TC_MAKE32(12)
 #define M_TC_AT          _TC_MAKEMASK(2,S_TC_AT)
diff --git a/net/core/dev.c b/net/core/dev.c
index c7ba0388f1be..97a15ae8d07a 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3531,18 +3531,9 @@ EXPORT_SYMBOL_GPL(br_fdb_test_addr_hook);
  */
 static int ing_filter(struct sk_buff *skb, struct netdev_queue *rxq)
 {
-	struct net_device *dev = skb->dev;
-	u32 ttl = G_TC_RTTL(skb->tc_verd);
 	int result = TC_ACT_OK;
 	struct Qdisc *q;
 
-	if (unlikely(MAX_RED_LOOP < ttl++)) {
-		net_warn_ratelimited("Redir loop detected Dropping packet (%d->%d)\n",
-				     skb->skb_iif, dev->ifindex);
-		return TC_ACT_SHOT;
-	}
-
-	skb->tc_verd = SET_TC_RTTL(skb->tc_verd, ttl);
 	skb->tc_verd = SET_TC_AT(skb->tc_verd, AT_INGRESS);
 
 	q = rcu_dereference(rxq->qdisc);
-- 
1.7.9.5

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

* Re: [PATCH v2 net-next] tc: remove unused redirect ttl
  2015-05-01  3:11 [PATCH v2 net-next] tc: remove unused redirect ttl Alexei Starovoitov
@ 2015-05-01  8:57 ` Florian Westphal
  2015-05-01 10:18 ` Sergei Shtylyov
  2015-05-01 12:46 ` Daniel Borkmann
  2 siblings, 0 replies; 11+ messages in thread
From: Florian Westphal @ 2015-05-01  8:57 UTC (permalink / raw)
  To: Alexei Starovoitov
  Cc: David S. Miller, Jamal Hadi Salim, Daniel Borkmann,
	Florian Westphal, netdev

Alexei Starovoitov <ast@plumgrid.com> wrote:
> improves ingress+u32 performance from 22.4 Mpps to 22.9 Mpps
> 
> Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
> Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
> ---
> The code is from Jamal. I only did testing and benchmarking.

I had similar patch, so
Acked-by: Florian Westphal <fw@strlen.de>

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

* Re: [PATCH v2 net-next] tc: remove unused redirect ttl
  2015-05-01  3:11 [PATCH v2 net-next] tc: remove unused redirect ttl Alexei Starovoitov
  2015-05-01  8:57 ` Florian Westphal
@ 2015-05-01 10:18 ` Sergei Shtylyov
  2015-05-01 17:28   ` Alexei Starovoitov
  2015-05-01 12:46 ` Daniel Borkmann
  2 siblings, 1 reply; 11+ messages in thread
From: Sergei Shtylyov @ 2015-05-01 10:18 UTC (permalink / raw)
  To: Alexei Starovoitov, David S. Miller
  Cc: Jamal Hadi Salim, Daniel Borkmann, Florian Westphal, netdev

Hello.

On 5/1/2015 6:11 AM, Alexei Starovoitov wrote:

> improves ingress+u32 performance from 22.4 Mpps to 22.9 Mpps

> Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
> Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
> ---
> The code is from Jamal. I only did testing and benchmarking.

    Then your patch should have had:

From: Jamal Hadi Salim <jhs@mojatatu.com>

before the change log, no?

> V1->V2: missed removal of unused 'dev' variable.

[...]

WBR, Sergei

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

* Re: [PATCH v2 net-next] tc: remove unused redirect ttl
  2015-05-01  3:11 [PATCH v2 net-next] tc: remove unused redirect ttl Alexei Starovoitov
  2015-05-01  8:57 ` Florian Westphal
  2015-05-01 10:18 ` Sergei Shtylyov
@ 2015-05-01 12:46 ` Daniel Borkmann
  2 siblings, 0 replies; 11+ messages in thread
From: Daniel Borkmann @ 2015-05-01 12:46 UTC (permalink / raw)
  To: Alexei Starovoitov, David S. Miller
  Cc: Jamal Hadi Salim, Florian Westphal, netdev

On 05/01/2015 05:11 AM, Alexei Starovoitov wrote:
> improves ingress+u32 performance from 22.4 Mpps to 22.9 Mpps
>
> Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
> Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>

Acked-by: Daniel Borkmann <daniel@iogearbox.net>

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

* Re: [PATCH v2 net-next] tc: remove unused redirect ttl
  2015-05-01 10:18 ` Sergei Shtylyov
@ 2015-05-01 17:28   ` Alexei Starovoitov
  2015-05-01 19:20     ` Sergei Shtylyov
  2015-05-01 20:33     ` Cong Wang
  0 siblings, 2 replies; 11+ messages in thread
From: Alexei Starovoitov @ 2015-05-01 17:28 UTC (permalink / raw)
  To: Sergei Shtylyov, David S. Miller
  Cc: Jamal Hadi Salim, Daniel Borkmann, Florian Westphal, netdev

On 5/1/15 3:18 AM, Sergei Shtylyov wrote:
> Hello.
>
> On 5/1/2015 6:11 AM, Alexei Starovoitov wrote:
>
>> improves ingress+u32 performance from 22.4 Mpps to 22.9 Mpps
>
>> Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
>> Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
>> ---
>> The code is from Jamal. I only did testing and benchmarking.
>
>     Then your patch should have had:
>
> From: Jamal Hadi Salim <jhs@mojatatu.com>
>
> before the change log, no?

I don't think that's how it works. I've applied Jamal's patch
then fixed few minor things. Therefore his SOB is on top and
mine below. 'From' has no DCO meaning. It's used from time to time
in merge request summary, but that's a different case.

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

* Re: [PATCH v2 net-next] tc: remove unused redirect ttl
  2015-05-01 17:28   ` Alexei Starovoitov
@ 2015-05-01 19:20     ` Sergei Shtylyov
  2015-05-01 20:33     ` Cong Wang
  1 sibling, 0 replies; 11+ messages in thread
From: Sergei Shtylyov @ 2015-05-01 19:20 UTC (permalink / raw)
  To: Alexei Starovoitov, David S. Miller
  Cc: Jamal Hadi Salim, Daniel Borkmann, Florian Westphal, netdev

On 5/1/2015 8:28 PM, Alexei Starovoitov wrote:

>>> improves ingress+u32 performance from 22.4 Mpps to 22.9 Mpps

>>> Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
>>> Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
>>> ---
>>> The code is from Jamal. I only did testing and benchmarking.

>>     Then your patch should have had:

>> From: Jamal Hadi Salim <jhs@mojatatu.com>

>> before the change log, no?

> I don't think that's how it works. I've applied Jamal's patch
> then fixed few minor things.

    You just said "I only did testing and benchmarking." :-)

> Therefore his SOB is on top and
> mine below. 'From' has no DCO meaning.

    Sorry, I don't know what DCO is, at least not in this context. :-)

> It's used from time to time
> in merge request summary, but that's a different case.

    I'm sure it's also used when you're submitting someone other's patches.

WBR, Sergei

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

* Re: [PATCH v2 net-next] tc: remove unused redirect ttl
  2015-05-01 17:28   ` Alexei Starovoitov
  2015-05-01 19:20     ` Sergei Shtylyov
@ 2015-05-01 20:33     ` Cong Wang
  2015-05-01 23:48       ` David Miller
  1 sibling, 1 reply; 11+ messages in thread
From: Cong Wang @ 2015-05-01 20:33 UTC (permalink / raw)
  To: Alexei Starovoitov
  Cc: Sergei Shtylyov, David S. Miller, Jamal Hadi Salim,
	Daniel Borkmann, Florian Westphal, netdev

On Fri, May 1, 2015 at 10:28 AM, Alexei Starovoitov <ast@plumgrid.com> wrote:
> I don't think that's how it works. I've applied Jamal's patch
> then fixed few minor things. Therefore his SOB is on top and
> mine below. 'From' has no DCO meaning. It's used from time to time
> in merge request summary, but that's a different case.


Quote from Documentation/SubmittingPatches:

"
The "from" line must be the very first line in the message body,
and has the form:

        From: Original Author <author@example.com>

The "from" line specifies who will be credited as the author of the
patch in the permanent changelog.  If the "from" line is missing,
then the "From:" line from the email header will be used to determine
the patch author in the changelog.
"

You should take a look at how Andrew Morton works
when he fixes minor things, I am sure he fixes much
more than you do.

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

* Re: [PATCH v2 net-next] tc: remove unused redirect ttl
  2015-05-01 20:33     ` Cong Wang
@ 2015-05-01 23:48       ` David Miller
  2015-05-02  3:15         ` Alexei Starovoitov
  0 siblings, 1 reply; 11+ messages in thread
From: David Miller @ 2015-05-01 23:48 UTC (permalink / raw)
  To: cwang; +Cc: ast, sergei.shtylyov, jhs, daniel, fw, netdev

From: Cong Wang <cwang@twopensource.com>
Date: Fri, 1 May 2015 13:33:28 -0700

> Quote from Documentation/SubmittingPatches:
> 
> "
> The "from" line must be the very first line in the message body,
> and has the form:
> 
>         From: Original Author <author@example.com>
> 
> The "from" line specifies who will be credited as the author of the
> patch in the permanent changelog.  If the "from" line is missing,
> then the "From:" line from the email header will be used to determine
> the patch author in the changelog.
> "
> 
> You should take a look at how Andrew Morton works
> when he fixes minor things, I am sure he fixes much
> more than you do.

+1

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

* Re: [PATCH v2 net-next] tc: remove unused redirect ttl
  2015-05-01 23:48       ` David Miller
@ 2015-05-02  3:15         ` Alexei Starovoitov
  2015-05-02  4:23           ` David Miller
  0 siblings, 1 reply; 11+ messages in thread
From: Alexei Starovoitov @ 2015-05-02  3:15 UTC (permalink / raw)
  To: David Miller, cwang; +Cc: sergei.shtylyov, jhs, daniel, fw, netdev

On 5/1/15 4:48 PM, David Miller wrote:
> From: Cong Wang <cwang@twopensource.com>
> Date: Fri, 1 May 2015 13:33:28 -0700
>
>> Quote from Documentation/SubmittingPatches:
>>
>> "
>> The "from" line must be the very first line in the message body,
>> and has the form:
>>
>>          From: Original Author <author@example.com>
>>
>> The "from" line specifies who will be credited as the author of the
>> patch in the permanent changelog.  If the "from" line is missing,
>> then the "From:" line from the email header will be used to determine
>> the patch author in the changelog.
>> "
>>
>> You should take a look at how Andrew Morton works
>> when he fixes minor things, I am sure he fixes much
>> more than you do.
>
> +1
>

Dave, please help me understand the rules here.
Jamal gave me untested patch that had 8 lines deleted and said
"untested... to push it please go ahead."
I've removed one more line and added 2 extra.
My understanding is that 'From' applies to 100% authorship, no?
If no, where is the line?
I've seen people adding 'joint work' line and add sobs in order
of contribution % where the guy who sends it to the list is the
last sob, right?
Or any follow up work that based even on 10% of initial patch should
have 'from' of the first author? That doesn't sound right.

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

* Re: [PATCH v2 net-next] tc: remove unused redirect ttl
  2015-05-02  3:15         ` Alexei Starovoitov
@ 2015-05-02  4:23           ` David Miller
  2015-05-02  4:52             ` Alexei Starovoitov
  0 siblings, 1 reply; 11+ messages in thread
From: David Miller @ 2015-05-02  4:23 UTC (permalink / raw)
  To: ast; +Cc: cwang, sergei.shtylyov, jhs, daniel, fw, netdev

From: Alexei Starovoitov <ast@plumgrid.com>
Date: Fri, 01 May 2015 20:15:49 -0700

> On 5/1/15 4:48 PM, David Miller wrote:
>> From: Cong Wang <cwang@twopensource.com>
>> Date: Fri, 1 May 2015 13:33:28 -0700
>>
>>> Quote from Documentation/SubmittingPatches:
>>>
>>> "
>>> The "from" line must be the very first line in the message body,
>>> and has the form:
>>>
>>>          From: Original Author <author@example.com>
>>>
>>> The "from" line specifies who will be credited as the author of the
>>> patch in the permanent changelog.  If the "from" line is missing,
>>> then the "From:" line from the email header will be used to determine
>>> the patch author in the changelog.
>>> "
>>>
>>> You should take a look at how Andrew Morton works
>>> when he fixes minor things, I am sure he fixes much
>>> more than you do.
>>
>> +1
>>
> 
> Dave, please help me understand the rules here.

If Jamal wrote the patch and you made some modifications it's
still his his patch so he gets authorship.

Who are you, Napoleon?

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

* Re: [PATCH v2 net-next] tc: remove unused redirect ttl
  2015-05-02  4:23           ` David Miller
@ 2015-05-02  4:52             ` Alexei Starovoitov
  0 siblings, 0 replies; 11+ messages in thread
From: Alexei Starovoitov @ 2015-05-02  4:52 UTC (permalink / raw)
  To: David Miller; +Cc: cwang, sergei.shtylyov, jhs, daniel, fw, netdev

On 5/1/15 9:23 PM, David Miller wrote:
>
> If Jamal wrote the patch and you made some modifications it's
> still his his patch so he gets authorship.

ok. no problem.

> Who are you, Napoleon?

is it a joke? If it is, it's a bad one.
I simply asked what are the rules for 'from' tag.
I don't care a single bit who gets the authorship.

Everyone on this list is looking at you as a model of behavior.
Let's keep it technical.

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

end of thread, other threads:[~2015-05-02  4:52 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-01  3:11 [PATCH v2 net-next] tc: remove unused redirect ttl Alexei Starovoitov
2015-05-01  8:57 ` Florian Westphal
2015-05-01 10:18 ` Sergei Shtylyov
2015-05-01 17:28   ` Alexei Starovoitov
2015-05-01 19:20     ` Sergei Shtylyov
2015-05-01 20:33     ` Cong Wang
2015-05-01 23:48       ` David Miller
2015-05-02  3:15         ` Alexei Starovoitov
2015-05-02  4:23           ` David Miller
2015-05-02  4:52             ` Alexei Starovoitov
2015-05-01 12:46 ` Daniel Borkmann

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).