linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bob Pearson <rpearsonhpe@gmail.com>
To: jgg@nvidia.com, zyjzyj2000@gmail.com, edwards@nvidia.com,
	linux-rdma@vger.kernel.org
Cc: Bob Pearson <rpearsonhpe@gmail.com>
Subject: [PATCH for-next 1/6] RDMA/rxe: Rename IB_ACCESS_REMOTE
Date: Tue, 30 May 2023 17:13:30 -0500	[thread overview]
Message-ID: <20230530221334.89432-2-rpearsonhpe@gmail.com> (raw)
In-Reply-To: <20230530221334.89432-1-rpearsonhpe@gmail.com>

Rename IB_ACCESS_REMOTE to RXE_ACCESS_REMOTE and move to
rxe_verbs.h as an enum instead of a #define. Shouldn't
use IB_xxx for rxe symbols.

Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
---
 drivers/infiniband/sw/rxe/rxe_mr.c    | 10 +++-------
 drivers/infiniband/sw/rxe/rxe_verbs.h |  6 ++++++
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_mr.c b/drivers/infiniband/sw/rxe/rxe_mr.c
index 0e538fafcc20..b3bc4ac5fedd 100644
--- a/drivers/infiniband/sw/rxe/rxe_mr.c
+++ b/drivers/infiniband/sw/rxe/rxe_mr.c
@@ -45,14 +45,10 @@ int mr_check_range(struct rxe_mr *mr, u64 iova, size_t length)
 	}
 }
 
-#define IB_ACCESS_REMOTE	(IB_ACCESS_REMOTE_READ		\
-				| IB_ACCESS_REMOTE_WRITE	\
-				| IB_ACCESS_REMOTE_ATOMIC)
-
 static void rxe_mr_init(int access, struct rxe_mr *mr)
 {
 	u32 lkey = mr->elem.index << 8 | rxe_get_next_key(-1);
-	u32 rkey = (access & IB_ACCESS_REMOTE) ? lkey : 0;
+	u32 rkey = (access & RXE_ACCESS_REMOTE) ? lkey : 0;
 
 	/* set ibmr->l/rkey and also copy into private l/rkey
 	 * for user MRs these will always be the same
@@ -195,7 +191,7 @@ int rxe_mr_init_fast(int max_pages, struct rxe_mr *mr)
 	int err;
 
 	/* always allow remote access for FMRs */
-	rxe_mr_init(IB_ACCESS_REMOTE, mr);
+	rxe_mr_init(RXE_ACCESS_REMOTE, mr);
 
 	err = rxe_mr_alloc(mr, max_pages);
 	if (err)
@@ -715,7 +711,7 @@ int rxe_reg_fast_mr(struct rxe_qp *qp, struct rxe_send_wqe *wqe)
 
 	mr->access = access;
 	mr->lkey = key;
-	mr->rkey = (access & IB_ACCESS_REMOTE) ? key : 0;
+	mr->rkey = (access & RXE_ACCESS_REMOTE) ? key : 0;
 	mr->ibmr.iova = wqe->wr.wr.reg.mr->iova;
 	mr->state = RXE_MR_STATE_VALID;
 
diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.h b/drivers/infiniband/sw/rxe/rxe_verbs.h
index 26a20f088692..0a2b7343e38f 100644
--- a/drivers/infiniband/sw/rxe/rxe_verbs.h
+++ b/drivers/infiniband/sw/rxe/rxe_verbs.h
@@ -253,6 +253,12 @@ struct rxe_qp {
 	struct execute_work	cleanup_work;
 };
 
+enum rxe_access {
+	RXE_ACCESS_REMOTE	= (IB_ACCESS_REMOTE_READ
+				| IB_ACCESS_REMOTE_WRITE
+				| IB_ACCESS_REMOTE_ATOMIC),
+};
+
 enum rxe_mr_state {
 	RXE_MR_STATE_INVALID,
 	RXE_MR_STATE_FREE,
-- 
2.39.2


  reply	other threads:[~2023-05-30 22:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-30 22:13 [PATCH for-next 0/6] Misc cleanups and implement rereg_user_mr Bob Pearson
2023-05-30 22:13 ` Bob Pearson [this message]
2023-05-30 22:13 ` [PATCH for-next 2/6] rdma/rxe: Optimize send path in rxe_resp.c Bob Pearson
2023-05-30 22:13 ` [PATCH for-next 3/6] RDMA/rxe: Fix access checks in rxe_check_bind_mw Bob Pearson
2023-05-30 22:13 ` [PATCH for-next 4/6] RDMA/rxe: Introduce rxe access supported flags Bob Pearson
2023-05-30 22:13 ` [PATCH for-next 5/6] RDMA/rxe: Let rkey == lkey for local access Bob Pearson
2023-05-30 22:13 ` [PATCH for-next 6/6] RDMA/rxe: Implement rereg_user_mr Bob Pearson
2023-06-09 16:22 ` [PATCH for-next 0/6] Misc cleanups and implement rereg_user_mr Jason Gunthorpe

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=20230530221334.89432-2-rpearsonhpe@gmail.com \
    --to=rpearsonhpe@gmail.com \
    --cc=edwards@nvidia.com \
    --cc=jgg@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=zyjzyj2000@gmail.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;
as well as URLs for NNTP newsgroup(s).