net/mlx5e: TC, Add sampler restore handle API
authorChris Mi <cmi@nvidia.com>
Tue, 26 Jan 2021 03:08:28 +0000 (11:08 +0800)
committerSaeed Mahameed <saeedm@nvidia.com>
Wed, 7 Apr 2021 04:36:04 +0000 (21:36 -0700)
commit36a3196256bf3310e5e7142b0e61787f7a201abd
tree3556e761c7715f4c4a60ad94fcf1965febe812d3
parent11ecd6c60b4ee6f5d5bcd91f5b87e50bad8f142a
net/mlx5e: TC, Add sampler restore handle API

Use common object pool to create an object ID to map sample parameters.
Allocate a modify header action to write the object ID to reg_c0 lower
16 bits. Create a restore rule to pass the object ID to software. So
software can identify sampled packets via the object ID and send it to
userspace.

Aggregate the modify header action, restore rule and object ID to a
sample restore handle. Re-use identical sample restore handle for
the same object ID.

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