net/mlx5: CT: Create smfs dr matchers dynamically
authorPaul Blakey <paulb@nvidia.com>
Sun, 5 Sep 2021 07:47:56 +0000 (10:47 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Fri, 11 Mar 2022 07:38:24 +0000 (23:38 -0800)
commitfbf6836db42d013056e0a423599d8afeb5b838ac
tree3c5748e496c7386ac4c0323cef5878d5142d4e8f
parent3ee61ebb0df1ec5cf9b60a12c1d7249230a73f9c
net/mlx5: CT: Create smfs dr matchers dynamically

SMFS dr matchers are processed sequentially in hardware according to
their priorities, and not skipped if empty.

Currently, smfs ct fs creates four predefined dr matchers per ct
table (ct/ct nat) with hardcoded priority. Compared to dmfs ct fs
using autogroups, this might cause additional hops in fastpath for
traffic patterns that match later priorties, even if previous
priorites are empty, e.g user only using ipv6 UDP traffic will
have additional 3 hops.

Create the matchers dynamically, using the highest priority available,
on first rule usage, and remove them on last usage.

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/en/tc/ct_fs_smfs.c