Re: [PATCH rdma-core 5/5] rdma-core/irdma: Implement device supported verb APIs

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

 



On Wed, Jan 27, 2021 at 09:57:04PM -0600, Tatyana Nikolova wrote:
> +
> +	attr_ex->cqe = info.cq_size;
> +	if (ext_cq) {
> +		struct irdma_ucreate_cq_ex cmd = {};
> +		struct irdma_ucreate_cq_ex_resp resp = {};
> +
> +		cmd.user_cq_buf = (__u64)((uintptr_t)info.cq_base);
> +		cmd.user_shadow_area = (__u64)((uintptr_t)info.shadow_area);
> +
> +		ret = ibv_cmd_create_cq_ex(context, attr_ex, &iwucq->verbs_cq,
> +					   &cmd.ibv_cmd, sizeof(cmd), &resp.ibv_resp,
> +					   sizeof(resp));
> +		if (!ret) {
> +			irdma_ibvcq_ex_fill_priv_funcs(iwucq, attr_ex);
> +			info.cq_id = resp.cq_id;
> +			/* Do not report the cqe's burned by HW */
> +			iwucq->verbs_cq.cq.cqe = ncqe;
> +		}
> +	} else {
> +		struct irdma_ucreate_cq cmd = {};
> +		struct irdma_ucreate_cq_resp resp = {};
> +
> +		cmd.user_cq_buf = (__u64)((uintptr_t)info.cq_base);
> +		cmd.user_shadow_area = (__u64)((uintptr_t)info.shadow_area);
> +
> +		ret = ibv_cmd_create_cq(context, attr_ex->cqe, attr_ex->channel,
> +					attr_ex->comp_vector, &iwucq->verbs_cq.cq,
> +					&cmd.ibv_cmd, sizeof(cmd), &resp.ibv_resp,
> +					sizeof(resp));
> +		if (!ret) {
> +			info.cq_id = resp.cq_id;
> +			/* Do not report the cqe's burned by HW */
> +			iwucq->verbs_cq.cq.cqe = ncqe;
> +		}
> +	}

Just always call ibv_cmd_create_cq_ex(), it internally does the right
thing for all cases.

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