RDMA/hns: Remove some redundant variables related to capabilities
authorWeihang Li <liweihang@huawei.com>
Sat, 11 Jan 2020 10:32:39 +0000 (18:32 +0800)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 15 Jan 2020 18:11:34 +0000 (14:11 -0400)
In struct hns_roce_caps, max_srq_sg and max_srqwqes is unused, and
max_srqs has the same effect with num_srqs. So remove them from this
structrue.

Link: https://lore.kernel.org/r/1578738761-3176-2-git-send-email-liweihang@huawei.com
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/hns/hns_roce_device.h
drivers/infiniband/hw/hns/hns_roce_hw_v2.c
drivers/infiniband/hw/hns/hns_roce_main.c

index 8d2bcd8..7459ebb 100644 (file)
@@ -800,10 +800,8 @@ struct hns_roce_caps {
        int             reserved_qps;
        int             num_qpc_timer;
        int             num_cqc_timer;
-       u32             max_srq_sg;
        int             num_srqs;
        u32             max_wqes;
-       u32             max_srqs;
        u32             max_srq_wrs;
        u32             max_srq_sges;
        u32             max_sq_desc_sz;
@@ -817,7 +815,6 @@ struct hns_roce_caps {
        u32             min_wqes;
        int             reserved_cqs;
        int             reserved_srqs;
-       u32             max_srqwqes;
        int             num_aeq_vectors;
        int             num_comp_vectors;
        int             num_other_vectors;
index f1e0ba6..3b13290 100644 (file)
@@ -1668,12 +1668,10 @@ static int hns_roce_v2_profile(struct hns_roce_dev *hr_dev)
        caps->num_srqs          = HNS_ROCE_V2_MAX_SRQ_NUM;
        caps->min_cqes          = HNS_ROCE_MIN_CQE_NUM;
        caps->max_cqes          = HNS_ROCE_V2_MAX_CQE_NUM;
-       caps->max_srqwqes       = HNS_ROCE_V2_MAX_SRQWQE_NUM;
        caps->max_sq_sg         = HNS_ROCE_V2_MAX_SQ_SGE_NUM;
        caps->max_extend_sg     = HNS_ROCE_V2_MAX_EXTEND_SGE_NUM;
        caps->max_rq_sg         = HNS_ROCE_V2_MAX_RQ_SGE_NUM;
        caps->max_sq_inline     = HNS_ROCE_V2_MAX_SQ_INLINE;
-       caps->max_srq_sg        = HNS_ROCE_V2_MAX_SRQ_SGE_NUM;
        caps->num_uars          = HNS_ROCE_V2_UAR_NUM;
        caps->phy_num_uars      = HNS_ROCE_V2_PHY_UAR_NUM;
        caps->num_aeq_vectors   = HNS_ROCE_V2_AEQE_VEC_NUM;
@@ -1761,7 +1759,6 @@ static int hns_roce_v2_profile(struct hns_roce_dev *hr_dev)
        caps->local_ca_ack_delay = 0;
        caps->max_mtu = IB_MTU_4096;
 
-       caps->max_srqs          = HNS_ROCE_V2_MAX_SRQ;
        caps->max_srq_wrs       = HNS_ROCE_V2_MAX_SRQ_WR;
        caps->max_srq_sges      = HNS_ROCE_V2_MAX_SRQ_SGE;
 
index 6e589f2..d0031d5 100644 (file)
@@ -210,7 +210,7 @@ static int hns_roce_query_device(struct ib_device *ib_dev,
        props->max_pkeys = 1;
        props->local_ca_ack_delay = hr_dev->caps.local_ca_ack_delay;
        if (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_SRQ) {
-               props->max_srq = hr_dev->caps.max_srqs;
+               props->max_srq = hr_dev->caps.num_srqs;
                props->max_srq_wr = hr_dev->caps.max_srq_wrs;
                props->max_srq_sge = hr_dev->caps.max_srq_sges;
        }