summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlx4/mlx4.h
diff options
context:
space:
mode:
authorJack Morgenstein2013-11-03 09:03:25 +0100
committerDavid S. Miller2013-11-04 22:19:08 +0100
commit146f3ef4a193f2e8cc826bed01a635861287df63 (patch)
treee43baf0db805f6f49f0c335fd5e868d7afc3946d /drivers/net/ethernet/mellanox/mlx4/mlx4.h
parentnet/mlx4_core: Fix quota handling in the QUERY_FUNC_CAP wrapper (diff)
downloadkernel-qcow2-linux-146f3ef4a193f2e8cc826bed01a635861287df63.tar.gz
kernel-qcow2-linux-146f3ef4a193f2e8cc826bed01a635861287df63.tar.xz
kernel-qcow2-linux-146f3ef4a193f2e8cc826bed01a635861287df63.zip
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: Jack Morgenstein <jackm@dev.mellanox.co.il> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/mlx4.h')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/mlx4.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4.h b/drivers/net/ethernet/mellanox/mlx4/mlx4.h
index e7eb86ecc6ea..e582a41a802b 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mlx4.h
+++ b/drivers/net/ethernet/mellanox/mlx4/mlx4.h
@@ -505,6 +505,7 @@ struct slave_list {
};
struct resource_allocator {
+ spinlock_t alloc_lock; /* protect quotas */
union {
int res_reserved;
int res_port_rsvd[MLX4_MAX_PORTS];