On 2022/3/25 21:22, Jason Gunthorpe wrote: > It is not great, but there is not another choice I can see.. Hi Jason, I plan to only disable the key places by the following change so that user cannot use the atomic write: ----------------------------------------------------------------------------------------------------------- diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c index e2d332a5af0a..7f83b5e39ace 100644 --- a/drivers/infiniband/sw/rxe/rxe_req.c +++ b/drivers/infiniband/sw/rxe/rxe_req.c @@ -238,8 +238,10 @@ static int next_opcode_rc(struct rxe_qp *qp, u32 opcode, int fits) return fits ? IB_OPCODE_RC_SEND_ONLY_WITH_INVALIDATE : IB_OPCODE_RC_SEND_FIRST; +#ifdef CONFIG_64BIT case IB_WR_RDMA_ATOMIC_WRITE: return IB_OPCODE_RC_RDMA_ATOMIC_WRITE; +#endif /* CONFIG_64BIT */ case IB_WR_REG_MR: case IB_WR_LOCAL_INV: diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c index ddc791b199e2..311ec523fb57 100644 --- a/drivers/infiniband/sw/rxe/rxe_resp.c +++ b/drivers/infiniband/sw/rxe/rxe_resp.c @@ -592,6 +592,7 @@ static enum resp_states process_atomic(struct rxe_qp *qp, return ret; } +#ifdef CONFIG_64BIT static enum resp_states process_atomic_write(struct rxe_qp *qp, struct rxe_pkt_info *pkt) { @@ -613,6 +614,7 @@ static enum resp_states process_atomic_write(struct rxe_qp *qp, return RESPST_NONE; } +#endif /* CONFIG_64BIT */ static struct sk_buff *prepare_ack_packet(struct rxe_qp *qp, struct rxe_pkt_info *pkt, @@ -871,10 +873,12 @@ static enum resp_states execute(struct rxe_qp *qp, struct rxe_pkt_info *pkt) err = process_atomic(qp, pkt); if (err) return err; +#ifdef CONFIG_64BIT } else if (pkt->mask & RXE_ATOMIC_WRITE_MASK) { err = process_atomic_write(qp, pkt); if (err) return err; +#endif /* CONFIG_64BIT */ } else { /* Unreachable */ WARN_ON_ONCE(1); ----------------------------------------------------------------------------------------------------------- Best Regards, Xiao Yang > > Jason