netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC net-next 0/2] net/sched: cls_flower, act_mirred: VXLAN redirect using TC
@ 2016-08-14 14:06 Amir Vadai
  2016-08-14 14:06 ` [RFC net-next 1/2] net/sched: cls_flower: Introduce classify by vxlan outer headers Amir Vadai
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Amir Vadai @ 2016-08-14 14:06 UTC (permalink / raw)
  To: Jamal Hadi Salim, Jiri Pirko
  Cc: netdev, Or Gerlitz, Hadar Har-Zion, Oded Shanoon, Amir Vadai

From: Amir Vadai <amirva@mellanox.com>>

Hi,

I would like to make it possible to manage VXLAN encap/decap using the flower
classifier, mirred action and vxlan device.
In order to make the solution scaleable, I'm using a shared vxlan device, with
encapsulation information packed in the metadata - by the mirred action in the
encap flow, and used in the decap flow, by the flower classifier.

For example for virt use case:
# [uplink NIC] --{cls_flower & mirred}--> [vxlan dev] --{udp/ip stack}--> [tap]
# [tap dev] --{udp/ip stack}--> [vxlan dev] --{cls_flower & mirred}--> [uplink NIC]
# In the example, vxlan tunnel ip's are 11.11.11.* and the real devices ip's
# are: 11.11.0.*

ip link add $VXLAN type vxlan dstport 4789 external

ifconfig $VXLAN up

tc qdisc add dev $ETH ingress

# ENCAP rule for ARP
tc filter add dev $ETH protocol 0x806 parent ffff: prio 11 \
		flower \
		action mirred egress redirect dev $VXLAN enc_src_ip 11.11.0.1 enc_dst_ip 11.11.0.2 enc_key_id 11 enc_dst_port 4789

# ENCAP rule for ICMP
tc filter add dev $ETH protocol ip parent ffff: prio 10 \
		flower ip_proto 1 \
		action mirred egress redirect dev $VXLAN enc_src_ip 11.11.0.1 enc_dst_ip 11.11.0.2 enc_key_id 11 enc_dst_port 4789

tc qdisc add dev $VXLAN ingress

# DECAP rule for ARP
tc filter add dev $VXLAN protocol 0x806 parent ffff: prio 11 \
		flower enc_src_ip 11.11.0.2 enc_dst_ip 11.11.0.1 enc_key_id 11 \
		action mirred egress redirect dev $ETH

# DECAP rule for ICMP
tc filter add dev $VXLAN protocol ip parent ffff: prio 10 \
		flower enc_src_ip 11.11.0.2 enc_dst_ip 11.11.0.1 enc_key_id 11 \
		action mirred egress redirect dev $ETH

Next step will be to enable offloading of those rules.

Following two patches to cls_flower and act_mirred were used to validate and
test this approach, and supplied to make things clearer, they will be modified
before the actual submission.

Thanks,
Amir

Amir Vadai (2):
  net/sched: cls_flower: Introduce classify by vxlan outer headers
  net/sched: act_mirred: Introduce vxlan support

 include/net/tc_act/tc_mirred.h        |  5 +++
 include/uapi/linux/pkt_cls.h          | 11 +++++
 include/uapi/linux/tc_act/tc_mirred.h |  7 ++++
 net/sched/act_mirred.c                | 79 +++++++++++++++++++++++++++++++++++
 net/sched/cls_flower.c                | 53 +++++++++++++++++++++++
 5 files changed, 155 insertions(+)

-- 
2.9.0

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

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

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-14 14:06 [RFC net-next 0/2] net/sched: cls_flower, act_mirred: VXLAN redirect using TC Amir Vadai
2016-08-14 14:06 ` [RFC net-next 1/2] net/sched: cls_flower: Introduce classify by vxlan outer headers Amir Vadai
2016-08-14 14:06 ` [RFC net-next 2/2] net/sched: act_mirred: Introduce vxlan support Amir Vadai
2016-08-14 17:53 ` [RFC net-next 0/2] net/sched: cls_flower, act_mirred: VXLAN redirect using TC Cong Wang
2016-08-15  5:05   ` John Fastabend
2016-08-15  7:11   ` Jiri Pirko
2016-08-15  8:17     ` Amir Vadai
2016-08-15  9:08       ` Amir Vadai
2016-08-15  9:48         ` Jiri Pirko
2016-08-15  9:50         ` Shmulik Ladkani
2016-08-15  9:58           ` Amir Vadai
2016-08-15 10:42             ` Shmulik Ladkani
2016-08-15 10:08         ` Jamal Hadi Salim
2016-08-15 10:24           ` Shmulik Ladkani
2016-08-15 10:41             ` Jamal Hadi Salim
2016-08-15 11:36               ` Amir Vadai
2016-08-15 16:35                 ` John Fastabend
2016-08-15 12:34           ` Jiri Pirko
2016-08-15 12:59             ` Amir Vadai
2016-08-15 16:37               ` John Fastabend

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