net/mlx5: CT: Add software steering ct flow steering provider
authorPaul Blakey <paulb@nvidia.com>
Wed, 29 Sep 2021 10:56:56 +0000 (13:56 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Fri, 11 Mar 2022 07:38:24 +0000 (23:38 -0800)
commit3ee61ebb0df1ec5cf9b60a12c1d7249230a73f9c
tree460bc0a445801ca472fc5f61986696ad72379a7d
parentc6fef514adaa0d681f486ebbdec4c299db7101d6
net/mlx5: CT: Add software steering ct flow steering provider

fs_core layer adds extra book keeping that is either unneeded for CT, or
unused by the underlying software steering, such as allocating FTEs and
FTE ids, saving the match key and mask, and autogroups management.
On top of that, direct steering has a translation layer (fs_dr) from PRM
commands to direct steering objects, for example, creating temporary
dr_action objects. This has a performance impact when dealing
with CT high insertion rate.

To use direct steering (smfs) directly for ct, add a tc ct fs smfs
implementation. Instead of dmfs autogroups, smfs ct fs uses one of 4
predefined dr matchers in CT and CT-NAT tables, for each combination
of tuple ethertype (ipv4/ipv6), and tuple ip_proto (udp/tcp) that
is currently used by nf flow table flow offload.

At rule insertions, validate the flow rule fits one of the predfined
matcher, and insert to it.

To fill the dr_actions of the rule efficiently, create the fwd to post_ct
tbl dr_action at fs init, the count dr_action at counter creation,
and re-use the already pre-allocated modify header dr_action.

Signed-off-by: Paul Blakey <paulb@nvidia.com>
Reviewed-by: Oz Shlomo <ozsh@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/Makefile
drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs.h
drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_dmfs.c
drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_smfs.c [new file with mode: 0644]
drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c
drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.h