Home Home > GIT Browse > openSUSE-15.1
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bogendoerfer <tbogendoerfer@suse.de>2019-06-07 13:27:44 +0200
committerThomas Bogendoerfer <tbogendoerfer@suse.de>2019-06-07 13:30:12 +0200
commit6912f9068e4f60da0b6a16b322407eebbcebf5f9 (patch)
tree90b223e1dabab88c0a77c3722c0ab766e3f5f329
parent0d90f48d06f1b4ce20ea8fbd3095d579a3b72461 (diff)
RDMA/hns: Only assgin some fields if the relatived attr_mask
is set (bsc#1104427 FATE#326416).
-rw-r--r--patches.drivers/RDMA-hns-Only-assgin-some-fields-if-the-relatived-at.patch248
-rw-r--r--series.conf1
2 files changed, 249 insertions, 0 deletions
diff --git a/patches.drivers/RDMA-hns-Only-assgin-some-fields-if-the-relatived-at.patch b/patches.drivers/RDMA-hns-Only-assgin-some-fields-if-the-relatived-at.patch
new file mode 100644
index 0000000000..1f92cbf96e
--- /dev/null
+++ b/patches.drivers/RDMA-hns-Only-assgin-some-fields-if-the-relatived-at.patch
@@ -0,0 +1,248 @@
+From: Lijun Ou <oulijun@huawei.com>
+Date: Sat, 23 Feb 2019 20:01:24 +0800
+Subject: RDMA/hns: Only assgin some fields if the relatived attr_mask is set
+Patch-mainline: v5.2-rc1
+Git-commit: 5b01b243b0b3725b4460e8924e1f105bb4038969
+References: bsc#1104427 FATE#326416
+
+According to IB protocol, some fields of qp context are filled with
+optional when the relatived attr_mask are set. The relatived attr_mask
+include IB_QP_TIMEOUT, IB_QP_RETRY_CNT, IB_QP_RNR_RETRY and
+IB_QP_MIN_RNR_TIMER. Besides, we move some assignments of the fields of
+qp context into the outside of the specific qp state jump function.
+
+Signed-off-by: Lijun Ou <oulijun@huawei.com>
+Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
+Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
+---
+ drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 152 +++++++++++++++--------------
+ 1 file changed, 81 insertions(+), 71 deletions(-)
+
+--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
++++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
+@@ -3176,12 +3176,6 @@ static void modify_qp_reset_to_init(stru
+ roce_set_bit(qpc_mask->byte_28_at_fl, V2_QPC_BYTE_28_CNP_TX_FLAG_S, 0);
+ roce_set_bit(qpc_mask->byte_28_at_fl, V2_QPC_BYTE_28_CE_FLAG_S, 0);
+
+- if (attr_mask & IB_QP_QKEY) {
+- context->qkey_xrcd = attr->qkey;
+- qpc_mask->qkey_xrcd = 0;
+- hr_qp->qkey = attr->qkey;
+- }
+-
+ if (hr_qp->rdb_en) {
+ roce_set_bit(context->byte_68_rq_db,
+ V2_QPC_BYTE_68_RQ_RECORD_EN_S, 1);
+@@ -3393,7 +3387,6 @@ static void modify_qp_reset_to_init(stru
+ 0);
+
+ hr_qp->access_flags = attr->qp_access_flags;
+- hr_qp->pkey_index = attr->pkey_index;
+ roce_set_field(context->byte_252_err_txcqn, V2_QPC_BYTE_252_TX_CQN_M,
+ V2_QPC_BYTE_252_TX_CQN_S, to_hr_cq(ibqp->send_cq)->cqn);
+ roce_set_field(qpc_mask->byte_252_err_txcqn, V2_QPC_BYTE_252_TX_CQN_M,
+@@ -3517,11 +3510,6 @@ static void modify_qp_init_to_init(struc
+ V2_QPC_BYTE_76_SRQN_M, V2_QPC_BYTE_76_SRQN_S, 0);
+ }
+
+- if (attr_mask & IB_QP_QKEY) {
+- context->qkey_xrcd = attr->qkey;
+- qpc_mask->qkey_xrcd = 0;
+- }
+-
+ roce_set_field(context->byte_4_sqpn_tst, V2_QPC_BYTE_4_SQPN_M,
+ V2_QPC_BYTE_4_SQPN_S, hr_qp->qpn);
+ roce_set_field(qpc_mask->byte_4_sqpn_tst, V2_QPC_BYTE_4_SQPN_M,
+@@ -3641,13 +3629,6 @@ static int modify_qp_init_to_rtr(struct
+ V2_QPC_BYTE_16_WQE_SGE_BUF_PG_SZ_M,
+ V2_QPC_BYTE_16_WQE_SGE_BUF_PG_SZ_S, 0);
+
+- roce_set_field(context->byte_80_rnr_rx_cqn,
+- V2_QPC_BYTE_80_MIN_RNR_TIME_M,
+- V2_QPC_BYTE_80_MIN_RNR_TIME_S, attr->min_rnr_timer);
+- roce_set_field(qpc_mask->byte_80_rnr_rx_cqn,
+- V2_QPC_BYTE_80_MIN_RNR_TIME_M,
+- V2_QPC_BYTE_80_MIN_RNR_TIME_S, 0);
+-
+ page_size = 1 << (hr_dev->caps.mtt_buf_pg_sz + PAGE_SHIFT);
+ context->rq_cur_blk_addr = (u32)(mtts[hr_qp->rq.offset / page_size]
+ >> PAGE_ADDR_SHIFT);
+@@ -3713,15 +3694,6 @@ static int modify_qp_init_to_rtr(struct
+ roce_set_bit(qpc_mask->byte_28_at_fl, V2_QPC_BYTE_28_LBI_S, 0);
+ }
+
+- if ((attr_mask & IB_QP_MAX_DEST_RD_ATOMIC) &&
+- attr->max_dest_rd_atomic) {
+- roce_set_field(context->byte_140_raq, V2_QPC_BYTE_140_RR_MAX_M,
+- V2_QPC_BYTE_140_RR_MAX_S,
+- fls(attr->max_dest_rd_atomic - 1));
+- roce_set_field(qpc_mask->byte_140_raq, V2_QPC_BYTE_140_RR_MAX_M,
+- V2_QPC_BYTE_140_RR_MAX_S, 0);
+- }
+-
+ if (attr_mask & IB_QP_DEST_QPN) {
+ roce_set_field(context->byte_56_dqpn_err, V2_QPC_BYTE_56_DQPN_M,
+ V2_QPC_BYTE_56_DQPN_S, attr->dest_qp_num);
+@@ -3902,57 +3874,14 @@ static int modify_qp_rtr_to_rts(struct i
+ roce_set_field(qpc_mask->byte_212_lsn, V2_QPC_BYTE_212_CHECK_FLG_M,
+ V2_QPC_BYTE_212_CHECK_FLG_S, 0);
+
+- roce_set_field(context->byte_212_lsn, V2_QPC_BYTE_212_RETRY_CNT_M,
+- V2_QPC_BYTE_212_RETRY_CNT_S, attr->retry_cnt);
+- roce_set_field(qpc_mask->byte_212_lsn, V2_QPC_BYTE_212_RETRY_CNT_M,
+- V2_QPC_BYTE_212_RETRY_CNT_S, 0);
+-
+- roce_set_field(context->byte_212_lsn, V2_QPC_BYTE_212_RETRY_NUM_INIT_M,
+- V2_QPC_BYTE_212_RETRY_NUM_INIT_S, attr->retry_cnt);
+- roce_set_field(qpc_mask->byte_212_lsn, V2_QPC_BYTE_212_RETRY_NUM_INIT_M,
+- V2_QPC_BYTE_212_RETRY_NUM_INIT_S, 0);
+-
+- roce_set_field(context->byte_244_rnr_rxack,
+- V2_QPC_BYTE_244_RNR_NUM_INIT_M,
+- V2_QPC_BYTE_244_RNR_NUM_INIT_S, attr->rnr_retry);
+- roce_set_field(qpc_mask->byte_244_rnr_rxack,
+- V2_QPC_BYTE_244_RNR_NUM_INIT_M,
+- V2_QPC_BYTE_244_RNR_NUM_INIT_S, 0);
+-
+- roce_set_field(context->byte_244_rnr_rxack, V2_QPC_BYTE_244_RNR_CNT_M,
+- V2_QPC_BYTE_244_RNR_CNT_S, attr->rnr_retry);
+- roce_set_field(qpc_mask->byte_244_rnr_rxack, V2_QPC_BYTE_244_RNR_CNT_M,
+- V2_QPC_BYTE_244_RNR_CNT_S, 0);
+-
+ roce_set_field(context->byte_212_lsn, V2_QPC_BYTE_212_LSN_M,
+ V2_QPC_BYTE_212_LSN_S, 0x100);
+ roce_set_field(qpc_mask->byte_212_lsn, V2_QPC_BYTE_212_LSN_M,
+ V2_QPC_BYTE_212_LSN_S, 0);
+
+- if (attr_mask & IB_QP_TIMEOUT) {
+- if (attr->timeout < 31) {
+- roce_set_field(context->byte_28_at_fl,
+- V2_QPC_BYTE_28_AT_M, V2_QPC_BYTE_28_AT_S,
+- attr->timeout);
+- roce_set_field(qpc_mask->byte_28_at_fl,
+- V2_QPC_BYTE_28_AT_M, V2_QPC_BYTE_28_AT_S,
+- 0);
+- } else {
+- dev_warn(dev, "Local ACK timeout shall be 0 to 30.\n");
+- }
+- }
+-
+ roce_set_field(qpc_mask->byte_196_sq_psn, V2_QPC_BYTE_196_IRRL_HEAD_M,
+ V2_QPC_BYTE_196_IRRL_HEAD_S, 0);
+
+- if ((attr_mask & IB_QP_MAX_QP_RD_ATOMIC) && attr->max_rd_atomic) {
+- roce_set_field(context->byte_208_irrl, V2_QPC_BYTE_208_SR_MAX_M,
+- V2_QPC_BYTE_208_SR_MAX_S,
+- fls(attr->max_rd_atomic - 1));
+- roce_set_field(qpc_mask->byte_208_irrl,
+- V2_QPC_BYTE_208_SR_MAX_M,
+- V2_QPC_BYTE_208_SR_MAX_S, 0);
+- }
+ return 0;
+ }
+
+@@ -4146,6 +4075,53 @@ static int hns_roce_v2_modify_qp(struct
+ hr_qp->sl = rdma_ah_get_sl(&attr->ah_attr);
+ }
+
++ if (attr_mask & IB_QP_TIMEOUT) {
++ if (attr->timeout < 31) {
++ roce_set_field(context->byte_28_at_fl,
++ V2_QPC_BYTE_28_AT_M, V2_QPC_BYTE_28_AT_S,
++ attr->timeout);
++ roce_set_field(qpc_mask->byte_28_at_fl,
++ V2_QPC_BYTE_28_AT_M, V2_QPC_BYTE_28_AT_S,
++ 0);
++ } else {
++ dev_warn(dev, "Local ACK timeout shall be 0 to 30.\n");
++ }
++ }
++
++ if (attr_mask & IB_QP_RETRY_CNT) {
++ roce_set_field(context->byte_212_lsn,
++ V2_QPC_BYTE_212_RETRY_NUM_INIT_M,
++ V2_QPC_BYTE_212_RETRY_NUM_INIT_S,
++ attr->retry_cnt);
++ roce_set_field(qpc_mask->byte_212_lsn,
++ V2_QPC_BYTE_212_RETRY_NUM_INIT_M,
++ V2_QPC_BYTE_212_RETRY_NUM_INIT_S, 0);
++
++ roce_set_field(context->byte_212_lsn,
++ V2_QPC_BYTE_212_RETRY_CNT_M,
++ V2_QPC_BYTE_212_RETRY_CNT_S,
++ attr->retry_cnt);
++ roce_set_field(qpc_mask->byte_212_lsn,
++ V2_QPC_BYTE_212_RETRY_CNT_M,
++ V2_QPC_BYTE_212_RETRY_CNT_S, 0);
++ }
++
++ if (attr_mask & IB_QP_RNR_RETRY) {
++ roce_set_field(context->byte_244_rnr_rxack,
++ V2_QPC_BYTE_244_RNR_NUM_INIT_M,
++ V2_QPC_BYTE_244_RNR_NUM_INIT_S, attr->rnr_retry);
++ roce_set_field(qpc_mask->byte_244_rnr_rxack,
++ V2_QPC_BYTE_244_RNR_NUM_INIT_M,
++ V2_QPC_BYTE_244_RNR_NUM_INIT_S, 0);
++
++ roce_set_field(context->byte_244_rnr_rxack,
++ V2_QPC_BYTE_244_RNR_CNT_M,
++ V2_QPC_BYTE_244_RNR_CNT_S, attr->rnr_retry);
++ roce_set_field(qpc_mask->byte_244_rnr_rxack,
++ V2_QPC_BYTE_244_RNR_CNT_M,
++ V2_QPC_BYTE_244_RNR_CNT_S, 0);
++ }
++
+ if (attr_mask & IB_QP_SQ_PSN) {
+ roce_set_field(context->byte_172_sq_psn,
+ V2_QPC_BYTE_172_SQ_CUR_PSN_M,
+@@ -4192,9 +4168,37 @@ static int hns_roce_v2_modify_qp(struct
+ V2_QPC_BYTE_244_RX_ACK_EPSN_S, 0);
+ }
+
++ if ((attr_mask & IB_QP_MAX_DEST_RD_ATOMIC) &&
++ attr->max_dest_rd_atomic) {
++ roce_set_field(context->byte_140_raq, V2_QPC_BYTE_140_RR_MAX_M,
++ V2_QPC_BYTE_140_RR_MAX_S,
++ fls(attr->max_dest_rd_atomic - 1));
++ roce_set_field(qpc_mask->byte_140_raq, V2_QPC_BYTE_140_RR_MAX_M,
++ V2_QPC_BYTE_140_RR_MAX_S, 0);
++ }
++
++ if ((attr_mask & IB_QP_MAX_QP_RD_ATOMIC) && attr->max_rd_atomic) {
++ roce_set_field(context->byte_208_irrl, V2_QPC_BYTE_208_SR_MAX_M,
++ V2_QPC_BYTE_208_SR_MAX_S,
++ fls(attr->max_rd_atomic - 1));
++ roce_set_field(qpc_mask->byte_208_irrl,
++ V2_QPC_BYTE_208_SR_MAX_M,
++ V2_QPC_BYTE_208_SR_MAX_S, 0);
++ }
++
+ if (attr_mask & (IB_QP_ACCESS_FLAGS | IB_QP_MAX_DEST_RD_ATOMIC))
+ set_access_flags(hr_qp, context, qpc_mask, attr, attr_mask);
+
++ if (attr_mask & IB_QP_MIN_RNR_TIMER) {
++ roce_set_field(context->byte_80_rnr_rx_cqn,
++ V2_QPC_BYTE_80_MIN_RNR_TIME_M,
++ V2_QPC_BYTE_80_MIN_RNR_TIME_S,
++ attr->min_rnr_timer);
++ roce_set_field(qpc_mask->byte_80_rnr_rx_cqn,
++ V2_QPC_BYTE_80_MIN_RNR_TIME_M,
++ V2_QPC_BYTE_80_MIN_RNR_TIME_S, 0);
++ }
++
+ /* RC&UC required attr */
+ if (attr_mask & IB_QP_RQ_PSN) {
+ roce_set_field(context->byte_108_rx_reqepsn,
+@@ -4211,6 +4215,12 @@ static int hns_roce_v2_modify_qp(struct
+ V2_QPC_BYTE_152_RAQ_PSN_S, 0);
+ }
+
++ if (attr_mask & IB_QP_QKEY) {
++ context->qkey_xrcd = attr->qkey;
++ qpc_mask->qkey_xrcd = 0;
++ hr_qp->qkey = attr->qkey;
++ }
++
+ roce_set_bit(context->byte_108_rx_reqepsn, V2_QPC_BYTE_108_INV_CREDIT_S,
+ ibqp->srq ? 1 : 0);
+ roce_set_bit(qpc_mask->byte_108_rx_reqepsn,
diff --git a/series.conf b/series.conf
index abb4bc920f..7b9c5f79ff 100644
--- a/series.conf
+++ b/series.conf
@@ -46613,6 +46613,7 @@
patches.drivers/RDMA-hns-Only-assign-the-relatived-fields-of-psn-if-.patch
patches.drivers/RDMA-hns-Only-assign-the-fields-of-the-rq-psn-if-IB_.patch
patches.drivers/RDMA-hns-Update-the-range-of-raq_psn-field-of-qp-con.patch
+ patches.drivers/RDMA-hns-Only-assgin-some-fields-if-the-relatived-at.patch
patches.drivers/RDMA-i40iw-Handle-workqueue-allocation-failure.patch
patches.fixes/overflow-Fix-Wtype-limits-compilation-warnings.patch
patches.drivers/IB-hfi1-Fix-two-format-strings.patch