Netdev List
 help / color / mirror / Atom feed
* [PATCH -next v3] net: core: set qdisc pkt len before tc_classify
@ 2015-05-13 22:36 Florian Westphal
  2015-05-13 22:49 ` Eric Dumazet
  2015-05-13 23:54 ` Alexei Starovoitov
  0 siblings, 2 replies; 4+ messages in thread
From: Florian Westphal @ 2015-05-13 22:36 UTC (permalink / raw)
  To: netdev; +Cc: Florian Westphal, Alexei Starovoitov, Eric Dumazet,
	Jamal Hadi Salim

commit d2788d34885d4ce5ba ("net: sched: further simplify handle_ing")
removed the call to qdisc_enqueue_root().

However, after this removal we no longer set qdisc pkt length.
This breaks traffic policing on ingress.

This is the minimum fix: set qdisc pkt length before tc_classify.

Only setting the length does remove support for 'stab' on ingress, but
as Alexei pointed out:
 "Though it was allowed to add qdisc_size_table to ingress, it's useless.
  Nothing takes advantage of recomputed qdisc_pkt_len".

Jamal suggested to use qdisc_pkt_len_init(), but as Eric mentioned that
would result in qdisc_pkt_len_init to no longer get inlined due to the
additional 2nd call site.

ingress policing is rare and GRO doesn't really work that well with police
on ingress, as we see packets > mtu and drop skbs that  -- without
aggregation -- would still have fitted the policier budget.
Thus to have reliable/smooth ingress policing GRO has to be turned off.

Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Fixes: d2788d34885d ("net: sched: further simplify handle_ing")
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Florian Westphal <fw@strlen.de>
---
Changes since v2: identical to v1: just use skb->len
Changes since v1: use qdisc_pkt_len_init instead of simply using skb->len

diff --git a/net/core/dev.c b/net/core/dev.c
index af54906..b3a92d6 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3646,8 +3646,9 @@ static inline struct sk_buff *handle_ing(struct sk_buff *skb,
 		*pt_prev = NULL;
 	}
 
-	qdisc_bstats_update_cpu(cl->q, skb);
+	qdisc_skb_cb(skb)->pkt_len = skb->len;
 	skb->tc_verd = SET_TC_AT(skb->tc_verd, AT_INGRESS);
+	qdisc_bstats_update_cpu(cl->q, skb);
 
 	switch (tc_classify(skb, cl, &cl_res)) {
 	case TC_ACT_OK:
-- 
2.0.5

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

* Re: [PATCH -next v3] net: core: set qdisc pkt len before tc_classify
  2015-05-13 22:36 [PATCH -next v3] net: core: set qdisc pkt len before tc_classify Florian Westphal
@ 2015-05-13 22:49 ` Eric Dumazet
  2015-05-13 23:54 ` Alexei Starovoitov
  1 sibling, 0 replies; 4+ messages in thread
From: Eric Dumazet @ 2015-05-13 22:49 UTC (permalink / raw)
  To: Florian Westphal; +Cc: netdev, Alexei Starovoitov, Jamal Hadi Salim

On Thu, 2015-05-14 at 00:36 +0200, Florian Westphal wrote:
> commit d2788d34885d4ce5ba ("net: sched: further simplify handle_ing")
> removed the call to qdisc_enqueue_root().
> 
> However, after this removal we no longer set qdisc pkt length.
> This breaks traffic policing on ingress.
> 
> This is the minimum fix: set qdisc pkt length before tc_classify.

Acked-by: Eric Dumazet <edumazet@google.com>

Thanks

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

* Re: [PATCH -next v3] net: core: set qdisc pkt len before tc_classify
  2015-05-13 22:36 [PATCH -next v3] net: core: set qdisc pkt len before tc_classify Florian Westphal
  2015-05-13 22:49 ` Eric Dumazet
@ 2015-05-13 23:54 ` Alexei Starovoitov
  2015-05-14  0:10   ` Jamal Hadi Salim
  1 sibling, 1 reply; 4+ messages in thread
From: Alexei Starovoitov @ 2015-05-13 23:54 UTC (permalink / raw)
  To: Florian Westphal; +Cc: netdev, Eric Dumazet, Jamal Hadi Salim

On Thu, May 14, 2015 at 12:36:28AM +0200, Florian Westphal wrote:
> commit d2788d34885d4ce5ba ("net: sched: further simplify handle_ing")
> removed the call to qdisc_enqueue_root().
> 
> However, after this removal we no longer set qdisc pkt length.
> This breaks traffic policing on ingress.
> 
> This is the minimum fix: set qdisc pkt length before tc_classify.

Thanks!
Acked-by: Alexei Starovoitov <ast@plumgrid.com>

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

* Re: [PATCH -next v3] net: core: set qdisc pkt len before tc_classify
  2015-05-13 23:54 ` Alexei Starovoitov
@ 2015-05-14  0:10   ` Jamal Hadi Salim
  0 siblings, 0 replies; 4+ messages in thread
From: Jamal Hadi Salim @ 2015-05-14  0:10 UTC (permalink / raw)
  To: Alexei Starovoitov, Florian Westphal; +Cc: netdev, Eric Dumazet

On 05/13/15 19:54, Alexei Starovoitov wrote:
> On Thu, May 14, 2015 at 12:36:28AM +0200, Florian Westphal wrote:
>> commit d2788d34885d4ce5ba ("net: sched: further simplify handle_ing")
>> removed the call to qdisc_enqueue_root().
>>
>> However, after this removal we no longer set qdisc pkt length.
>> This breaks traffic policing on ingress.
>>
>> This is the minimum fix: set qdisc pkt length before tc_classify.
>
> Thanks!
> Acked-by: Alexei Starovoitov <ast@plumgrid.com>
>

Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>

cheers,
jamal

PS:- dont agree with the statement that policer is rarely used
on ingress.

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

end of thread, other threads:[~2015-05-14  0:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-13 22:36 [PATCH -next v3] net: core: set qdisc pkt len before tc_classify Florian Westphal
2015-05-13 22:49 ` Eric Dumazet
2015-05-13 23:54 ` Alexei Starovoitov
2015-05-14  0:10   ` Jamal Hadi Salim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox