net/mlx5e: TC, Add sampler object API
authorChris Mi <cmi@nvidia.com>
Mon, 21 Sep 2020 05:25:54 +0000 (13:25 +0800)
committerSaeed Mahameed <saeedm@nvidia.com>
Wed, 7 Apr 2021 04:36:03 +0000 (21:36 -0700)
commit11ecd6c60b4ee6f5d5bcd91f5b87e50bad8f142a
treefc01b995c77b2498e27e194dd52df3272e361ada
parent2a9ab10a5689a4612d441df1cc628c381dc75ed3
net/mlx5e: TC, Add sampler object API

In order to offload sample action, HW introduces sampler object. The
sampler object samples packets according to the provided sample ratio.
Sampled packets are duplicated. One copy is processed by a termination
table, named the sample table, which sends the packet up to software.
The second copy is processed by the default table.

Instantiate sampler object. Re-use identical sampler object for
the same sample ratio, sample table and default table as a prestep for
offloading tc sample actions.

Signed-off-by: Chris Mi <cmi@nvidia.com>
Reviewed-by: Oz Shlomo <ozsh@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/esw/sample.c