]> git.proxmox.com Git - mirror_ovs.git/commit - lib/tc.c
netdev-offload-tc: Allow to match the IP and port mask of tunnel
authorTonghao Zhang <xiangxia.m.yue@gmail.com>
Tue, 2 Jun 2020 13:50:24 +0000 (21:50 +0800)
committerSimon Horman <simon.horman@netronome.com>
Wed, 3 Jun 2020 07:56:07 +0000 (09:56 +0200)
commit5f568d049130fb481e41fdf9a290b6d1e3a7f23a
treeecb70b16e656f96ee50c7152af60eff1ec97ec92
parent4f4be08e4713941285ecb71555c9a64c46cdb8ae
netdev-offload-tc: Allow to match the IP and port mask of tunnel

This patch allows users to offload the TC flower rules with
tunnel mask. This patch allows masked match of the following,
where previously supported an exact match was supported:
* Remote (dst) tunnel endpoint address
* Local (src) tunnel endpoint address
* Remote (dst) tunnel endpoint UDP port

And also allows masked match of the following, where previously
no match was supported:
* Local (src) tunnel endpoint UDP port

In some case, mask is useful as wildcards. For example, DDOS,
in that case, we don’t want to allow specified hosts IPs or
only source Ports to access the targeted host. For example:

$ ovs-appctl dpctl/add-flow "tunnel(dst=2.2.2.100,src=2.2.2.0/255.255.255.0,tp_dst=4789),\
  recirc_id(0),in_port(3),eth(),eth_type(0x0800),ipv4()" ""

$ tc filter show dev vxlan_sys_4789 ingress
  ...
  eth_type ipv4
  enc_dst_ip 2.2.2.100
  enc_src_ip 2.2.2.0/24
  enc_dst_port 4789
  enc_ttl 64
  in_hw in_hw_count 2
action order 1: gact action drop
    ...

Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Acked-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
NEWS
include/openvswitch/match.h
lib/match.c
lib/netdev-offload-tc.c
lib/tc.c
tests/tunnel.at