Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck...
[linux-drm-fsl-dcu.git] / drivers / infiniband / hw / ocrdma / ocrdma.h
index d540180a8e420865a71387a630a509b203959747..294dd27b601e0434e251b46732c66f69cfb9d242 100644 (file)
@@ -56,10 +56,12 @@ struct ocrdma_dev_attr {
        u16 max_qp;
        u16 max_wqe;
        u16 max_rqe;
+       u16 max_srq;
        u32 max_inline_data;
        int max_send_sge;
        int max_recv_sge;
        int max_srq_sge;
+       int max_rdma_sge;
        int max_mr;
        u64 max_mr_size;
        u32 max_num_mr_pbl;
@@ -120,6 +122,32 @@ struct mqe_ctx {
        bool cmd_done;
 };
 
+struct ocrdma_hw_mr {
+       u32 lkey;
+       u8 fr_mr;
+       u8 remote_atomic;
+       u8 remote_rd;
+       u8 remote_wr;
+       u8 local_rd;
+       u8 local_wr;
+       u8 mw_bind;
+       u8 rsvd;
+       u64 len;
+       struct ocrdma_pbl *pbl_table;
+       u32 num_pbls;
+       u32 num_pbes;
+       u32 pbl_size;
+       u32 pbe_size;
+       u64 fbo;
+       u64 va;
+};
+
+struct ocrdma_mr {
+       struct ib_mr ibmr;
+       struct ib_umem *umem;
+       struct ocrdma_hw_mr hwmr;
+};
+
 struct ocrdma_dev {
        struct ib_device ibdev;
        struct ocrdma_dev_attr attr;
@@ -130,8 +158,7 @@ struct ocrdma_dev {
        struct ocrdma_cq **cq_tbl;
        struct ocrdma_qp **qp_tbl;
 
-       struct ocrdma_eq meq;
-       struct ocrdma_eq *qp_eq_tbl;
+       struct ocrdma_eq *eq_tbl;
        int eq_cnt;
        u16 base_eqid;
        u16 max_eq;
@@ -168,11 +195,12 @@ struct ocrdma_dev {
        struct list_head entry;
        struct rcu_head rcu;
        int id;
+       struct ocrdma_mr *stag_arr[OCRDMA_MAX_STAG];
+       u16 pvid;
 };
 
 struct ocrdma_cq {
        struct ib_cq ibcq;
-       struct ocrdma_dev *dev;
        struct ocrdma_cqe *va;
        u32 phase;
        u32 getp;       /* pointer to pending wrs to
@@ -214,7 +242,6 @@ struct ocrdma_pd {
 
 struct ocrdma_ah {
        struct ib_ah ibah;
-       struct ocrdma_dev *dev;
        struct ocrdma_av *av;
        u16 sgid_index;
        u32 id;
@@ -234,7 +261,6 @@ struct ocrdma_qp_hwq_info {
 
 struct ocrdma_srq {
        struct ib_srq ibsrq;
-       struct ocrdma_dev *dev;
        u8 __iomem *db;
        struct ocrdma_qp_hwq_info rq;
        u64 *rqe_wr_id_tbl;
@@ -290,42 +316,19 @@ struct ocrdma_qp {
        u32 qkey;
        bool dpp_enabled;
        u8 *ird_q_va;
+       bool signaled;
+       u16 db_cache;
 };
 
-struct ocrdma_hw_mr {
-       struct ocrdma_dev *dev;
-       u32 lkey;
-       u8 fr_mr;
-       u8 remote_atomic;
-       u8 remote_rd;
-       u8 remote_wr;
-       u8 local_rd;
-       u8 local_wr;
-       u8 mw_bind;
-       u8 rsvd;
-       u64 len;
-       struct ocrdma_pbl *pbl_table;
-       u32 num_pbls;
-       u32 num_pbes;
-       u32 pbl_size;
-       u32 pbe_size;
-       u64 fbo;
-       u64 va;
-};
-
-struct ocrdma_mr {
-       struct ib_mr ibmr;
-       struct ib_umem *umem;
-       struct ocrdma_hw_mr hwmr;
-       struct ocrdma_pd *pd;
-};
 
 struct ocrdma_ucontext {
        struct ib_ucontext ibucontext;
-       struct ocrdma_dev *dev;
 
        struct list_head mm_head;
        struct mutex mm_list_lock; /* protects list entries of mm type */
+       struct ocrdma_pd *cntxt_pd;
+       int pd_in_use;
+
        struct {
                u32 *va;
                dma_addr_t pa;
@@ -386,14 +389,14 @@ static inline struct ocrdma_srq *get_ocrdma_srq(struct ib_srq *ibsrq)
 static inline int ocrdma_get_num_posted_shift(struct ocrdma_qp *qp)
 {
        return ((qp->dev->nic_info.dev_family == OCRDMA_GEN2_FAMILY &&
-                qp->id < 64) ? 24 : 16);
+                qp->id < 128) ? 24 : 16);
 }
 
 static inline int is_cqe_valid(struct ocrdma_cq *cq, struct ocrdma_cqe *cqe)
 {
        int cqe_valid;
        cqe_valid = le32_to_cpu(cqe->flags_status_srcqpn) & OCRDMA_CQE_VALID;
-       return ((cqe_valid == cq->phase) ? 1 : 0);
+       return (cqe_valid == cq->phase);
 }
 
 static inline int is_cqe_for_sq(struct ocrdma_cqe *cqe)