From 5470af5b3a111f0b70d52cc451de383bd7046dff Mon Sep 17 00:00:00 2001 From: Ram Amrani Date: Tue, 25 Oct 2016 14:29:41 +0300 Subject: [PATCH 1/3] libqedr: set the HCA table to static const type Signed-off-by: Ram Amrani --- providers/qedr/qelr_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/qedr/qelr_main.c b/providers/qedr/qelr_main.c index 386d7e689..0378d2c37 100644 --- a/providers/qedr/qelr_main.c +++ b/providers/qedr/qelr_main.c @@ -71,7 +71,7 @@ uint32_t qelr_dp_module; { .vendor = PCI_VENDOR_ID_QLOGIC, \ .device = PCI_DEVICE_ID_QLOGIC_##d } -struct { +static const struct { unsigned int vendor; unsigned int device; } hca_table[] = { From 0ab306d8a48900e437eda7192bb26da4b752377a Mon Sep 17 00:00:00 2001 From: Ram Amrani Date: Tue, 25 Oct 2016 14:49:01 +0300 Subject: [PATCH 2/3] libqedr: consistent verb declarations Signed-off-by: Ram Amrani --- providers/qedr/qelr_verbs.h | 58 +++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 32 deletions(-) diff --git a/providers/qedr/qelr_verbs.h b/providers/qedr/qelr_verbs.h index f10b76bbe..b73ae9e0a 100644 --- a/providers/qedr/qelr_verbs.h +++ b/providers/qedr/qelr_verbs.h @@ -40,44 +40,38 @@ #include #include -struct ibv_device *qelr_driver_init(const char *, int); +int qelr_query_device(struct ibv_context *context, + struct ibv_device_attr *attr); +int qelr_query_port(struct ibv_context *context, uint8_t port, + struct ibv_port_attr *attr); -int qelr_query_device(struct ibv_context *, struct ibv_device_attr *); -int qelr_query_port(struct ibv_context *, uint8_t, struct ibv_port_attr *); +struct ibv_pd *qelr_alloc_pd(struct ibv_context *context); +int qelr_dealloc_pd(struct ibv_pd *ibpd); -struct ibv_pd *qelr_alloc_pd(struct ibv_context *); -int qelr_dealloc_pd(struct ibv_pd *); +struct ibv_mr *qelr_reg_mr(struct ibv_pd *ibpd, void *addr, + size_t len, int access); +int qelr_dereg_mr(struct ibv_mr *mr); -struct ibv_mr *qelr_reg_mr(struct ibv_pd *, void *, size_t, - int ibv_access_flags); -int qelr_dereg_mr(struct ibv_mr *); - -struct ibv_cq *qelr_create_cq(struct ibv_context *, int, - struct ibv_comp_channel *, int); +struct ibv_cq *qelr_create_cq(struct ibv_context *context, int cqe, + struct ibv_comp_channel *channel, + int comp_vector); +int qelr_arm_cq(struct ibv_cq *ibcq, int solicited); +int qelr_poll_cq(struct ibv_cq *ibcq, int num_entries, struct ibv_wc *wc); +void qelr_cq_event(struct ibv_cq *ibcq); int qelr_destroy_cq(struct ibv_cq *); -int qelr_poll_cq(struct ibv_cq *, int, struct ibv_wc *); -void qelr_cq_event(struct ibv_cq *); -int qelr_arm_cq(struct ibv_cq *, int); - -int qelr_query_srq(struct ibv_srq *ibv_srq, struct ibv_srq_attr *attr); -int qelr_modify_srq(struct ibv_srq *ibv_srq, struct ibv_srq_attr *attr, - int attr_mask); -struct ibv_srq *qelr_create_srq(struct ibv_pd *, struct ibv_srq_init_attr *); -int qelr_destroy_srq(struct ibv_srq *ibv_srq); -int qelr_post_srq_recv(struct ibv_srq *, struct ibv_recv_wr *, - struct ibv_recv_wr **bad_wr); -struct ibv_qp *qelr_create_qp(struct ibv_pd *, struct ibv_qp_init_attr *); -int qelr_modify_qp(struct ibv_qp *, struct ibv_qp_attr *, - int ibv_qp_attr_mask); -int qelr_query_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr, int attr_mask, - struct ibv_qp_init_attr *init_attr); -int qelr_destroy_qp(struct ibv_qp *); +struct ibv_qp *qelr_create_qp(struct ibv_pd *pd, + struct ibv_qp_init_attr *attrs); +int qelr_modify_qp(struct ibv_qp *ibqp, struct ibv_qp_attr *attr, + int attr_mask); +int qelr_query_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr, + int attr_mask, struct ibv_qp_init_attr *init_attr); +int qelr_destroy_qp(struct ibv_qp *ibqp); -int qelr_post_send(struct ibv_qp *, struct ibv_send_wr *, - struct ibv_send_wr **); -int qelr_post_recv(struct ibv_qp *, struct ibv_recv_wr *, - struct ibv_recv_wr **); +int qelr_post_send(struct ibv_qp *ib_qp, struct ibv_send_wr *wr, + struct ibv_send_wr **bad_wr); +int qelr_post_recv(struct ibv_qp *ibqp, struct ibv_recv_wr *wr, + struct ibv_recv_wr **bad_wr); void qelr_async_event(struct ibv_async_event *event); #endif /* __QELR_VERBS_H__ */ From f93c68d41d65c3864e753be4acf9be9c8f34b291 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 25 Oct 2016 15:28:22 +0300 Subject: [PATCH 3/3] libqedr: use PRIx64 for 32-bit compatible debug print Signed-off-by: Ram Amrani --- providers/qedr/qelr_verbs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/providers/qedr/qelr_verbs.c b/providers/qedr/qelr_verbs.c index 012303d92..d2b34eef2 100644 --- a/providers/qedr/qelr_verbs.c +++ b/providers/qedr/qelr_verbs.c @@ -562,9 +562,9 @@ struct ibv_qp *qelr_create_qp(struct ibv_pd *pd, static void qelr_print_ah_attr(struct qelr_devctx *cxt, struct ibv_ah_attr *attr) { DP_VERBOSE(cxt->dbg_fp, QELR_MSG_QP, - "grh.dgid=[%lx:%lx], grh.flow_label=%d, grh.sgid_index=%d, grh.hop_limit=%d, grh.traffic_class=%d, dlid=%d, sl=%d, src_path_bits=%d, static_rate = %d, port_num=%d\n", - (unsigned long)attr->grh.dgid.global.interface_id, - (unsigned long)attr->grh.dgid.global.subnet_prefix, + "grh.dgid=[%#" PRIx64 ":%#" PRIx64 "], grh.flow_label=%d, grh.sgid_index=%d, grh.hop_limit=%d, grh.traffic_class=%d, dlid=%d, sl=%d, src_path_bits=%d, static_rate = %d, port_num=%d\n", + attr->grh.dgid.global.interface_id, + attr->grh.dgid.global.subnet_prefix, attr->grh.flow_label, attr->grh.hop_limit, attr->grh.sgid_index, attr->grh.traffic_class, attr->dlid, attr->sl, attr->src_path_bits,