net/mlx5: add pattern template management
authorSuanming Mou <suanmingm@nvidia.com>
Thu, 24 Feb 2022 13:40:42 +0000 (15:40 +0200)
committerRaslan Darawsheh <rasland@nvidia.com>
Thu, 24 Feb 2022 21:10:18 +0000 (22:10 +0100)
commit42431df9240da9c8e30ad61dc9fb3e00b6eb0284
tree303186b0fe7f246788936b8b07ce3b9fccbd8a1e
parentb401400db24ee12b817ab9b0823ac2b0706585bb
net/mlx5: add pattern template management

The pattern template defines flows that have the same matching
fields but with different matching values.
For example, matching on 5 tuple TCP flow, the template will be
(eth(null) + IPv4(source + dest) + TCP(s_port + d_port) while
the values for each rule will be different.

Due to the pattern template can be used in different domains, the
items will only be cached in pattern template create stage, while
the template is bound to a dedicated table, the HW criteria will
be created and saved to the table. The pattern templates can be
used by multiple tables. But different tables create the same
criteria and will not share the matcher between each other in order
to have better performance.

This commit adds pattern template management.

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
drivers/net/mlx5/mlx5.h
drivers/net/mlx5/mlx5_flow.c
drivers/net/mlx5/mlx5_flow.h
drivers/net/mlx5/mlx5_flow_hw.c