]> git.baikalelectronics.ru Git - kernel.git/commit
net/sched: Introduce act_tunnel_key
authorAmir Vadai <amir@vadai.me>
Thu, 8 Sep 2016 13:23:48 +0000 (16:23 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sun, 11 Sep 2016 03:53:56 +0000 (20:53 -0700)
commitc02744b2fd414ca9ae6daa4929bc13b27ffcfbd9
tree49dd46c9fe8ba968261a849bbb5e9704b25ce64d
parentbd892801aa0b78e794cebb80118d9ae2df8f58c3
net/sched: Introduce act_tunnel_key

This action could be used before redirecting packets to a shared tunnel
device, or when redirecting packets arriving from a such a device.

The action will release the metadata created by the tunnel device
(decap), or set the metadata with the specified values for encap
operation.

For example, the following flower filter will forward all ICMP packets
destined to 11.11.11.2 through the shared vxlan device 'vxlan0'. Before
redirecting, a metadata for the vxlan tunnel is created using the
tunnel_key action and it's arguments:

$ tc filter add dev net0 protocol ip parent ffff: \
    flower \
      ip_proto 1 \
      dst_ip 11.11.11.2 \
    action tunnel_key set \
      src_ip 11.11.0.1 \
      dst_ip 11.11.0.2 \
      id 11 \
    action mirred egress redirect dev vxlan0

Signed-off-by: Amir Vadai <amir@vadai.me>
Signed-off-by: Hadar Hen Zion <hadarh@mellanox.com>
Reviewed-by: Shmulik Ladkani <shmulik.ladkani@gmail.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/tc_act/tc_tunnel_key.h [new file with mode: 0644]
include/uapi/linux/tc_act/tc_tunnel_key.h [new file with mode: 0644]
net/sched/Kconfig
net/sched/Makefile
net/sched/act_tunnel_key.c [new file with mode: 0644]