]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.15.17/i40iw-correct-q1-xf-object-count-equation.patch
Linux 4.14.95
[thirdparty/kernel/stable-queue.git] / releases / 4.15.17 / i40iw-correct-q1-xf-object-count-equation.patch
CommitLineData
72fc6108
GKH
1From foo@baz Mon Apr 9 10:16:32 CEST 2018
2From: Shiraz Saleem <shiraz.saleem@intel.com>
3Date: Fri, 22 Dec 2017 09:46:56 -0600
4Subject: i40iw: Correct Q1/XF object count equation
5
6From: Shiraz Saleem <shiraz.saleem@intel.com>
7
8
9[ Upstream commit fe99afd1febd74e0ef1fed7e3283f09effe1f4f0 ]
10
11Lower Inbound RDMA Read Queue (Q1) object count by a factor of 2
12as it is incorrectly doubled. Also, round up Q1 and Transmit FIFO (XF)
13object count to power of 2 to satisfy hardware requirement.
14
15Fixes: 86dbcd0f12e9 ("i40iw: add file to handle cqp calls")
16Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
17Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
18Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
19Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20---
21 drivers/infiniband/hw/i40iw/i40iw_ctrl.c | 6 ++++--
22 1 file changed, 4 insertions(+), 2 deletions(-)
23
24--- a/drivers/infiniband/hw/i40iw/i40iw_ctrl.c
25+++ b/drivers/infiniband/hw/i40iw/i40iw_ctrl.c
26@@ -3928,8 +3928,10 @@ enum i40iw_status_code i40iw_config_fpm_
27 hmc_info->hmc_obj[I40IW_HMC_IW_APBVT_ENTRY].cnt = 1;
28 hmc_info->hmc_obj[I40IW_HMC_IW_MR].cnt = mrwanted;
29
30- hmc_info->hmc_obj[I40IW_HMC_IW_XF].cnt = I40IW_MAX_WQ_ENTRIES * qpwanted;
31- hmc_info->hmc_obj[I40IW_HMC_IW_Q1].cnt = 4 * I40IW_MAX_IRD_SIZE * qpwanted;
32+ hmc_info->hmc_obj[I40IW_HMC_IW_XF].cnt =
33+ roundup_pow_of_two(I40IW_MAX_WQ_ENTRIES * qpwanted);
34+ hmc_info->hmc_obj[I40IW_HMC_IW_Q1].cnt =
35+ roundup_pow_of_two(2 * I40IW_MAX_IRD_SIZE * qpwanted);
36 hmc_info->hmc_obj[I40IW_HMC_IW_XFFL].cnt =
37 hmc_info->hmc_obj[I40IW_HMC_IW_XF].cnt / hmc_fpm_misc->xf_block_size;
38 hmc_info->hmc_obj[I40IW_HMC_IW_Q1FL].cnt =