On 2022/3/29 10:36, yangx.jy@xxxxxxxxxxx wrote: > On 2022/3/28 19:39, Jason Gunthorpe wrote: >> On Mon, Mar 28, 2022 at 10:07:26AM +0000, yangx.jy@xxxxxxxxxxx wrote: >>> 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: >> Isn't there a cap flag too? > Hi Jason, > > I will disable the atomic write cap flag as well, like this: > > ----------------------------------- > > diff --git a/drivers/infiniband/sw/rxe/rxe_param.h > b/drivers/infiniband/sw/rxe/rxe_param.h > index 918270e34a35..88953f9c26e4 100644 > --- a/drivers/infiniband/sw/rxe/rxe_param.h > +++ b/drivers/infiniband/sw/rxe/rxe_param.h > @@ -53,7 +53,12 @@ enum rxe_device_param { > | IB_DEVICE_ALLOW_USER_UNREG > | IB_DEVICE_MEM_WINDOW > | IB_DEVICE_MEM_WINDOW_TYPE_2A > +#ifdef CONFIG_64BIT > + | IB_DEVICE_MEM_WINDOW_TYPE_2B > + | IB_DEVICE_ATOMIC_WRITE, > +#else > | IB_DEVICE_MEM_WINDOW_TYPE_2B, > +#endif /* CONFIG_64BIT */ > RXE_MAX_SGE = 32, > RXE_MAX_WQE_SIZE = sizeof(struct rxe_send_wqe) + > sizeof(struct ib_sge) * > RXE_MAX_SGE, > > ----------------------------------- > > BTW: > > I hope we can review and merge my cleanup patchset[1][2] first. So that > I will update the third patch[3] based on it. ^_^ > > [1]: [PATCH v2 1/2] IB/uverbs: Move enum ib_raw_packet_caps to uapi > > [2]: [PATCH v2 2/2] IB/uverbs: Move part of enum ib_device_cap_flags to uapi Sorry, the correct version is my v3 cleanup patchset [1]: [PATCH v3 1/2] IB/uverbs: Move enum ib_raw_packet_caps to uapi [2]: [PATCH v3 2/2] IB/uverbs: Move part of enum ib_device_cap_flags to uapi > > [3]: [PATCH v3 3/3] RDMA/rxe: Add RDMA Atomic Write attribute for rxe device > > Best Regards, > > Xiao Yang > >> Jason