]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
i40iw: Correct Q1/XF object count equation
authorShiraz Saleem <shiraz.saleem@intel.com>
Fri, 22 Dec 2017 15:46:56 +0000 (09:46 -0600)
committerJason Gunthorpe <jgg@mellanox.com>
Fri, 22 Dec 2017 20:38:05 +0000 (13:38 -0700)
Lower Inbound RDMA Read Queue (Q1) object count by a factor of 2
as it is incorrectly doubled. Also, round up Q1 and Transmit FIFO (XF)
object count to power of 2 to satisfy hardware requirement.

Fixes: 86dbcd0f12e9 ("i40iw: add file to handle cqp calls")
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/i40iw/i40iw_ctrl.c

index 90171643cf7f0b70332996b6632ceedf6e21be1c..e857f287a0c072a71e9f200588aa2f2cdbde8e75 100644 (file)
@@ -3910,8 +3910,10 @@ enum i40iw_status_code i40iw_config_fpm_values(struct i40iw_sc_dev *dev, u32 qp_
                hmc_info->hmc_obj[I40IW_HMC_IW_APBVT_ENTRY].cnt = 1;
                hmc_info->hmc_obj[I40IW_HMC_IW_MR].cnt = mrwanted;
 
-               hmc_info->hmc_obj[I40IW_HMC_IW_XF].cnt = I40IW_MAX_WQ_ENTRIES * qpwanted;
-               hmc_info->hmc_obj[I40IW_HMC_IW_Q1].cnt = 4 * I40IW_MAX_IRD_SIZE * qpwanted;
+               hmc_info->hmc_obj[I40IW_HMC_IW_XF].cnt =
+                       roundup_pow_of_two(I40IW_MAX_WQ_ENTRIES * qpwanted);
+               hmc_info->hmc_obj[I40IW_HMC_IW_Q1].cnt =
+                       roundup_pow_of_two(2 * I40IW_MAX_IRD_SIZE * qpwanted);
                hmc_info->hmc_obj[I40IW_HMC_IW_XFFL].cnt =
                        hmc_info->hmc_obj[I40IW_HMC_IW_XF].cnt / hmc_fpm_misc->xf_block_size;
                hmc_info->hmc_obj[I40IW_HMC_IW_Q1FL].cnt =