net/mlx5: Rate limit tables support
authorYevgeny Petrilin <yevgenyp@mellanox.com>
Thu, 23 Jun 2016 14:02:37 +0000 (17:02 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 27 Jun 2016 08:10:40 +0000 (04:10 -0400)
commit1466cc5b23d18e7b6b8f1a45443d595393dbcae7
tree2e59ace67ce4eb2d55cf9e38fd04f08525e39047
parentf1eecb7ea89ef3ee0b0aa6e818a82e91d5525c18
net/mlx5: Rate limit tables support

Configuring and managing HW rate limit tables.
The HW holds a table of rate limits, each rate is
associated with an index in that table.
Later a Send Queue uses this index to set the rate limit.
Multiple Send Queues can have the same rate limit, which is
represented by a single entry in this table.
Even though a rate can be shared, each queue is being rate
limited independently of others.

The SW shadow of this table holds the rate itself,
the index in the HW table and the refcount (number of queues)
working with this rate.

The exported functions are mlx5_rl_add_rate and mlx5_rl_remove_rate.
Number of different rates and their values are derived
from HW capabilities.

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx5/core/Makefile
drivers/net/ethernet/mellanox/mlx5/core/fw.c
drivers/net/ethernet/mellanox/mlx5/core/main.c
drivers/net/ethernet/mellanox/mlx5/core/rl.c [new file with mode: 0644]
include/linux/mlx5/device.h
include/linux/mlx5/driver.h