All of lore.kernel.org
 help / color / mirror / Atom feed
* [net PATCH v3 0/1] tc reclassification needs to consider ether protocol changes
@ 2016-02-18 12:38 Jamal Hadi Salim
  2016-02-18 12:38 ` [net PATCH v3 1/1] net_sched fix: " Jamal Hadi Salim
  0 siblings, 1 reply; 4+ messages in thread
From: Jamal Hadi Salim @ 2016-02-18 12:38 UTC (permalink / raw)
  To: davem; +Cc: netdev, daniel, xiyou.wangcong, Jamal Hadi Salim

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

v3:
Cong says this needs to go to -net. And to put back the removed new line

v2:
Use Daniel's suggestion on when to set the skb proto

v1:
fix compile error found by build bot when CONFIG_NET_CLS_ACT was off

Jamal Hadi Salim (1):
  net_sched fix: reclassification needs to consider ether protocol
    changes

 net/sched/sch_api.c | 1 +
 1 file changed, 1 insertion(+)

-- 
1.9.1

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

* [net PATCH v3 1/1] net_sched fix: reclassification needs to consider ether protocol changes
  2016-02-18 12:38 [net PATCH v3 0/1] tc reclassification needs to consider ether protocol changes Jamal Hadi Salim
@ 2016-02-18 12:38 ` Jamal Hadi Salim
  2016-02-18 12:43   ` Daniel Borkmann
  2016-02-18 16:15   ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Jamal Hadi Salim @ 2016-02-18 12:38 UTC (permalink / raw)
  To: davem; +Cc: netdev, daniel, xiyou.wangcong, Jamal Hadi Salim

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

actions could change the etherproto in particular with ethernet
tunnelled data. Typically such actions, after peeling the outer header,
will ask for the packet to be  reclassified. We then need to restart
the classification with the new proto header.

Example setup used to catch this:
sudo tc qdisc add dev $ETH ingress
sudo $TC filter add dev $ETH parent ffff: pref 1 protocol 802.1Q \
u32 match u32 0 0 flowid 1:1 \
action  vlan pop reclassify

Fixes: 3b3ae880266d ("net: sched: consolidate tc_classify{,_compat}")
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
---
 net/sched/sch_api.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index b5c2cf2..af1acf0 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -1852,6 +1852,7 @@ reset:
 	}
 
 	tp = old_tp;
+	protocol = tc_skb_protocol(skb);
 	goto reclassify;
 #endif
 }
-- 
1.9.1

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

* Re: [net PATCH v3 1/1] net_sched fix: reclassification needs to consider ether protocol changes
  2016-02-18 12:38 ` [net PATCH v3 1/1] net_sched fix: " Jamal Hadi Salim
@ 2016-02-18 12:43   ` Daniel Borkmann
  2016-02-18 16:15   ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: Daniel Borkmann @ 2016-02-18 12:43 UTC (permalink / raw)
  To: Jamal Hadi Salim, davem; +Cc: netdev, xiyou.wangcong

On 02/18/2016 01:38 PM, Jamal Hadi Salim wrote:
> From: Jamal Hadi Salim <jhs@mojatatu.com>
>
> actions could change the etherproto in particular with ethernet
> tunnelled data. Typically such actions, after peeling the outer header,
> will ask for the packet to be  reclassified. We then need to restart
> the classification with the new proto header.
>
> Example setup used to catch this:
> sudo tc qdisc add dev $ETH ingress
> sudo $TC filter add dev $ETH parent ffff: pref 1 protocol 802.1Q \
> u32 match u32 0 0 flowid 1:1 \
> action  vlan pop reclassify
>
> Fixes: 3b3ae880266d ("net: sched: consolidate tc_classify{,_compat}")
> Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>

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

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

* Re: [net PATCH v3 1/1] net_sched fix: reclassification needs to consider ether protocol changes
  2016-02-18 12:38 ` [net PATCH v3 1/1] net_sched fix: " Jamal Hadi Salim
  2016-02-18 12:43   ` Daniel Borkmann
@ 2016-02-18 16:15   ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2016-02-18 16:15 UTC (permalink / raw)
  To: jhs; +Cc: netdev, daniel, xiyou.wangcong

From: Jamal Hadi Salim <jhs@mojatatu.com>
Date: Thu, 18 Feb 2016 07:38:04 -0500

> From: Jamal Hadi Salim <jhs@mojatatu.com>
> 
> actions could change the etherproto in particular with ethernet
> tunnelled data. Typically such actions, after peeling the outer header,
> will ask for the packet to be  reclassified. We then need to restart
> the classification with the new proto header.
> 
> Example setup used to catch this:
> sudo tc qdisc add dev $ETH ingress
> sudo $TC filter add dev $ETH parent ffff: pref 1 protocol 802.1Q \
> u32 match u32 0 0 flowid 1:1 \
> action  vlan pop reclassify
> 
> Fixes: 3b3ae880266d ("net: sched: consolidate tc_classify{,_compat}")
> Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>

Applied and queued up for -stable, thanks Jamal.

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

end of thread, other threads:[~2016-02-18 16:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-18 12:38 [net PATCH v3 0/1] tc reclassification needs to consider ether protocol changes Jamal Hadi Salim
2016-02-18 12:38 ` [net PATCH v3 1/1] net_sched fix: " Jamal Hadi Salim
2016-02-18 12:43   ` Daniel Borkmann
2016-02-18 16:15   ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.