Commit 146f3ef4 authored by Jack Morgenstein's avatar Jack Morgenstein Committed by David S. Miller

net/mlx4_core: Implement resource quota enforcement

Implements resource quota grant decision when resources are requested,
for the following resources:  QPs, CQs, SRQs, MPTs, MTTs, vlans, MACs,
and Counters.

When granting a resource, the quota system increases the allocated-count
for that slave.

When the slave later frees the resource, its allocated-count is reduced.

A spinlock is used to protect the integrity of each resource's free-pool counter.
(One slave may be in the process of being granted a resource while another
slave has crashed, initiating cleanup of that slave's resource quotas).
Signed-off-by: default avatarJack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent eb456a68
...@@ -505,6 +505,7 @@ struct slave_list { ...@@ -505,6 +505,7 @@ struct slave_list {
}; };
struct resource_allocator { struct resource_allocator {
spinlock_t alloc_lock; /* protect quotas */
union { union {
int res_reserved; int res_reserved;
int res_port_rsvd[MLX4_MAX_PORTS]; int res_port_rsvd[MLX4_MAX_PORTS];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment