]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
net/mlx4_core: Use cq quota in SRIOV when creating completion EQs
authorJack Morgenstein <jackm@dev.mellanox.co.il>
Thu, 23 Feb 2017 10:02:44 +0000 (12:02 +0200)
committerTim Gardner <tim.gardner@canonical.com>
Thu, 30 Mar 2017 20:32:45 +0000 (14:32 -0600)
commit3d0f2c1708ececac6fbddb6b22666da4eeb81b5e
tree52d2258f793fbea4afa4eadab795f761c2bced96
parent3b411be93d323c9f16fc3158feda3c2ef5cefb20
net/mlx4_core: Use cq quota in SRIOV when creating completion EQs

BugLink: http://bugs.launchpad.net/bugs/1667527
When creating EQs to handle CQ completion events for the PF
or for VFs, we create enough EQE entries to handle completions
for the max number of CQs that can use that EQ.

When SRIOV is activated, the max number of CQs a VF (or the PF) can
obtain is its CQ quota (determined by the Hypervisor resource tracker).
Therefore, when creating an EQ, the number of EQE entries that the VF
should request for that EQ is the CQ quota value (and not the total
number of CQs available in the FW).

Under SRIOV, the PF, also must use its CQ quota, because
the resource tracker also controls how many CQs the PF can obtain.

Using the FW total CQs instead of the CQ quota when creating EQs resulted
wasting MTT entries, due to allocating more EQEs than were needed.

Fixes: 5a0d0a6161ae ("mlx4: Structures and init/teardown for VF resource quotas")
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Reported-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 6ed63d845e7866ff1a0eac9f0fa554fdf2c64e1d)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/net/ethernet/mellanox/mlx4/eq.c
drivers/net/ethernet/mellanox/mlx4/main.c