OSDN Git Service

net/mlx5e: Allow matching only enc_key_id/enc_dst_port for decapsulation action
authorTonghao Zhang <xiangxia.m.yue@gmail.com>
Mon, 6 May 2019 18:28:37 +0000 (11:28 -0700)
committerSaeed Mahameed <saeedm@mellanox.com>
Fri, 31 May 2019 20:04:25 +0000 (13:04 -0700)
commitd1bda7eecd88e3d10e44541d675c07564f4f6938
tree4f93a6e5278025f0403affd9c0dab7924d170d74
parent9b81d5a9945bc696c2e653757778e79495b164a1
net/mlx5e: Allow matching only enc_key_id/enc_dst_port for decapsulation action

In some case, we don't care the enc_src_ip and enc_dst_ip, and
if we don't match the field enc_src_ip and enc_dst_ip, we can use
fewer flows in hardware when revice the tunnel packets. For example,
the tunnel packets may be sent from different hosts, we must offload
one rule for each host.

$ tc filter add dev vxlan0 protocol ip parent ffff: prio 1 \
flower dst_mac 00:11:22:33:44:00 \
enc_src_ip Host0_IP enc_dst_ip 2.2.2.100 \
enc_dst_port 4789 enc_key_id 100 \
action tunnel_key unset action mirred egress redirect dev eth0_1

$ tc filter add dev vxlan0 protocol ip parent ffff: prio 1 \
flower dst_mac 00:11:22:33:44:00 \
enc_src_ip Host1_IP enc_dst_ip 2.2.2.100 \
enc_dst_port 4789 enc_key_id 100 \
action tunnel_key unset action mirred egress redirect dev eth0_1

If we support flows which only match the enc_key_id and enc_dst_port,
a flow can process the packets sent to VM which (mac 00:11:22:33:44:00).

$ tc filter add dev vxlan0 protocol ip parent ffff: prio 1 \
flower dst_mac 00:11:22:33:44:00 \
enc_dst_port 4789 enc_key_id 100 \
action tunnel_key unset action mirred egress redirect dev eth0_1

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