Commit 2a129958 authored by Bob Pearson's avatar Bob Pearson Committed by Jason Gunthorpe

RDMA//rxe: Optimize send path in rxe_resp.c

Bypass calling check_rkey() in rxe_resp.c for non-rdma messages.

Link: https://lore.kernel.org/r/20230530221334.89432-3-rpearsonhpe@gmail.comSigned-off-by: default avatarBob Pearson <rpearsonhpe@gmail.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
parent d11442c6
...@@ -91,6 +91,9 @@ enum rxe_hdr_mask { ...@@ -91,6 +91,9 @@ enum rxe_hdr_mask {
RXE_READ_OR_ATOMIC_MASK = (RXE_READ_MASK | RXE_ATOMIC_MASK), RXE_READ_OR_ATOMIC_MASK = (RXE_READ_MASK | RXE_ATOMIC_MASK),
RXE_WRITE_OR_SEND_MASK = (RXE_WRITE_MASK | RXE_SEND_MASK), RXE_WRITE_OR_SEND_MASK = (RXE_WRITE_MASK | RXE_SEND_MASK),
RXE_READ_OR_WRITE_MASK = (RXE_READ_MASK | RXE_WRITE_MASK), RXE_READ_OR_WRITE_MASK = (RXE_READ_MASK | RXE_WRITE_MASK),
RXE_RDMA_OP_MASK = (RXE_READ_MASK | RXE_WRITE_MASK |
RXE_ATOMIC_WRITE_MASK | RXE_FLUSH_MASK |
RXE_ATOMIC_MASK),
}; };
#define OPCODE_NONE (-1) #define OPCODE_NONE (-1)
......
...@@ -387,7 +387,10 @@ static enum resp_states rxe_resp_check_length(struct rxe_qp *qp, ...@@ -387,7 +387,10 @@ static enum resp_states rxe_resp_check_length(struct rxe_qp *qp,
} }
} }
if (pkt->mask & RXE_RDMA_OP_MASK)
return RESPST_CHK_RKEY; return RESPST_CHK_RKEY;
else
return RESPST_EXECUTE;
} }
/* if the reth length field is zero we can assume nothing /* if the reth length field is zero we can assume nothing
...@@ -434,6 +437,10 @@ static enum resp_states check_rkey(struct rxe_qp *qp, ...@@ -434,6 +437,10 @@ static enum resp_states check_rkey(struct rxe_qp *qp,
enum resp_states state; enum resp_states state;
int access = 0; int access = 0;
/* parse RETH or ATMETH header for first/only packets
* for va, length, rkey, etc. or use current value for
* middle/last packets.
*/
if (pkt->mask & (RXE_READ_OR_WRITE_MASK | RXE_ATOMIC_WRITE_MASK)) { if (pkt->mask & (RXE_READ_OR_WRITE_MASK | RXE_ATOMIC_WRITE_MASK)) {
if (pkt->mask & RXE_RETH_MASK) if (pkt->mask & RXE_RETH_MASK)
qp_resp_from_reth(qp, pkt); qp_resp_from_reth(qp, pkt);
...@@ -454,7 +461,8 @@ static enum resp_states check_rkey(struct rxe_qp *qp, ...@@ -454,7 +461,8 @@ static enum resp_states check_rkey(struct rxe_qp *qp,
qp_resp_from_atmeth(qp, pkt); qp_resp_from_atmeth(qp, pkt);
access = IB_ACCESS_REMOTE_ATOMIC; access = IB_ACCESS_REMOTE_ATOMIC;
} else { } else {
return RESPST_EXECUTE; /* shouldn't happen */
WARN_ON(1);
} }
/* A zero-byte read or write op is not required to /* A zero-byte read or write op is not required to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment