]> git.baikalelectronics.ru Git - kernel.git/commit
net: sched: add vxlan option support to act_tunnel_key
authorXin Long <lucien.xin@gmail.com>
Thu, 21 Nov 2019 10:03:26 +0000 (18:03 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 Nov 2019 19:44:06 +0000 (11:44 -0800)
commit66c2810f5d30c2190662717025e4e1bd38b99bf7
treecd8c3274be3de66d4ad1a9636d80e377eaab774b
parent180f5ad27741eb6fe62da22d2822346250f8a0f9
net: sched: add vxlan option support to act_tunnel_key

This patch is to allow setting vxlan options using the
act_tunnel_key action. Different from geneve options,
only one option can be set. And also, geneve options
and vxlan options can't be set at the same time.

gbp is the only param for vxlan options:

  # ip link add name vxlan0 type vxlan dstport 0 external
  # tc qdisc add dev eth0 ingress
  # tc filter add dev eth0 protocol ip parent ffff: \
           flower indev eth0 \
              ip_proto udp \
              action tunnel_key \
                  set src_ip 10.0.99.192 \
                  dst_ip 10.0.99.193 \
                  dst_port 6081 \
                  id 11 \
     vxlan_opts 01020304 \
          action mirred egress redirect dev vxlan0

v1->v2:
  - add .strict_start_type for enc_opts_policy as Jakub noticed.
  - use Duplicate instead of Wrong in err msg for extack as Jakub
    suggested.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/uapi/linux/tc_act/tc_tunnel_key.h
net/sched/act_tunnel_key.c