From: Zhao Weibo zhaoweibo3@huawei.com
driver inclusion category: bugfix bugzilla: NA CVE: NA
------------------------------
This patch add a way of querying arm_cnt in rdfx.
Reviewed-by: Hu Chunzhi huchunzhi@huawei.com Signed-off-by: Zhao Weibo zhaoweibo3@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- drivers/infiniband/hw/hns/roce-customer/rdfx_sysfs.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/hns/roce-customer/rdfx_sysfs.c b/drivers/infiniband/hw/hns/roce-customer/rdfx_sysfs.c index 768e4f2..322b107 100644 --- a/drivers/infiniband/hw/hns/roce-customer/rdfx_sysfs.c +++ b/drivers/infiniband/hw/hns/roce-customer/rdfx_sysfs.c @@ -372,9 +372,9 @@ static int show_cq_detail(struct rdfx_cq_info *rdfx_cq) pr_info("\n"); pr_info("arm_cnt:\n"); pr_info("IB_CQ_SOLICITED : 0x%x\n", - atomic_read(&rdfx_cq->rcqe_cnt[0])); + atomic_read(&rdfx_cq->arm_cnt[0])); pr_info("IB_CQ_NEXT_COMP : 0x%x\n", - atomic_read(&rdfx_cq->rcqe_cnt[1])); + atomic_read(&rdfx_cq->arm_cnt[1])); pr_info("CQ_CI : 0x%x\n", atomic_read(&rdfx_cq->ci));
return 0; @@ -400,6 +400,10 @@ static void show_valid_cqn(struct list_head *head) static inline int rdfx_show_cq_detail(u32 cqn, struct rdfx_info *rdfx) { struct rdfx_cq_info *rdfx_cq = NULL; + struct hns_roce_dev *hr_dev; + struct hns_roce_cq *cq; + + hr_dev = (struct hns_roce_dev *)rdfx->priv;
pr_info("***************** CQ(0x%x) INFO *****************\n", cqn); pr_info("alloc_cq_cnt : 0x%x\n", @@ -409,6 +413,11 @@ static inline int rdfx_show_cq_detail(u32 cqn, struct rdfx_info *rdfx) pr_info("top_cq_index : 0x%x\n", atomic_read(&rdfx->cq.top_cq_index));
+ cq = radix_tree_lookup(&hr_dev->cq_table.tree, + cqn & (hr_dev->caps.num_cqs - 1)); + if (cq) + pr_info("arm_sn_cnt : 0x%x\n", cq->arm_sn); + list_for_each_entry(rdfx_cq, &rdfx->cq.list, list) { if (cqn == rdfx_cq->cqn) return show_cq_detail(rdfx_cq);