Commit 3491c9e7 authored by Yuval Bason's avatar Yuval Bason Committed by Jason Gunthorpe

qedr: Add support for kernel mode SRQ's

Implement the SRQ specific verbs and update the poll_cq verb to deal with
SRQ completions.
Signed-off-by: default avatarMichal Kalderon <michal.kalderon@cavium.com>
Signed-off-by: default avatarYuval Bason <yuval.bason@cavium.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 1212767e
...@@ -229,6 +229,11 @@ static int qedr_register_device(struct qedr_dev *dev) ...@@ -229,6 +229,11 @@ static int qedr_register_device(struct qedr_dev *dev)
dev->ibdev.query_qp = qedr_query_qp; dev->ibdev.query_qp = qedr_query_qp;
dev->ibdev.destroy_qp = qedr_destroy_qp; dev->ibdev.destroy_qp = qedr_destroy_qp;
dev->ibdev.create_srq = qedr_create_srq;
dev->ibdev.destroy_srq = qedr_destroy_srq;
dev->ibdev.modify_srq = qedr_modify_srq;
dev->ibdev.query_srq = qedr_query_srq;
dev->ibdev.post_srq_recv = qedr_post_srq_recv;
dev->ibdev.query_pkey = qedr_query_pkey; dev->ibdev.query_pkey = qedr_query_pkey;
dev->ibdev.create_ah = qedr_create_ah; dev->ibdev.create_ah = qedr_create_ah;
......
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
#define QEDR_MSG_RQ " RQ" #define QEDR_MSG_RQ " RQ"
#define QEDR_MSG_SQ " SQ" #define QEDR_MSG_SQ " SQ"
#define QEDR_MSG_QP " QP" #define QEDR_MSG_QP " QP"
#define QEDR_MSG_SRQ " SRQ"
#define QEDR_MSG_GSI " GSI" #define QEDR_MSG_GSI " GSI"
#define QEDR_MSG_IWARP " IW" #define QEDR_MSG_IWARP " IW"
...@@ -171,6 +172,7 @@ struct qedr_dev { ...@@ -171,6 +172,7 @@ struct qedr_dev {
struct qedr_qp *gsi_qp; struct qedr_qp *gsi_qp;
enum qed_rdma_type rdma_type; enum qed_rdma_type rdma_type;
struct qedr_idr qpidr; struct qedr_idr qpidr;
struct qedr_idr srqidr;
struct workqueue_struct *iwarp_wq; struct workqueue_struct *iwarp_wq;
u16 iwarp_max_mtu; u16 iwarp_max_mtu;
...@@ -341,6 +343,34 @@ struct qedr_qp_hwq_info { ...@@ -341,6 +343,34 @@ struct qedr_qp_hwq_info {
qed_chain_get_capacity(p_info->pbl) \ qed_chain_get_capacity(p_info->pbl) \
} while (0) } while (0)
struct qedr_srq_hwq_info {
u32 max_sges;
u32 max_wr;
struct qed_chain pbl;
u64 p_phys_addr_tbl;
u32 wqe_prod;
u32 sge_prod;
u32 wr_prod_cnt;
u32 wr_cons_cnt;
u32 num_elems;
u32 *virt_prod_pair_addr;
dma_addr_t phy_prod_pair_addr;
};
struct qedr_srq {
struct ib_srq ibsrq;
struct qedr_dev *dev;
struct qedr_userq usrq;
struct qedr_srq_hwq_info hw_srq;
struct ib_umem *prod_umem;
u16 srq_id;
u32 srq_limit;
/* lock to protect srq recv post */
spinlock_t lock;
};
enum qedr_qp_err_bitmap { enum qedr_qp_err_bitmap {
QEDR_QP_ERR_SQ_FULL = 1, QEDR_QP_ERR_SQ_FULL = 1,
QEDR_QP_ERR_RQ_FULL = 2, QEDR_QP_ERR_RQ_FULL = 2,
...@@ -542,4 +572,9 @@ static inline struct qedr_mr *get_qedr_mr(struct ib_mr *ibmr) ...@@ -542,4 +572,9 @@ static inline struct qedr_mr *get_qedr_mr(struct ib_mr *ibmr)
{ {
return container_of(ibmr, struct qedr_mr, ibmr); return container_of(ibmr, struct qedr_mr, ibmr);
} }
static inline struct qedr_srq *get_qedr_srq(struct ib_srq *ibsrq)
{
return container_of(ibsrq, struct qedr_srq, ibsrq);
}
#endif #endif
...@@ -161,12 +161,23 @@ struct rdma_rq_sge { ...@@ -161,12 +161,23 @@ struct rdma_rq_sge {
#define RDMA_RQ_SGE_L_KEY_HI_SHIFT 29 #define RDMA_RQ_SGE_L_KEY_HI_SHIFT 29
}; };
struct rdma_srq_wqe_header {
struct regpair wr_id;
u8 num_sges /* number of SGEs in WQE */;
u8 reserved2[7];
};
struct rdma_srq_sge { struct rdma_srq_sge {
struct regpair addr; struct regpair addr;
__le32 length; __le32 length;
__le32 l_key; __le32 l_key;
}; };
union rdma_srq_elm {
struct rdma_srq_wqe_header header;
struct rdma_srq_sge sge;
};
/* Rdma doorbell data for flags update */ /* Rdma doorbell data for flags update */
struct rdma_pwm_flags_data { struct rdma_pwm_flags_data {
__le16 icid; /* internal CID */ __le16 icid; /* internal CID */
......
This diff is collapsed.
...@@ -66,6 +66,15 @@ int qedr_query_qp(struct ib_qp *, struct ib_qp_attr *qp_attr, ...@@ -66,6 +66,15 @@ int qedr_query_qp(struct ib_qp *, struct ib_qp_attr *qp_attr,
int qp_attr_mask, struct ib_qp_init_attr *); int qp_attr_mask, struct ib_qp_init_attr *);
int qedr_destroy_qp(struct ib_qp *ibqp); int qedr_destroy_qp(struct ib_qp *ibqp);
struct ib_srq *qedr_create_srq(struct ib_pd *ibpd,
struct ib_srq_init_attr *attr,
struct ib_udata *udata);
int qedr_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr,
enum ib_srq_attr_mask attr_mask, struct ib_udata *udata);
int qedr_query_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr);
int qedr_destroy_srq(struct ib_srq *ibsrq);
int qedr_post_srq_recv(struct ib_srq *ibsrq, const struct ib_recv_wr *wr,
const struct ib_recv_wr **bad_recv_wr);
struct ib_ah *qedr_create_ah(struct ib_pd *ibpd, struct rdma_ah_attr *attr, struct ib_ah *qedr_create_ah(struct ib_pd *ibpd, struct rdma_ah_attr *attr,
struct ib_udata *udata); struct ib_udata *udata);
int qedr_destroy_ah(struct ib_ah *ibah); int qedr_destroy_ah(struct ib_ah *ibah);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment