aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/hns
diff options
context:
space:
mode:
authorYixing Liu <liuyixing1@huawei.com>2022-09-22 20:33:14 +0800
committerJason Gunthorpe <jgg@nvidia.com>2022-09-27 10:15:25 -0300
commit8c581c47b9ba064cc3c3ad399081c202b0b0bf78 (patch)
tree31e8a1d726f31522b0c5da51262c1e06f5043fae /drivers/infiniband/hw/hns
parentRDMA/hns: Repacing 'dseg_len' by macros in fill_ext_sge_inl_data() (diff)
downloadlinux-dev-8c581c47b9ba064cc3c3ad399081c202b0b0bf78.tar.xz
linux-dev-8c581c47b9ba064cc3c3ad399081c202b0b0bf78.zip
RDMA/hns: Replacing magic number with macros in apply_func_caps()
Replacing magic number with macros in function apply_func_caps(). Link: https://lore.kernel.org/r/20220922123315.3732205-12-xuhaoyue1@hisilicon.com Signed-off-by: Yixing Liu <liuyixing1@huawei.com> Signed-off-by: Haoyue Xu <xuhaoyue1@hisilicon.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/infiniband/hw/hns')
-rw-r--r--drivers/infiniband/hw/hns/hns_roce_hw_v2.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
index e1716f100dce..fd4e767cd8de 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
@@ -2186,8 +2186,10 @@ static void apply_func_caps(struct hns_roce_dev *hr_dev)
caps->num_idx_segs = HNS_ROCE_V2_MAX_IDX_SEGS;
if (!caps->num_comp_vectors)
- caps->num_comp_vectors = min_t(u32, caps->eqc_bt_num - 1,
- (u32)priv->handle->rinfo.num_vectors - 2);
+ caps->num_comp_vectors =
+ min_t(u32, caps->eqc_bt_num - HNS_ROCE_V2_AEQE_VEC_NUM,
+ (u32)priv->handle->rinfo.num_vectors -
+ (HNS_ROCE_V2_AEQE_VEC_NUM + HNS_ROCE_V2_ABNORMAL_VEC_NUM));
if (hr_dev->pci_dev->revision >= PCI_REVISION_ID_HIP09) {
caps->eqe_hop_num = HNS_ROCE_V3_EQE_HOP_NUM;