From: Md Haris Iqbal <haris.iqbal@ionos.com>
To: linux-rdma@vger.kernel.org
Cc: leon@kernel.org, jgg@ziepe.ca, haris.iqbal@ionos.com,
jinpu.wang@ionos.com,
Grzegorz Prajsner <grzegorz.prajsner@ionos.com>
Subject: [PATCH v2 for-next 05/11] RDMA/rtrs-clt: Reuse need_inval from mr
Date: Wed, 21 Aug 2024 13:22:11 +0200 [thread overview]
Message-ID: <20240821112217.41827-6-haris.iqbal@ionos.com> (raw)
In-Reply-To: <20240821112217.41827-1-haris.iqbal@ionos.com>
From: Jack Wang <jinpu.wang@ionos.com>
mr has a member need_inval, which can be used to indicate if
local invalidate is needed, switch to it and remove need_inv
from rtrs_clt_io_req.
Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Md Haris Iqbal <haris.iqbal@ionos.com>
Signed-off-by: Grzegorz Prajsner <grzegorz.prajsner@ionos.com>
---
drivers/infiniband/ulp/rtrs/rtrs-clt.c | 18 +++++++++---------
drivers/infiniband/ulp/rtrs/rtrs-clt.h | 1 -
2 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.c b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
index c1bca8972015..e1557b0cda05 100644
--- a/drivers/infiniband/ulp/rtrs/rtrs-clt.c
+++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
@@ -355,7 +355,7 @@ static void rtrs_clt_inv_rkey_done(struct ib_cq *cq, struct ib_wc *wc)
ib_wc_status_msg(wc->status));
rtrs_rdma_error_recovery(con);
}
- req->need_inv = false;
+ req->mr->need_inval = false;
if (req->need_inv_comp)
complete(&req->inv_comp);
else
@@ -391,7 +391,7 @@ static void complete_rdma_req(struct rtrs_clt_io_req *req, int errno,
clt_path = to_clt_path(con->c.path);
if (req->sg_cnt) {
- if (req->need_inv) {
+ if (req->mr->need_inval) {
/*
* We are here to invalidate read/write requests
* ourselves. In normal scenario server should
@@ -494,7 +494,7 @@ static void process_io_rsp(struct rtrs_clt_path *clt_path, u32 msg_id,
req = &clt_path->reqs[msg_id];
/* Drop need_inv if server responded with send with invalidation */
- req->need_inv &= !w_inval;
+ req->mr->need_inval &= !w_inval;
complete_rdma_req(req, errno, true, false);
}
@@ -961,7 +961,7 @@ static void rtrs_clt_init_req(struct rtrs_clt_io_req *req,
req->dir = dir;
req->con = rtrs_permit_to_clt_con(clt_path, permit);
req->conf = conf;
- req->need_inv = false;
+ req->mr->need_inval = false;
req->need_inv_comp = false;
req->inv_errno = 0;
refcount_set(&req->ref, 1);
@@ -1140,8 +1140,8 @@ static int rtrs_clt_write_req(struct rtrs_clt_io_req *req)
};
wr = &rwr.wr;
fr_en = true;
- req->need_inv = true;
refcount_inc(&req->ref);
+ req->mr->need_inval = true;
}
/*
* Update stats now, after request is successfully sent it is not
@@ -1159,8 +1159,8 @@ static int rtrs_clt_write_req(struct rtrs_clt_io_req *req)
clt_path->hca_port);
if (req->mp_policy == MP_POLICY_MIN_INFLIGHT)
atomic_dec(&clt_path->stats->inflight);
- if (req->need_inv) {
- req->need_inv = false;
+ if (req->mr->need_inval) {
+ req->mr->need_inval = false;
refcount_dec(&req->ref);
}
if (req->sg_cnt)
@@ -1236,7 +1236,7 @@ static int rtrs_clt_read_req(struct rtrs_clt_io_req *req)
msg->desc[0].len = cpu_to_le32(req->mr->length);
/* Further invalidation is required */
- req->need_inv = !!RTRS_MSG_NEED_INVAL_F;
+ req->mr->need_inval = !!RTRS_MSG_NEED_INVAL_F;
} else {
msg->sg_cnt = 0;
@@ -1269,7 +1269,7 @@ static int rtrs_clt_read_req(struct rtrs_clt_io_req *req)
clt_path->hca_port);
if (req->mp_policy == MP_POLICY_MIN_INFLIGHT)
atomic_dec(&clt_path->stats->inflight);
- req->need_inv = false;
+ req->mr->need_inval = false;
if (req->sg_cnt)
ib_dma_unmap_sg(dev->ib_dev, req->sglist,
req->sg_cnt, req->dir);
diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.h b/drivers/infiniband/ulp/rtrs/rtrs-clt.h
index f848c0392d98..45dac15825f4 100644
--- a/drivers/infiniband/ulp/rtrs/rtrs-clt.h
+++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.h
@@ -115,7 +115,6 @@ struct rtrs_clt_io_req {
struct completion inv_comp;
int inv_errno;
bool need_inv_comp;
- bool need_inv;
refcount_t ref;
};
--
2.25.1
next prev parent reply other threads:[~2024-08-21 11:23 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-21 11:22 [PATCH v2 for-next 00/11] Misc patches for RTRS Md Haris Iqbal
2024-08-21 11:22 ` [PATCH v2 for-next 01/11] RDMA/rtrs: For HB error add additional clt/srv specific logging Md Haris Iqbal
2024-08-21 11:22 ` [PATCH v2 for-next 02/11] RDMA/rtrs-clt: Fix need_inv setting in error case Md Haris Iqbal
2024-08-21 11:22 ` [PATCH v2 for-next 03/11] RDMA/rtrs-clt: Rate limit errors in IO path Md Haris Iqbal
2024-08-21 11:22 ` [PATCH v2 for-next 04/11] RDMA/rtrs: Reset hb_missed_cnt after receiving other traffic from peer Md Haris Iqbal
2024-08-21 11:22 ` Md Haris Iqbal [this message]
2024-08-21 11:22 ` [PATCH v2 for-next 06/11] RDMA/rtrs-clt: Reset cid to con_num - 1 to stay in bounds Md Haris Iqbal
2024-08-21 11:22 ` [PATCH v2 for-next 07/11] RDMA/rtrs-clt: Print request type for errors Md Haris Iqbal
2024-08-21 11:22 ` [PATCH v2 for-next 08/11] RDMA/rtrs-srv: Avoid null pointer deref during path establishment Md Haris Iqbal
2024-08-21 11:22 ` [PATCH v2 for-next 09/11] RDMA/rtrs: register ib event handler Md Haris Iqbal
2024-08-21 11:22 ` [PATCH v2 for-next 10/11] RDMA/rtrs-clt: Do local invalidate after write io completion Md Haris Iqbal
2024-08-21 11:22 ` [PATCH v2 for-next 11/11] RDMA/rtrs-clt: Remove an extra space Md Haris Iqbal
2024-08-28 11:00 ` [PATCH v2 for-next 00/11] Misc patches for RTRS Haris Iqbal
2024-08-28 11:05 ` 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=20240821112217.41827-6-haris.iqbal@ionos.com \
--to=haris.iqbal@ionos.com \
--cc=grzegorz.prajsner@ionos.com \
--cc=jgg@ziepe.ca \
--cc=jinpu.wang@ionos.com \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
/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