On Thu, Apr 16, 2020 at 10:09:32AM -0700, Jianxin Xiong wrote: > diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c > index f6c2552..b3f7261 100644 > --- a/drivers/infiniband/core/device.c > +++ b/drivers/infiniband/core/device.c > @@ -2654,9 +2654,11 @@ void ib_set_device_ops(struct ib_device *dev, const struct ib_device_ops *ops) > SET_DEVICE_OP(dev_ops, read_counters); > SET_DEVICE_OP(dev_ops, reg_dm_mr); > SET_DEVICE_OP(dev_ops, reg_user_mr); > + SET_DEVICE_OP(dev_ops, reg_user_mr_fd); > SET_DEVICE_OP(dev_ops, req_ncomp_notif); > SET_DEVICE_OP(dev_ops, req_notify_cq); > SET_DEVICE_OP(dev_ops, rereg_user_mr); > + SET_DEVICE_OP(dev_ops, rereg_user_mr_fd); I'm not so found of adding such a specific callback.. It seems better to have a generic reg_user_mr that accepts a ib_umem created by the core code. Burying the umem_get in the drivers was probably a mistake. > static int ib_uverbs_dereg_mr(struct uverbs_attr_bundle *attrs) > { > struct ib_uverbs_dereg_mr cmd; > @@ -3916,7 +4081,19 @@ static int ib_uverbs_ex_modify_cq(struct uverbs_attr_bundle *attrs) > ib_uverbs_rereg_mr, > UAPI_DEF_WRITE_UDATA_IO(struct ib_uverbs_rereg_mr, > struct ib_uverbs_rereg_mr_resp), > - UAPI_DEF_METHOD_NEEDS_FN(rereg_user_mr))), > + UAPI_DEF_METHOD_NEEDS_FN(rereg_user_mr)), > + DECLARE_UVERBS_WRITE( > + IB_USER_VERBS_CMD_REG_MR_FD, > + ib_uverbs_reg_mr_fd, > + UAPI_DEF_WRITE_UDATA_IO(struct ib_uverbs_reg_mr_fd, > + struct ib_uverbs_reg_mr_resp), > + UAPI_DEF_METHOD_NEEDS_FN(reg_user_mr_fd)), > + DECLARE_UVERBS_WRITE( > + IB_USER_VERBS_CMD_REREG_MR_FD, > + ib_uverbs_rereg_mr_fd, > + UAPI_DEF_WRITE_UDATA_IO(struct ib_uverbs_rereg_mr_fd, > + struct ib_uverbs_rereg_mr_resp), > + UAPI_DEF_METHOD_NEEDS_FN(rereg_user_mr_fd))), New write based methods are not allowed, they have to be done as ioctl methods. Jason