net/mlx4_core: Dynamically set guaranteed amount of counters per VF
authorEran Ben Elisha <eranbe@mellanox.com>
Sun, 27 Oct 2019 14:39:15 +0000 (16:39 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 10 Nov 2019 10:27:42 +0000 (11:27 +0100)
commit1d72dbb4ca2f4a955d476ca70e449f53a7d58924
tree22f401cd3e4ea15d54e8f7cd4bd81ded995a108e
parentf05975d9f393a4fb920c852afe5a8f71d919f576
net/mlx4_core: Dynamically set guaranteed amount of counters per VF

[ Upstream commit e19868efea0c103f23b4b7e986fd0a703822111f ]

Prior to this patch, the amount of counters guaranteed per VF in the
resource tracker was MLX4_VF_COUNTERS_PER_PORT * MLX4_MAX_PORTS. It was
set regardless if the VF was single or dual port.
This caused several VFs to have no guaranteed counters although the
system could satisfy their request.

The fix is to dynamically guarantee counters, based on each VF
specification.

Fixes: 9de92c60beaa ("net/mlx4_core: Adjust counter grant policy in the resource tracker")
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c