diff options
author | Roland Dreier <rolandd@cisco.com> | 2005-09-26 21:07:33 +0000 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-11-09 19:57:02 -0800 |
commit | fbd5180f132fabae7a7e9f694b52a178baf1db0a (patch) | |
tree | cf3d14f516889abb3be3d18702cffe7bce0a3f08 | |
parent | 3151f688c7d8193b3647282e08fbaf222f3aa57c (diff) | |
download | libmthca-fbd5180f132fabae7a7e9f694b52a178baf1db0a.tar.gz |
Update libmthca to handle uverbs ABI version 3
Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | configure.in | 4 | ||||
-rw-r--r-- | debian/changelog | 2 | ||||
-rw-r--r-- | debian/control | 2 | ||||
-rw-r--r-- | debian/copyright | 4 | ||||
-rw-r--r-- | src/cq.c | 6 | ||||
-rw-r--r-- | src/mthca.c | 9 | ||||
-rw-r--r-- | src/mthca.h | 8 | ||||
-rw-r--r-- | src/verbs.c | 20 |
9 files changed, 27 insertions, 33 deletions
@@ -1,3 +1,8 @@ +2005-09-25 Roland Dreier <roland@cisco.com> + + * src/cq.c, src/mthca.c, src/mthca.h, src/verbs.c: Update to match + new libibverbs API introduced with completion channel implementation. + 2005-09-13 Roland Dreier <roland@cisco.com> * src/qp.c (mthca_tavor_post_send, mthca_tavor_post_recv, diff --git a/configure.in b/configure.in index ce67f84..ff824c9 100644 --- a/configure.in +++ b/configure.in @@ -1,11 +1,11 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) -AC_INIT(libmthca, 1.0-rc2, openib-general@openib.org) +AC_INIT(libmthca, 1.0-rc3, openib-general@openib.org) AC_CONFIG_SRCDIR([src/mthca.h]) AC_CONFIG_AUX_DIR(config) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(libmthca, 1.0-rc2) +AM_INIT_AUTOMAKE(libmthca, 1.0-rc3) AM_PROG_LIBTOOL dnl Checks for programs diff --git a/debian/changelog b/debian/changelog index 387c797..66b18ba 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -libmthca (1.0-rc2-1) unstable; urgency=low +libmthca (1.0-rc3) unstable; urgency=low * Initial Release. (Closes: #325753) diff --git a/debian/control b/debian/control index a1e01dc..07d36ab 100644 --- a/debian/control +++ b/debian/control @@ -26,7 +26,7 @@ Description: Development files for the libmthca driver This package contains static versions of libmthca that may be linked directly to an application, which may be useful for debugging. -Package: libmthca-dbg +Package: libmthca1-dbg Section: libdevel Priority: extra Architecture: any diff --git a/debian/copyright b/debian/copyright index 367c98e..440b3ab 100644 --- a/debian/copyright +++ b/debian/copyright @@ -3,8 +3,8 @@ This package was debianized by Roland Dreier <rolandd@cisco.com> on Thu, 28 Apr 2005 13:16:56 -0700. Source: -It was downloaded from the OpenIB subversion repository at -<https://openib.org/svn/gen2/trunk/src/userspace/libmthca> +It was downloaded from the OpenIB web site at +<https://openib.org/downloads.html> Authors: The complete list of upstream authors is in the file @@ -249,8 +249,12 @@ static int handle_error_cqe(struct mthca_cq *cq, * If we're at the end of the WQE chain, or we've used up our * doorbell count, free the CQE. Otherwise just update it for * the next poll operation. + * + * This doesn't apply to mem-free HCAs, which never use the + * doorbell count field. In that case we always free the CQE. */ - if (!(new_wqe & htonl(0x3f)) || (!cqe->db_cnt && dbd)) + if (mthca_is_memfree(cq->ibv_cq.context) || + !(new_wqe & htonl(0x3f)) || (!cqe->db_cnt && dbd)) return 0; cqe->db_cnt = htons(ntohs(cqe->db_cnt) - dbd); diff --git a/src/mthca.c b/src/mthca.c index 7d04f66..c863873 100644 --- a/src/mthca.c +++ b/src/mthca.c @@ -99,8 +99,6 @@ struct { static struct ibv_context_ops mthca_ctx_ops = { .query_device = mthca_query_device, .query_port = mthca_query_port, - .query_gid = mthca_query_gid, - .query_pkey = mthca_query_pkey, .alloc_pd = mthca_alloc_pd, .dealloc_pd = mthca_free_pd, .reg_mr = mthca_reg_mr, @@ -119,21 +117,20 @@ static struct ibv_context_ops mthca_ctx_ops = { .detach_mcast = mthca_detach_mcast }; -static struct ibv_context *mthca_alloc_context(struct ibv_device *ibdev, - int num_comp, int cmd_fd) +static struct ibv_context *mthca_alloc_context(struct ibv_device *ibdev, int cmd_fd) { struct mthca_context *context; struct ibv_get_context cmd; struct mthca_alloc_ucontext_resp resp; int i; - context = malloc(sizeof *context + num_comp * sizeof (int)); + context = malloc(sizeof *context); if (!context) return NULL; context->ibv_ctx.cmd_fd = cmd_fd; - if (ibv_cmd_get_context(num_comp, &context->ibv_ctx, &cmd, sizeof cmd, + if (ibv_cmd_get_context(&context->ibv_ctx, &cmd, sizeof cmd, &resp.ibv_resp, sizeof resp)) goto err_free; diff --git a/src/mthca.h b/src/mthca.h index 1d85d36..f692702 100644 --- a/src/mthca.h +++ b/src/mthca.h @@ -274,10 +274,6 @@ extern int mthca_query_device(struct ibv_context *context, struct ibv_device_attr *attr); extern int mthca_query_port(struct ibv_context *context, uint8_t port, struct ibv_port_attr *attr); -extern int mthca_query_gid(struct ibv_context *context, uint8_t port_num, - int index, union ibv_gid *gid); -extern int mthca_query_pkey(struct ibv_context *context, uint8_t port_num, - int index, uint16_t *pkey); extern struct ibv_pd *mthca_alloc_pd(struct ibv_context *context); extern int mthca_free_pd(struct ibv_pd *pd); @@ -286,7 +282,9 @@ extern struct ibv_mr *mthca_reg_mr(struct ibv_pd *pd, void *addr, size_t length, enum ibv_access_flags access); extern int mthca_dereg_mr(struct ibv_mr *mr); -extern struct ibv_cq *mthca_create_cq(struct ibv_context *context, int cqe); +struct ibv_cq *mthca_create_cq(struct ibv_context *context, int cqe, + struct ibv_comp_channel *channel, + int comp_vector); extern int mthca_destroy_cq(struct ibv_cq *cq); extern int mthca_poll_cq(struct ibv_cq *cq, int ne, struct ibv_wc *wc); extern int mthca_tavor_arm_cq(struct ibv_cq *cq, int solicited); diff --git a/src/verbs.c b/src/verbs.c index 3fe7e80..80239ce 100644 --- a/src/verbs.c +++ b/src/verbs.c @@ -60,18 +60,6 @@ int mthca_query_port(struct ibv_context *context, uint8_t port, return ibv_cmd_query_port(context, port, attr, &cmd, sizeof cmd); } -int mthca_query_gid(struct ibv_context *context, uint8_t port_num, - int index, union ibv_gid *gid) -{ - return ibv_cmd_query_gid(context, port_num, index, gid); -} - -int mthca_query_pkey(struct ibv_context *context, uint8_t port_num, - int index, uint16_t *pkey) -{ - return ibv_cmd_query_pkey(context, port_num, index, pkey); -} - struct ibv_pd *mthca_alloc_pd(struct ibv_context *context) { struct ibv_alloc_pd cmd; @@ -151,7 +139,9 @@ int mthca_dereg_mr(struct ibv_mr *mr) return 0; } -struct ibv_cq *mthca_create_cq(struct ibv_context *context, int cqe) +struct ibv_cq *mthca_create_cq(struct ibv_context *context, int cqe, + struct ibv_comp_channel *channel, + int comp_vector) { struct mthca_create_cq cmd; struct mthca_create_cq_resp resp; @@ -205,8 +195,8 @@ struct ibv_cq *mthca_create_cq(struct ibv_context *context, int cqe) cmd.lkey = cq->mr->lkey; cmd.pdn = to_mpd(to_mctx(context)->pd)->pdn; - ret = ibv_cmd_create_cq(context, nent - 1, &cq->ibv_cq, - &cmd.ibv_cmd, sizeof cmd, + ret = ibv_cmd_create_cq(context, nent - 1, channel, comp_vector, + &cq->ibv_cq, &cmd.ibv_cmd, sizeof cmd, &resp.ibv_resp, sizeof resp); if (ret) goto err_arm_db; |