summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorEran Ben Elisha <eranbe@mellanox.com>2017-12-13 19:12:10 +0300
committerDavid S. Miller <davem@davemloft.net>2017-12-14 00:38:36 +0300
commit0bb9fc4f5429ac970181c073aa32e521e20f7b73 (patch)
tree14ff3e83212819fbb8ab7b6ed264cfc9932e2ba7 /drivers/net/ethernet
parent78034f5fdd622520eb843301cf35ce6c626543a7 (diff)
downloadlinux-0bb9fc4f5429ac970181c073aa32e521e20f7b73.tar.xz
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: 9de92c60beaa ("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>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/resource_tracker.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
index 04304dd894c6..606a0e0beeae 100644
--- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
+++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
@@ -611,7 +611,6 @@ int mlx4_init_resource_tracker(struct mlx4_dev *dev)
MLX4_MAX_PORTS;
else
res_alloc->guaranteed[t] = 0;
- res_alloc->res_free -= res_alloc->guaranteed[t];
break;
default:
break;