Re: [PATCH v2 rdma-core 3/3] libhns: Add bind mw support for hip08

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux