]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: Allow dropping specific tunnel packets
authorTonghao Zhang <xiangxia.m.yue@gmail.com>
Thu, 1 Aug 2019 08:40:59 +0000 (16:40 +0800)
committerSaeed Mahameed <saeedm@mellanox.com>
Thu, 1 Aug 2019 19:33:33 +0000 (12:33 -0700)
commit005315094327e034a55f7871d20aab16f14de508
treee9109dc7925d3b8935a6a98cdd3c85ac00b646c2
parent9cc2c66e23302f2d41defc6c7fbd1b9ab07a5f20
net/mlx5e: Allow dropping specific tunnel packets

In some case, we don't want to allow specific tunnel packets
to host that can avoid to take up high CPU (e.g network attacks).
But other tunnel packets which not matched in hardware will be
sent to host too.

    $ tc filter add dev vxlan_sys_4789 \
    protocol ip chain 0 parent ffff: prio 1 handle 1 \
    flower dst_ip 1.1.1.100 ip_proto tcp dst_port 80 \
    enc_dst_ip 2.2.2.100 enc_key_id 100 enc_dst_port 4789 \
    action tunnel_key unset pipe action drop

Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c