On 2018/10/11 4:36, Jason Gunthorpe wrote: > On Mon, Oct 08, 2018 at 06:57:43PM +0800, Yixian Liu wrote: >> +int hns_roce_u_bind_mw(struct ibv_qp *qp, struct ibv_mw *mw, >> + struct ibv_mw_bind *mw_bind) >> +{ >> + struct ibv_mw_bind_info *bind_info = &mw_bind->bind_info; >> + struct ibv_send_wr *bad_wr = NULL; >> + struct ibv_send_wr wr = {}; >> + int ret; >> + >> + if ((mw->pd != qp->pd) || (mw->pd != bind_info->mr->pd)) >> + return EINVAL; >> + >> + if (mw->type == IBV_MW_TYPE_2) >> + return EINVAL; > > This should be written as mw->type != IBV_MW_TYPE1 > > Same reason as why access flags should be a list of supported, not a > list of unsupported > > Jason It's a good suggestion! It will be much clear to code readers to know what the code will do. Will fix it next version. Thanks Eason