Extend rxe_hdr.h to support XRC ETH. Signed-off-by: Bob Pearson <rpearsonhpe@xxxxxxxxx> --- drivers/infiniband/sw/rxe/rxe_hdr.h | 36 +++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/drivers/infiniband/sw/rxe/rxe_hdr.h b/drivers/infiniband/sw/rxe/rxe_hdr.h index d9d15c672f86..499807b11405 100644 --- a/drivers/infiniband/sw/rxe/rxe_hdr.h +++ b/drivers/infiniband/sw/rxe/rxe_hdr.h @@ -907,11 +907,47 @@ static inline void ieth_set_rkey(struct rxe_pkt_info *pkt, u32 rkey) rxe_opcode[pkt->opcode].offset[RXE_IETH], rkey); } +/****************************************************************************** + * XRC Extended Transport Header + ******************************************************************************/ +struct rxe_xrceth { + __be32 rxrcsrq; +}; + +#define XRCETH_XRCSRQ_MASK (0x00ffffff) + +static inline u32 __xrceth_xrcsrq(void *arg) +{ + struct rxe_xrceth *xrceth = arg; + + return XRCETH_XRCSRQ_MASK & be32_to_cpu(xrceth->rxrcsrq); +} + +static inline void __xrceth_set_xrcsrq(void *arg, u32 xrcsrq) +{ + struct rxe_xrceth *xrceth = arg; + + xrceth->rxrcsrq = cpu_to_be32(XRCETH_XRCSRQ_MASK & xrcsrq); +} + +static inline u32 xrceth_xrcsrq(struct rxe_pkt_info *pkt) +{ + return __xrceth_xrcsrq(pkt->hdr + + rxe_opcode[pkt->opcode].offset[RXE_XRCETH]); +} + +static inline void xrceth_set_xrcsrq(struct rxe_pkt_info *pkt, u32 xrcsrq) +{ + __xrceth_set_xrcsrq(pkt->hdr + + rxe_opcode[pkt->opcode].offset[RXE_XRCETH], xrcsrq); +} + enum rxe_hdr_length { RXE_BTH_BYTES = sizeof(struct rxe_bth), RXE_DETH_BYTES = sizeof(struct rxe_deth), RXE_IMMDT_BYTES = sizeof(struct rxe_immdt), RXE_RETH_BYTES = sizeof(struct rxe_reth), + RXE_XRCETH_BYTES = sizeof(struct rxe_xrceth), RXE_AETH_BYTES = sizeof(struct rxe_aeth), RXE_ATMACK_BYTES = sizeof(struct rxe_atmack), RXE_ATMETH_BYTES = sizeof(struct rxe_atmeth), -- 2.30.2