Re: [PATCH rebase to for-next 1/2] rdma/cxgb4: Add t4_srq support functions & structs

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

 



On Thu, May 17, 2018 at 11:18:27AM +0530, Raju Rangoju wrote:
> This patch adds kernel mode t4_srq structures and support functions
> - Also adds srq resp structures and helper functions
> 
> Signed-off-by: Raju Rangoju <rajur@xxxxxxxxxxx>
> Reviewed-by: Steve Wise <swise@xxxxxxxxxxxxxxxxxxxxx>
>  drivers/infiniband/hw/cxgb4/iw_cxgb4.h    |  38 ++++++++++
>  drivers/infiniband/hw/cxgb4/t4.h          | 120 +++++++++++++++++++++++++++++-
>  drivers/infiniband/hw/cxgb4/t4fw_ri_api.h |  19 +++++
>  include/uapi/rdma/cxgb4-abi.h             |  17 +++++
>  4 files changed, 193 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h
> index 870649ff049c..06fd98ec12f9 100644
> +++ b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h
> @@ -97,6 +97,7 @@ struct c4iw_resource {
>  	struct c4iw_id_table tpt_table;
>  	struct c4iw_id_table qid_table;
>  	struct c4iw_id_table pdid_table;
> +	struct c4iw_id_table srq_table;
>  };
>  
>  struct c4iw_qid_list {
> @@ -130,6 +131,8 @@ struct c4iw_stats {
>  	struct c4iw_stat stag;
>  	struct c4iw_stat pbl;
>  	struct c4iw_stat rqt;
> +	struct c4iw_stat srqt;
> +	struct c4iw_stat srq;
>  	struct c4iw_stat ocqp;
>  	u64  db_full;
>  	u64  db_empty;
> @@ -549,6 +552,7 @@ struct c4iw_qp {
>  	struct kref kref;
>  	wait_queue_head_t wait;
>  	int sq_sig_all;
> +	struct c4iw_srq *srq;
>  	struct work_struct free_work;
>  	struct c4iw_ucontext *ucontext;
>  	struct c4iw_wr_wait *wr_waitp;
> @@ -559,6 +563,26 @@ static inline struct c4iw_qp *to_c4iw_qp(struct ib_qp *ibqp)
>  	return container_of(ibqp, struct c4iw_qp, ibqp);
>  }
>  
> +struct c4iw_srq {
> +	struct ib_srq ibsrq;
> +	struct list_head db_fc_entry;
> +	struct c4iw_dev *rhp;
> +	struct t4_srq wq;
> +	struct sk_buff *destroy_skb;
> +	u32 srq_limit;
> +	u32 pdid;
> +	int idx;
> +	__u32 flags;

__ versions of types are really only for the uapi headers, at least
don't mix both kinds in the same struct.

> +static inline void t4_ring_srq_db(struct t4_srq *srq, u16 inc, u8 len16,
> +				  union t4_recv_wr *wqe)
> +{
> +	/* Flush host queue memory writes. */
> +	wmb();

This isn't needed, writeq() and writel do the wbm implicity.


> +	if (inc == 1 && srq->bar2_qid == 0 && wqe) {
> +		pr_debug("%s : WC srq->pidx = %d; len16=%d\n",
> +			 __func__, srq->pidx, len16);
> +		pio_copy((u64 __iomem *)
> +			 (srq->bar2_va + SGE_UDB_WCDOORBELL),
> +			 (void *)wqe);

The 'u64 iomem' cast shouldn't be needed

Why cast wqe to void when pio_copy takes u64?

> diff --git a/include/uapi/rdma/cxgb4-abi.h b/include/uapi/rdma/cxgb4-abi.h
> index a159ba8dcf8f..c1e846d442c2 100644
> +++ b/include/uapi/rdma/cxgb4-abi.h
> @@ -74,6 +74,23 @@ struct c4iw_create_qp_resp {
>  	__u32 flags;
>  };
>  
> +struct c4iw_create_srq_resp {
> +	__u64 srq_key;
> +	__u64 srq_db_gts_key;
> +	__u64 srq_memsize;

All __u64 in uapi headers must be __aligned_u64

> +	__u32 srqid;
> +	__u32 srq_size;
> +	__u32 rqt_abs_idx;
> +	__u32 qid_mask;
> +	__u32 flags;
> +	__u32 reserved; /* explicit padding */
> +};
> +
> +enum {
> +	/* HW supports SRQ_LIMIT_REACHED event */
> +	T4_SRQ_LIMIT_SUPPORT = (1 << 0),
> +};
> +
>  struct c4iw_alloc_ucontext_resp {
>  	__aligned_u64 status_page_key;
>  	__u32 status_page_size;

We need to see a rdma-core pull request passing CI before accepting
new uapi into the kernel.

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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