]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx4_core: Fix wrong calculation of free counters
authorEran Ben Elisha <eranbe@mellanox.com>
Wed, 13 Dec 2017 16:12:10 +0000 (18:12 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 13 Dec 2017 21:38:36 +0000 (16:38 -0500)
commitaf7403a4c832ab4b13bf7cf2ea131a08a5977641
tree14ff3e83212819fbb8ab7b6ed264cfc9932e2ba7
parent2bea6df46186d8c4f582f6a428208c2e930e7f97
net/mlx4_core: Fix wrong calculation of free counters

The field res_free indicates the total number of counters which are
available for allocation (reserved and unreserved). Fixed a bug where
the reserved counters were subtracted from res_free before any
allocation was performed.

Before this fix, free counters which were not reserved could not be
allocated.

Fixes: 7017fac82c7e ("net/mlx4_core: Adjust counter grant policy in the resource tracker")
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Reviewed-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c