net/mlx5: Expose raw packet pacing APIs
authorYishai Hadas <yishaih@mellanox.com>
Wed, 19 Feb 2020 19:05:17 +0000 (21:05 +0200)
committerLeon Romanovsky <leonro@mellanox.com>
Thu, 5 Mar 2020 12:18:09 +0000 (14:18 +0200)
commit1326034b3ce7073e3ed74bd0f4d24afee96a9e07
tree48c6b74e86fe3eaaaea4c17e355ab88a607ab79c
parent339ffae598ed74a0220a92c9b8d1cecb2e9a0dc8
net/mlx5: Expose raw packet pacing APIs

Expose raw packet pacing APIs to be used by DEVX based applications.
The existing code was refactored to have a single flow with the new raw
APIs.

The new raw APIs considered the input of 'pp_rate_limit_context', uid,
'dedicated', upon looking for an existing entry.

This raw mode enables future device specification data in the raw
context without changing the existing logic and code.

The ability to ask for a dedicated entry gives control for application
to allocate entries according to its needs.

A dedicated entry may not be used by some other process and it also
enables the process spreading its resources to some different entries
for use different hardware resources as part of enforcing the rate.

The counter per entry was changed to be u64 to prevent any option to
overflow.

Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Acked-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/rl.c
include/linux/mlx5/driver.h
include/linux/mlx5/mlx5_ifc.h