Skip to contentSkip to conversation

RDMA/hns: Misc cleanups

PATCH Applied Weihang Li 2 participants 5 messages Apr 30, 2020 – May 6, 2020

Subsystems (2)
lore
Share & tools
lore

Weihang Li

author
#0 lore raw

cover RDMA/hns: Misc cleanups

Some tiny cleanups for hns driver.

Weihang Li (2):
RDMA/hns: Fix comments with non-English symbols
RDMA/hns: Adjust lp_pktn_ini dynamically

Wenpeng Liang (1):
RDMA/hns: Remove redundant assignment of caps

 drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 8 ++------
 drivers/infiniband/hw/hns/hns_roce_hw_v2.h | 7 +++----
 2 files changed, 5 insertions(+), 10 deletions(-)
Signature · 1 line
2.8.1
author
#1 lore raw

PATCH 1/3 RDMA/hns: Fix comments with non-English symbols

There is a comments with some chinese semicolons that cause encoding issues each time hns_roc_hw_v2.h was modified from a IDE. So fix this by using correct symbols.

---
 drivers/infiniband/hw/hns/hns_roce_hw_v2.h | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/infiniband/hw/hns/hns_roce_hw_v2.h +3 -4
index 82dd9f6..05bfe07 100644
@@ -1241,10 +1241,9 @@ struct hns_roce_func_clear {
 };
 
 #define FUNC_CLEAR_RST_FUN_DONE_S 0
-/* Each physical function manages up to 248 virtual functions;
- * it takes up to 100ms for each function to execute clear;
- * if an abnormal reset occurs, it is executed twice at most;
- * so it takes up to 249 * 2 * 100ms.
+/* Each physical function manages up to 248 virtual functions, it takes up to
+ * 100ms for each function to execute clear. If an abnormal reset occurs, it is
+ * executed twice at most, so it takes up to 249 * 2 * 100ms.
  */
 #define HNS_ROCE_V2_FUNC_CLEAR_TIMEOUT_MSECS	(249 * 2 * 100)
 #define HNS_ROCE_V2_READ_FUNC_CLEAR_FLAG_INTERVAL	40
Signature · 1 line
2.8.1
author
#2 lore raw

PATCH 2/3 RDMA/hns: Adjust lp_pktn_ini dynamically

In reply to Weihang Li

lp_pktn_ini means the number of loopback slice packets for long messages, it should depend on MTU(fixed to 4096B currently) and max size of SQ inline.

---
 drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/infiniband/hw/hns/hns_roce_hw_v2.c +2 -1
index f70370d..7643b06 100644
@@ -3977,7 +3977,8 @@ static int modify_qp_init_to_rtr(struct ib_qp *ibqp,
 
 	/* mtu*(2^LP_PKTN_INI) should not bigger than 1 message length 64kb */
 	roce_set_field(context->byte_56_dqpn_err, V2_QPC_BYTE_56_LP_PKTN_INI_M,
-		       V2_QPC_BYTE_56_LP_PKTN_INI_S, 0);
+		       V2_QPC_BYTE_56_LP_PKTN_INI_S,
+		       ilog2(hr_dev->caps.max_sq_inline / IB_MTU_4096));
 	roce_set_field(qpc_mask->byte_56_dqpn_err, V2_QPC_BYTE_56_LP_PKTN_INI_M,
 		       V2_QPC_BYTE_56_LP_PKTN_INI_S, 0);
 
Signature · 1 line
2.8.1
author
#3 lore raw

PATCH 3/3 RDMA/hns: Remove redundant assignment of caps

In reply to Weihang Li

From: Wenpeng Liang <[email protected]>

These caps are assigned in query_pf_caps() or set_default_caps(), and should not be assigned out of these two functions.

---
 drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/infiniband/hw/hns/hns_roce_hw_v2.c +0 -5
index 7643b06..ad9a11a 100644
@@ -2079,11 +2079,6 @@ static int hns_roce_v2_profile(struct hns_roce_dev *hr_dev)
 	hr_dev->vendor_part_id = hr_dev->pci_dev->device;
 	hr_dev->sys_image_guid = be64_to_cpu(hr_dev->ib_dev.node_guid);
 
-	caps->num_mtt_segs	= HNS_ROCE_V2_MAX_MTT_SEGS;
-	caps->num_cqe_segs	= HNS_ROCE_V2_MAX_CQE_SEGS;
-	caps->num_srqwqe_segs	= HNS_ROCE_V2_MAX_SRQWQE_SEGS;
-	caps->num_idx_segs	= HNS_ROCE_V2_MAX_IDX_SEGS;
-
 	caps->pbl_ba_pg_sz	= HNS_ROCE_BA_PG_SZ_SUPPORTED_16K;
 	caps->pbl_buf_pg_sz	= 0;
 	caps->pbl_hop_num	= HNS_ROCE_PBL_HOP_NUM;
Signature · 1 line
2.8.1
#4 lore raw
In reply to Weihang Li
Quoted 6 lines · Weihang Li

Some tiny cleanups for hns driver.

Weihang Li (2):
RDMA/hns: Fix comments with non-English symbols
RDMA/hns: Adjust lp_pktn_ini dynamically

Quoted 6 lines

Wenpeng Liang (1):
RDMA/hns: Remove redundant assignment of caps

 drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 8 ++------
 drivers/infiniband/hw/hns/hns_roce_hw_v2.h | 7 +++----
 2 files changed, 5 insertions(+), 10 deletions(-)

Applied to for-next, thanks

Jason