Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
* [PATCH for-rc 0/5] irdma for-rc updates 9-6-2022
@ 2022-09-06 22:32 Shiraz Saleem
  2022-09-06 22:32 ` [PATCH for-rc 1/5] RDMA/irdma: Report the correct max cqes from query device Shiraz Saleem
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Shiraz Saleem @ 2022-09-06 22:32 UTC (permalink / raw)
  To: jgg, leon; +Cc: linux-rdma, Shiraz Saleem

This series contains a small set of -rc fixes for 6.0 cycle.

Sindhu-Devale (5):
  RDMA/irdma: Report the correct max cqes from query device
  RDMA/irdma: Return error on MR deregister CQP failure
  RDMA/irdma: Return correct WC error for bind operation failure
  RDMA/irdma: Use s/g array in post send only when its valid
  RDMA/irdma: Report RNR NAK generation in device caps

 drivers/infiniband/hw/irdma/uk.c    |  7 +++++--
 drivers/infiniband/hw/irdma/utils.c | 13 ++++++++-----
 drivers/infiniband/hw/irdma/verbs.c | 13 ++++++++++---
 3 files changed, 23 insertions(+), 10 deletions(-)

-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH for-rc 1/5] RDMA/irdma: Report the correct max cqes from query device
  2022-09-06 22:32 [PATCH for-rc 0/5] irdma for-rc updates 9-6-2022 Shiraz Saleem
@ 2022-09-06 22:32 ` Shiraz Saleem
  2022-09-06 22:32 ` [PATCH for-rc 2/5] RDMA/irdma: Return error on MR deregister CQP failure Shiraz Saleem
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Shiraz Saleem @ 2022-09-06 22:32 UTC (permalink / raw)
  To: jgg, leon; +Cc: linux-rdma, Sindhu-Devale, Shiraz Saleem

From: Sindhu-Devale <sindhu.devale@intel.com>

Report the correct max cqes available to an application taking
into account a reserved entry to detect overflow.

Fixes: b48c24c2d710 ("RDMA/irdma: Implement device supported verb APIs")
Signed-off-by: Sindhu-Devale <sindhu.devale@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
---
 drivers/infiniband/hw/irdma/verbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c
index 9b07b8a..f272a32 100644
--- a/drivers/infiniband/hw/irdma/verbs.c
+++ b/drivers/infiniband/hw/irdma/verbs.c
@@ -39,7 +39,7 @@ static int irdma_query_device(struct ib_device *ibdev,
 	props->max_send_sge = hw_attrs->uk_attrs.max_hw_wq_frags;
 	props->max_recv_sge = hw_attrs->uk_attrs.max_hw_wq_frags;
 	props->max_cq = rf->max_cq - rf->used_cqs;
-	props->max_cqe = rf->max_cqe;
+	props->max_cqe = rf->max_cqe - 1;
 	props->max_mr = rf->max_mr - rf->used_mrs;
 	props->max_mw = props->max_mr;
 	props->max_pd = rf->max_pd - rf->used_pds;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH for-rc 2/5] RDMA/irdma: Return error on MR deregister CQP failure
  2022-09-06 22:32 [PATCH for-rc 0/5] irdma for-rc updates 9-6-2022 Shiraz Saleem
  2022-09-06 22:32 ` [PATCH for-rc 1/5] RDMA/irdma: Report the correct max cqes from query device Shiraz Saleem
@ 2022-09-06 22:32 ` Shiraz Saleem
  2022-09-06 22:32 ` [PATCH for-rc 3/5] RDMA/irdma: Return correct WC error for bind operation failure Shiraz Saleem
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Shiraz Saleem @ 2022-09-06 22:32 UTC (permalink / raw)
  To: jgg, leon; +Cc: linux-rdma, Sindhu-Devale, Shiraz Saleem

From: Sindhu-Devale <sindhu.devale@intel.com>

The MR deregister CQP can fail if an MW is bound to it.
Return an appropriate error for this case.

Fixes: b48c24c2d710 ("RDMA/irdma: Implement device supported verb APIs")
Signed-off-by: Sindhu-Devale <sindhu.devale@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
---
 drivers/infiniband/hw/irdma/utils.c | 13 ++++++++-----
 drivers/infiniband/hw/irdma/verbs.c |  6 +++++-
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/drivers/infiniband/hw/irdma/utils.c b/drivers/infiniband/hw/irdma/utils.c
index c8b9235..075defa 100644
--- a/drivers/infiniband/hw/irdma/utils.c
+++ b/drivers/infiniband/hw/irdma/utils.c
@@ -590,11 +590,14 @@ static int irdma_wait_event(struct irdma_pci_f *rf,
 	cqp_error = cqp_request->compl_info.error;
 	if (cqp_error) {
 		err_code = -EIO;
-		if (cqp_request->compl_info.maj_err_code == 0xFFFF &&
-		    cqp_request->compl_info.min_err_code == 0x8029) {
-			if (!rf->reset) {
-				rf->reset = true;
-				rf->gen_ops.request_reset(rf);
+		if (cqp_request->compl_info.maj_err_code == 0xFFFF) {
+			if (cqp_request->compl_info.min_err_code == 0x8002)
+				err_code = -EBUSY;
+			else if (cqp_request->compl_info.min_err_code == 0x8029) {
+				if (!rf->reset) {
+					rf->reset = true;
+					rf->gen_ops.request_reset(rf);
+				}
 			}
 		}
 	}
diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c
index f272a32..892467c 100644
--- a/drivers/infiniband/hw/irdma/verbs.c
+++ b/drivers/infiniband/hw/irdma/verbs.c
@@ -3009,6 +3009,7 @@ static int irdma_dereg_mr(struct ib_mr *ib_mr, struct ib_udata *udata)
 	struct irdma_pble_alloc *palloc = &iwpbl->pble_alloc;
 	struct irdma_cqp_request *cqp_request;
 	struct cqp_cmds_info *cqp_info;
+	int status;
 
 	if (iwmr->type != IRDMA_MEMREG_TYPE_MEM) {
 		if (iwmr->region) {
@@ -3039,8 +3040,11 @@ static int irdma_dereg_mr(struct ib_mr *ib_mr, struct ib_udata *udata)
 	cqp_info->post_sq = 1;
 	cqp_info->in.u.dealloc_stag.dev = &iwdev->rf->sc_dev;
 	cqp_info->in.u.dealloc_stag.scratch = (uintptr_t)cqp_request;
-	irdma_handle_cqp_op(iwdev->rf, cqp_request);
+	status = irdma_handle_cqp_op(iwdev->rf, cqp_request);
 	irdma_put_cqp_request(&iwdev->rf->cqp, cqp_request);
+	if (status)
+		return status;
+
 	irdma_free_stag(iwdev, iwmr->stag);
 done:
 	if (iwpbl->pbl_allocated)
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH for-rc 3/5] RDMA/irdma: Return correct WC error for bind operation failure
  2022-09-06 22:32 [PATCH for-rc 0/5] irdma for-rc updates 9-6-2022 Shiraz Saleem
  2022-09-06 22:32 ` [PATCH for-rc 1/5] RDMA/irdma: Report the correct max cqes from query device Shiraz Saleem
  2022-09-06 22:32 ` [PATCH for-rc 2/5] RDMA/irdma: Return error on MR deregister CQP failure Shiraz Saleem
@ 2022-09-06 22:32 ` Shiraz Saleem
  2022-09-06 22:32 ` [PATCH for-rc 4/5] RDMA/irdma: Use s/g array in post send only when its valid Shiraz Saleem
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Shiraz Saleem @ 2022-09-06 22:32 UTC (permalink / raw)
  To: jgg, leon; +Cc: linux-rdma, Sindhu-Devale, Shiraz Saleem

From: Sindhu-Devale <sindhu.devale@intel.com>

When a QP and a MR on a local host are in different PDs, the HW generates
an asynchronous event (AE). The same AE is generated when a QP and a MW
are in different PDs during a bind operation. Return the more appropriate
IBV_WC_MW_BIND_ERR for the latter case by checking the OP type from the
CQE in error.

Fixes: 551c46edc769 ("RDMA/irdma: Add user/kernel shared libraries")
Signed-off-by: Sindhu-Devale <sindhu.devale@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
---
 drivers/infiniband/hw/irdma/uk.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/irdma/uk.c b/drivers/infiniband/hw/irdma/uk.c
index daeab5d..d003ad8 100644
--- a/drivers/infiniband/hw/irdma/uk.c
+++ b/drivers/infiniband/hw/irdma/uk.c
@@ -1005,6 +1005,7 @@ int irdma_uk_cq_poll_cmpl(struct irdma_cq_uk *cq,
 	int ret_code;
 	bool move_cq_head = true;
 	u8 polarity;
+	u8 op_type;
 	bool ext_valid;
 	__le64 *ext_cqe;
 
@@ -1187,7 +1188,6 @@ int irdma_uk_cq_poll_cmpl(struct irdma_cq_uk *cq,
 			do {
 				__le64 *sw_wqe;
 				u64 wqe_qword;
-				u8 op_type;
 				u32 tail;
 
 				tail = qp->sq_ring.tail;
@@ -1204,6 +1204,8 @@ int irdma_uk_cq_poll_cmpl(struct irdma_cq_uk *cq,
 					break;
 				}
 			} while (1);
+			if (op_type == IRDMA_OP_TYPE_BIND_MW && info->minor_err == FLUSH_PROT_ERR)
+				info->minor_err = FLUSH_MW_BIND_ERR;
 			qp->sq_flush_seen = true;
 			if (!IRDMA_RING_MORE_WORK(qp->sq_ring))
 				qp->sq_flush_complete = true;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH for-rc 4/5] RDMA/irdma: Use s/g array in post send only when its valid
  2022-09-06 22:32 [PATCH for-rc 0/5] irdma for-rc updates 9-6-2022 Shiraz Saleem
                   ` (2 preceding siblings ...)
  2022-09-06 22:32 ` [PATCH for-rc 3/5] RDMA/irdma: Return correct WC error for bind operation failure Shiraz Saleem
@ 2022-09-06 22:32 ` Shiraz Saleem
  2022-09-06 22:32 ` [PATCH for-rc 5/5] RDMA/irdma: Report RNR NAK generation in device caps Shiraz Saleem
  2022-09-07  8:29 ` [PATCH for-rc 0/5] irdma for-rc updates 9-6-2022 Leon Romanovsky
  5 siblings, 0 replies; 7+ messages in thread
From: Shiraz Saleem @ 2022-09-06 22:32 UTC (permalink / raw)
  To: jgg, leon; +Cc: linux-rdma, Sindhu-Devale, Shiraz Saleem

From: Sindhu-Devale <sindhu.devale@intel.com>

Send with invalidate verb call can pass in an
uninitialized s/g array with 0 sge's which is
filled into irdma WQE and causes a HW asynchronous
event.

Fix this by using the s/g array in irdma post send
only when its valid.

Fixes: 551c46e ("RDMA/irdma: Add user/kernel shared libraries")
Signed-off-by: Sindhu-Devale <sindhu.devale@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
---
 drivers/infiniband/hw/irdma/uk.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/irdma/uk.c b/drivers/infiniband/hw/irdma/uk.c
index d003ad8..a6e5d35 100644
--- a/drivers/infiniband/hw/irdma/uk.c
+++ b/drivers/infiniband/hw/irdma/uk.c
@@ -497,7 +497,8 @@ int irdma_uk_send(struct irdma_qp_uk *qp, struct irdma_post_sq_info *info,
 			      FIELD_PREP(IRDMAQPSQ_IMMDATA, info->imm_data));
 		i = 0;
 	} else {
-		qp->wqe_ops.iw_set_fragment(wqe, 0, op_info->sg_list,
+		qp->wqe_ops.iw_set_fragment(wqe, 0,
+					    frag_cnt ? op_info->sg_list : NULL,
 					    qp->swqe_polarity);
 		i = 1;
 	}
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH for-rc 5/5] RDMA/irdma: Report RNR NAK generation in device caps
  2022-09-06 22:32 [PATCH for-rc 0/5] irdma for-rc updates 9-6-2022 Shiraz Saleem
                   ` (3 preceding siblings ...)
  2022-09-06 22:32 ` [PATCH for-rc 4/5] RDMA/irdma: Use s/g array in post send only when its valid Shiraz Saleem
@ 2022-09-06 22:32 ` Shiraz Saleem
  2022-09-07  8:29 ` [PATCH for-rc 0/5] irdma for-rc updates 9-6-2022 Leon Romanovsky
  5 siblings, 0 replies; 7+ messages in thread
From: Shiraz Saleem @ 2022-09-06 22:32 UTC (permalink / raw)
  To: jgg, leon; +Cc: linux-rdma, Sindhu-Devale, Shiraz Saleem

From: Sindhu-Devale <sindhu.devale@intel.com>

Report RNR NAK generation when device capabilities are queried

Fixes: b48c24c2d710 ("RDMA/irdma: Implement device supported verb APIs")
Signed-off-by: Sindhu-Devale <sindhu.devale@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
---
 drivers/infiniband/hw/irdma/verbs.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c
index 892467c..9b207f5 100644
--- a/drivers/infiniband/hw/irdma/verbs.c
+++ b/drivers/infiniband/hw/irdma/verbs.c
@@ -46,8 +46,11 @@ static int irdma_query_device(struct ib_device *ibdev,
 	props->max_sge_rd = hw_attrs->uk_attrs.max_hw_read_sges;
 	props->max_qp_rd_atom = hw_attrs->max_hw_ird;
 	props->max_qp_init_rd_atom = hw_attrs->max_hw_ord;
-	if (rdma_protocol_roce(ibdev, 1))
+	if (rdma_protocol_roce(ibdev, 1)) {
+		props->device_cap_flags |= IB_DEVICE_RC_RNR_NAK_GEN;
 		props->max_pkeys = IRDMA_PKEY_TBL_SZ;
+	}
+
 	props->max_ah = rf->max_ah;
 	props->max_mcast_grp = rf->max_mcg;
 	props->max_mcast_qp_attach = IRDMA_MAX_MGS_PER_CTX;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH for-rc 0/5] irdma for-rc updates 9-6-2022
  2022-09-06 22:32 [PATCH for-rc 0/5] irdma for-rc updates 9-6-2022 Shiraz Saleem
                   ` (4 preceding siblings ...)
  2022-09-06 22:32 ` [PATCH for-rc 5/5] RDMA/irdma: Report RNR NAK generation in device caps Shiraz Saleem
@ 2022-09-07  8:29 ` Leon Romanovsky
  5 siblings, 0 replies; 7+ messages in thread
From: Leon Romanovsky @ 2022-09-07  8:29 UTC (permalink / raw)
  To: Shiraz Saleem; +Cc: jgg, linux-rdma

On Tue, Sep 06, 2022 at 05:32:39PM -0500, Shiraz Saleem wrote:
> This series contains a small set of -rc fixes for 6.0 cycle.
> 
> Sindhu-Devale (5):
>   RDMA/irdma: Report the correct max cqes from query device
>   RDMA/irdma: Return error on MR deregister CQP failure
>   RDMA/irdma: Return correct WC error for bind operation failure
>   RDMA/irdma: Use s/g array in post send only when its valid
>   RDMA/irdma: Report RNR NAK generation in device caps
> 
>  drivers/infiniband/hw/irdma/uk.c    |  7 +++++--
>  drivers/infiniband/hw/irdma/utils.c | 13 ++++++++-----
>  drivers/infiniband/hw/irdma/verbs.c | 13 ++++++++++---
>  3 files changed, 23 insertions(+), 10 deletions(-)

Thanks, applied.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-09-07  8:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-06 22:32 [PATCH for-rc 0/5] irdma for-rc updates 9-6-2022 Shiraz Saleem
2022-09-06 22:32 ` [PATCH for-rc 1/5] RDMA/irdma: Report the correct max cqes from query device Shiraz Saleem
2022-09-06 22:32 ` [PATCH for-rc 2/5] RDMA/irdma: Return error on MR deregister CQP failure Shiraz Saleem
2022-09-06 22:32 ` [PATCH for-rc 3/5] RDMA/irdma: Return correct WC error for bind operation failure Shiraz Saleem
2022-09-06 22:32 ` [PATCH for-rc 4/5] RDMA/irdma: Use s/g array in post send only when its valid Shiraz Saleem
2022-09-06 22:32 ` [PATCH for-rc 5/5] RDMA/irdma: Report RNR NAK generation in device caps Shiraz Saleem
2022-09-07  8:29 ` [PATCH for-rc 0/5] irdma for-rc updates 9-6-2022 Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox