linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] RDMA/rxe: Do some cleanup for macros
@ 2021-09-14  8:02 Xiao Yang
  2021-09-14  8:02 ` [PATCH 1/3] RDMA/rxe: Add new RXE_READ_OR_WRITE_MASK Xiao Yang
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Xiao Yang @ 2021-09-14  8:02 UTC (permalink / raw)
  To: linux-rdma; +Cc: zyjzyj2000, jgg, Xiao Yang

Xiao Yang (3):
  RDMA/rxe: Add new RXE_READ_OR_WRITE_MASK
  RDMA/rxe: Add MASK suffix for RXE_READ_OR_ATOMIC and RXE_WRITE_OR_SEND
  RDMA/rxe: Remove unused WR_READ_WRITE_OR_SEND_MASK

 drivers/infiniband/sw/rxe/rxe_opcode.h | 6 +++---
 drivers/infiniband/sw/rxe/rxe_req.c    | 6 +++---
 drivers/infiniband/sw/rxe/rxe_resp.c   | 6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)

-- 
2.23.0




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

* [PATCH 1/3] RDMA/rxe: Add new RXE_READ_OR_WRITE_MASK
  2021-09-14  8:02 [PATCH 0/3] RDMA/rxe: Do some cleanup for macros Xiao Yang
@ 2021-09-14  8:02 ` Xiao Yang
  2021-09-14  8:02 ` [PATCH 2/3] RDMA/rxe: Add MASK suffix for RXE_READ_OR_ATOMIC and RXE_WRITE_OR_SEND Xiao Yang
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Xiao Yang @ 2021-09-14  8:02 UTC (permalink / raw)
  To: linux-rdma; +Cc: zyjzyj2000, jgg, Xiao Yang

1) Replace (RXE_READ_MASK | RXE_WRITE_MASK) with RXE_READ_OR_WRITE_MASK.
2) Change (RXE_READ_MASK | RXE_WRITE_OR_SEND) to RXE_READ_OR_WRITE_MASK
   because we don't need to check RETH for RXE_SEND_MASK.

Signed-off-by: Xiao Yang <yangx.jy@fujitsu.com>
---
 drivers/infiniband/sw/rxe/rxe_opcode.h | 1 +
 drivers/infiniband/sw/rxe/rxe_resp.c   | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_opcode.h b/drivers/infiniband/sw/rxe/rxe_opcode.h
index e02f039b8c44..bbeccb1dcec7 100644
--- a/drivers/infiniband/sw/rxe/rxe_opcode.h
+++ b/drivers/infiniband/sw/rxe/rxe_opcode.h
@@ -84,6 +84,7 @@ enum rxe_hdr_mask {
 
 	RXE_READ_OR_ATOMIC	= (RXE_READ_MASK | RXE_ATOMIC_MASK),
 	RXE_WRITE_OR_SEND	= (RXE_WRITE_MASK | RXE_SEND_MASK),
+	RXE_READ_OR_WRITE_MASK	= (RXE_READ_MASK | RXE_WRITE_MASK),
 };
 
 #define OPCODE_NONE		(-1)
diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c
index 5501227ddc65..74fb06df4c6c 100644
--- a/drivers/infiniband/sw/rxe/rxe_resp.c
+++ b/drivers/infiniband/sw/rxe/rxe_resp.c
@@ -429,7 +429,7 @@ static enum resp_states check_rkey(struct rxe_qp *qp,
 	enum resp_states state;
 	int access;
 
-	if (pkt->mask & (RXE_READ_MASK | RXE_WRITE_MASK)) {
+	if (pkt->mask & RXE_READ_OR_WRITE_MASK) {
 		if (pkt->mask & RXE_RETH_MASK) {
 			qp->resp.va = reth_va(pkt);
 			qp->resp.offset = 0;
@@ -450,7 +450,7 @@ static enum resp_states check_rkey(struct rxe_qp *qp,
 	}
 
 	/* A zero-byte op is not required to set an addr or rkey. */
-	if ((pkt->mask & (RXE_READ_MASK | RXE_WRITE_OR_SEND)) &&
+	if ((pkt->mask & RXE_READ_OR_WRITE_MASK) &&
 	    (pkt->mask & RXE_RETH_MASK) &&
 	    reth_len(pkt) == 0) {
 		return RESPST_EXECUTE;
-- 
2.23.0




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

* [PATCH 2/3] RDMA/rxe: Add MASK suffix for RXE_READ_OR_ATOMIC and RXE_WRITE_OR_SEND
  2021-09-14  8:02 [PATCH 0/3] RDMA/rxe: Do some cleanup for macros Xiao Yang
  2021-09-14  8:02 ` [PATCH 1/3] RDMA/rxe: Add new RXE_READ_OR_WRITE_MASK Xiao Yang
@ 2021-09-14  8:02 ` Xiao Yang
  2021-09-14  8:02 ` [PATCH 3/3] RDMA/rxe: Remove unused WR_READ_WRITE_OR_SEND_MASK Xiao Yang
  2021-09-28 14:49 ` [PATCH 0/3] RDMA/rxe: Do some cleanup for macros Jason Gunthorpe
  3 siblings, 0 replies; 5+ messages in thread
From: Xiao Yang @ 2021-09-14  8:02 UTC (permalink / raw)
  To: linux-rdma; +Cc: zyjzyj2000, jgg, Xiao Yang

Signed-off-by: Xiao Yang <yangx.jy@fujitsu.com>
---
 drivers/infiniband/sw/rxe/rxe_opcode.h | 4 ++--
 drivers/infiniband/sw/rxe/rxe_req.c    | 6 +++---
 drivers/infiniband/sw/rxe/rxe_resp.c   | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_opcode.h b/drivers/infiniband/sw/rxe/rxe_opcode.h
index bbeccb1dcec7..e3a46b287c15 100644
--- a/drivers/infiniband/sw/rxe/rxe_opcode.h
+++ b/drivers/infiniband/sw/rxe/rxe_opcode.h
@@ -82,8 +82,8 @@ enum rxe_hdr_mask {
 
 	RXE_LOOPBACK_MASK	= BIT(NUM_HDR_TYPES + 12),
 
-	RXE_READ_OR_ATOMIC	= (RXE_READ_MASK | RXE_ATOMIC_MASK),
-	RXE_WRITE_OR_SEND	= (RXE_WRITE_MASK | RXE_SEND_MASK),
+	RXE_READ_OR_ATOMIC_MASK	= (RXE_READ_MASK | RXE_ATOMIC_MASK),
+	RXE_WRITE_OR_SEND_MASK	= (RXE_WRITE_MASK | RXE_SEND_MASK),
 	RXE_READ_OR_WRITE_MASK	= (RXE_READ_MASK | RXE_WRITE_MASK),
 };
 
diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c
index 3894197a82f6..3e9309a0555e 100644
--- a/drivers/infiniband/sw/rxe/rxe_req.c
+++ b/drivers/infiniband/sw/rxe/rxe_req.c
@@ -472,7 +472,7 @@ static int finish_packet(struct rxe_qp *qp, struct rxe_send_wqe *wqe,
 	if (err)
 		return err;
 
-	if (pkt->mask & RXE_WRITE_OR_SEND) {
+	if (pkt->mask & RXE_WRITE_OR_SEND_MASK) {
 		if (wqe->wr.send_flags & IB_SEND_INLINE) {
 			u8 *tmp = &wqe->dma.inline_data[wqe->dma.sge_offset];
 
@@ -691,13 +691,13 @@ int rxe_requester(void *arg)
 	}
 
 	mask = rxe_opcode[opcode].mask;
-	if (unlikely(mask & RXE_READ_OR_ATOMIC)) {
+	if (unlikely(mask & RXE_READ_OR_ATOMIC_MASK)) {
 		if (check_init_depth(qp, wqe))
 			goto exit;
 	}
 
 	mtu = get_mtu(qp);
-	payload = (mask & RXE_WRITE_OR_SEND) ? wqe->dma.resid : 0;
+	payload = (mask & RXE_WRITE_OR_SEND_MASK) ? wqe->dma.resid : 0;
 	if (payload > mtu) {
 		if (qp_type(qp) == IB_QPT_UD) {
 			/* C10-93.1.1: If the total sum of all the buffer lengths specified for a
diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c
index 74fb06df4c6c..7237d4aa6d8a 100644
--- a/drivers/infiniband/sw/rxe/rxe_resp.c
+++ b/drivers/infiniband/sw/rxe/rxe_resp.c
@@ -374,7 +374,7 @@ static enum resp_states check_resource(struct rxe_qp *qp,
 		}
 	}
 
-	if (pkt->mask & RXE_READ_OR_ATOMIC) {
+	if (pkt->mask & RXE_READ_OR_ATOMIC_MASK) {
 		/* it is the requesters job to not send
 		 * too many read/atomic ops, we just
 		 * recycle the responder resource queue
-- 
2.23.0




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

* [PATCH 3/3] RDMA/rxe: Remove unused WR_READ_WRITE_OR_SEND_MASK
  2021-09-14  8:02 [PATCH 0/3] RDMA/rxe: Do some cleanup for macros Xiao Yang
  2021-09-14  8:02 ` [PATCH 1/3] RDMA/rxe: Add new RXE_READ_OR_WRITE_MASK Xiao Yang
  2021-09-14  8:02 ` [PATCH 2/3] RDMA/rxe: Add MASK suffix for RXE_READ_OR_ATOMIC and RXE_WRITE_OR_SEND Xiao Yang
@ 2021-09-14  8:02 ` Xiao Yang
  2021-09-28 14:49 ` [PATCH 0/3] RDMA/rxe: Do some cleanup for macros Jason Gunthorpe
  3 siblings, 0 replies; 5+ messages in thread
From: Xiao Yang @ 2021-09-14  8:02 UTC (permalink / raw)
  To: linux-rdma; +Cc: zyjzyj2000, jgg, Xiao Yang

Signed-off-by: Xiao Yang <yangx.jy@fujitsu.com>
---
 drivers/infiniband/sw/rxe/rxe_opcode.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_opcode.h b/drivers/infiniband/sw/rxe/rxe_opcode.h
index e3a46b287c15..8f9aaaf260f2 100644
--- a/drivers/infiniband/sw/rxe/rxe_opcode.h
+++ b/drivers/infiniband/sw/rxe/rxe_opcode.h
@@ -22,7 +22,6 @@ enum rxe_wr_mask {
 	WR_LOCAL_OP_MASK		= BIT(5),
 
 	WR_READ_OR_WRITE_MASK		= WR_READ_MASK | WR_WRITE_MASK,
-	WR_READ_WRITE_OR_SEND_MASK	= WR_READ_OR_WRITE_MASK | WR_SEND_MASK,
 	WR_WRITE_OR_SEND_MASK		= WR_WRITE_MASK | WR_SEND_MASK,
 	WR_ATOMIC_OR_READ_MASK		= WR_ATOMIC_MASK | WR_READ_MASK,
 };
-- 
2.23.0




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

* Re: [PATCH 0/3] RDMA/rxe: Do some cleanup for macros
  2021-09-14  8:02 [PATCH 0/3] RDMA/rxe: Do some cleanup for macros Xiao Yang
                   ` (2 preceding siblings ...)
  2021-09-14  8:02 ` [PATCH 3/3] RDMA/rxe: Remove unused WR_READ_WRITE_OR_SEND_MASK Xiao Yang
@ 2021-09-28 14:49 ` Jason Gunthorpe
  3 siblings, 0 replies; 5+ messages in thread
From: Jason Gunthorpe @ 2021-09-28 14:49 UTC (permalink / raw)
  To: Xiao Yang; +Cc: linux-rdma, zyjzyj2000

On Tue, Sep 14, 2021 at 04:02:50PM +0800, Xiao Yang wrote:
> Xiao Yang (3):
>   RDMA/rxe: Add new RXE_READ_OR_WRITE_MASK
>   RDMA/rxe: Add MASK suffix for RXE_READ_OR_ATOMIC and RXE_WRITE_OR_SEND
>   RDMA/rxe: Remove unused WR_READ_WRITE_OR_SEND_MASK
> 
>  drivers/infiniband/sw/rxe/rxe_opcode.h | 6 +++---
>  drivers/infiniband/sw/rxe/rxe_req.c    | 6 +++---
>  drivers/infiniband/sw/rxe/rxe_resp.c   | 6 +++---
>  3 files changed, 9 insertions(+), 9 deletions(-)

Applied to for-next, thanks

Jason

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

end of thread, other threads:[~2021-09-28 14:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-14  8:02 [PATCH 0/3] RDMA/rxe: Do some cleanup for macros Xiao Yang
2021-09-14  8:02 ` [PATCH 1/3] RDMA/rxe: Add new RXE_READ_OR_WRITE_MASK Xiao Yang
2021-09-14  8:02 ` [PATCH 2/3] RDMA/rxe: Add MASK suffix for RXE_READ_OR_ATOMIC and RXE_WRITE_OR_SEND Xiao Yang
2021-09-14  8:02 ` [PATCH 3/3] RDMA/rxe: Remove unused WR_READ_WRITE_OR_SEND_MASK Xiao Yang
2021-09-28 14:49 ` [PATCH 0/3] RDMA/rxe: Do some cleanup for macros Jason Gunthorpe

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).