Re: [PATCH RFC rdma-core 2/5] libhns: Introduce DCA for RC QP

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

 



On Sun, Feb 07, 2021 at 11:12:51AM +0800, Weihang Li wrote:

> +static int register_dca_mem(struct hns_roce_context *ctx, uint64_t key,
> +			    void *addr, uint32_t size, uint32_t *handle)
> +{
> +	struct ib_uverbs_attr *attr;
> +	int ret;
> +
> +	DECLARE_COMMAND_BUFFER(cmd, HNS_IB_OBJECT_DCA_MEM,
> +			       HNS_IB_METHOD_DCA_MEM_REG, 4);
> +	fill_attr_in_uint32(cmd, HNS_IB_ATTR_DCA_MEM_REG_LEN, size);
> +	fill_attr_in_uint64(cmd, HNS_IB_ATTR_DCA_MEM_REG_ADDR, (intptr_t)addr);

This should use ioctl_ptr_to_u64(), the place this was copied from
should also be fixed


> +	fill_attr_in_uint64(cmd, HNS_IB_ATTR_DCA_MEM_REG_KEY, key);
> +	attr = fill_attr_out_obj(cmd, HNS_IB_ATTR_DCA_MEM_REG_HANDLE);
> +
> +	ret = execute_ioctl(&ctx->ibv_ctx.context, cmd);
> +	if (!ret)
> +		*handle = read_attr_obj(HNS_IB_ATTR_DCA_MEM_REG_HANDLE, attr);

Success oriented flow everywhere please

Jason



[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