]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: Support accept action on nic table
authorTonghao Zhang <xiangxia.m.yue@gmail.com>
Tue, 10 Dec 2019 14:49:42 +0000 (22:49 +0800)
committerSaeed Mahameed <saeedm@mellanox.com>
Tue, 7 Jan 2020 18:40:50 +0000 (10:40 -0800)
commit9468a93cfca20bbc41cc738518e64a2bf64f2759
tree75cfedb8c128b6765bb00b499db180f5637a316d
parent2a895a1db53f2b7bd8c1bb18834b3c92e891706b
net/mlx5e: Support accept action on nic table

In one case, we may forward packets from one vport
to others, but only one packets flow will be accepted,
which destination ip was assign to VF.

+-----+     +-----+            +-----+
| VFn |     | VF1 |            | VF0 | accept
+--+--+     +--+--+  hairpin   +--^--+
   |           | <--------------- |
   |           |                  |
+--+-----------v-+             +--+-------------+
|   eswitch PF1  |             |   eswitch PF0  |
+----------------+             +----------------+

tc filter add dev $PF0 protocol all parent ffff: prio 1 handle 1 \
flower skip_sw action mirred egress redirect dev $VF0_REP
tc filter add dev $VF0 protocol ip  parent ffff: prio 1 handle 1 \
flower skip_sw dst_ip $VF0_IP action pass
tc filter add dev $VF0 protocol all parent ffff: prio 2 handle 2 \
flower skip_sw action mirred egress redirect dev $VF1

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