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