summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2017-05-22 08:17:07 +0000
committerhselasky <hselasky@FreeBSD.org>2017-05-22 08:17:07 +0000
commit23dcad981553a6eed093a676a47643e37b8de63b (patch)
tree1bdba2287f0848d65a47f9e2e4418a8eeb87de45
parent58fe5c27ce914e207efbbcefb351003ee5575bdc (diff)
downloadFreeBSD-src-23dcad981553a6eed093a676a47643e37b8de63b.zip
FreeBSD-src-23dcad981553a6eed093a676a47643e37b8de63b.tar.gz
MFC r318531:
mlx4: Use the CQ quota for SRIOV when creating completion EQs 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 firmware). 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 firmware total CQs instead of the CQ quota when creating EQs resulted wasting MTT entries, due to allocating more EQEs than were needed. Sponsored by: Mellanox Technologies
-rw-r--r--sys/ofed/drivers/net/mlx4/eq.c6
-rw-r--r--sys/ofed/drivers/net/mlx4/main.c3
2 files changed, 4 insertions, 5 deletions
diff --git a/sys/ofed/drivers/net/mlx4/eq.c b/sys/ofed/drivers/net/mlx4/eq.c
index 99024e2..1436c8f 100644
--- a/sys/ofed/drivers/net/mlx4/eq.c
+++ b/sys/ofed/drivers/net/mlx4/eq.c
@@ -1169,8 +1169,7 @@ int mlx4_init_eq_table(struct mlx4_dev *dev)
}
for (i = 0; i < dev->caps.num_comp_vectors; ++i) {
- err = mlx4_create_eq(dev, dev->caps.num_cqs -
- dev->caps.reserved_cqs +
+ err = mlx4_create_eq(dev, dev->quotas.cq +
MLX4_NUM_SPARE_EQE,
(dev->flags & MLX4_FLAG_MSI_X) ? i : 0,
&priv->eq_table.eq[i]);
@@ -1190,8 +1189,7 @@ int mlx4_init_eq_table(struct mlx4_dev *dev)
for (i = dev->caps.num_comp_vectors + 1;
i < dev->caps.num_comp_vectors + dev->caps.comp_pool + 1; ++i) {
- err = mlx4_create_eq(dev, dev->caps.num_cqs -
- dev->caps.reserved_cqs +
+ err = mlx4_create_eq(dev, dev->quotas.cq +
MLX4_NUM_SPARE_EQE,
(dev->flags & MLX4_FLAG_MSI_X) ? i : 0,
&priv->eq_table.eq[i]);
diff --git a/sys/ofed/drivers/net/mlx4/main.c b/sys/ofed/drivers/net/mlx4/main.c
index 443bc29..c331597 100644
--- a/sys/ofed/drivers/net/mlx4/main.c
+++ b/sys/ofed/drivers/net/mlx4/main.c
@@ -3446,6 +3446,8 @@ slave_start:
goto err_free_eq;
}
+ mlx4_init_quotas(dev);
+
err = mlx4_setup_hca(dev);
if (err == -EBUSY && (dev->flags & MLX4_FLAG_MSI_X) &&
!mlx4_is_mfunc(dev)) {
@@ -3459,7 +3461,6 @@ slave_start:
if (err)
goto err_steer;
- mlx4_init_quotas(dev);
mlx4_init_hca_info(dev);
for (port = 1; port <= dev->caps.num_ports; port++) {
OpenPOWER on IntegriCloud