]> www.infradead.org Git - users/jedix/linux-maple.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 1 Dec 2018 08:42:58 +0000 (09:42 +0100)
commit9d9cd2bcfc5298109bd90c52f239011337147812
tree9adbc5b24bffbcd056623e0aa752b1a9cca9653f
parent7aaa554d09606185650cd1aa422887736b9e1056
net/mlx4_core: Fix wrong calculation of free counters

commit 0bb9fc4f5429ac970181c073aa32e521e20f7b73 upstream.

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>
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c