From: Shiraz Saleem <shiraz.saleem@intel.com>
To: jgg@nvidia.com, leon@kernel.org
Cc: linux-rdma@vger.kernel.org,
Sindhu-Devale <sindhu.devale@intel.com>,
Shiraz Saleem <shiraz.saleem@intel.com>
Subject: [PATCH for-rc 2/5] RDMA/irdma: Return error on MR deregister CQP failure
Date: Tue, 6 Sep 2022 17:32:41 -0500 [thread overview]
Message-ID: <20220906223244.1119-3-shiraz.saleem@intel.com> (raw)
In-Reply-To: <20220906223244.1119-1-shiraz.saleem@intel.com>
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
next prev parent reply other threads:[~2022-09-06 22:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220906223244.1119-3-shiraz.saleem@intel.com \
--to=shiraz.saleem@intel.com \
--cc=jgg@nvidia.com \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=sindhu.devale@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox