Various libibverbs patches
Subsystems (2)
cover Various libibverbs patches
Hello Roland,
This patch series addresses a few issues I noticed after having built libibverbs from the source tree available at kernel.org. Feedback is welcome.
Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 1/7 Add "foreign" option to AM_INIT_AUTOMAKE
In reply to a message not in the archiveTell automake that the libibverbs package does not follow the GNU standards. This change makes it possible to use 'autoreconf' for the libibverbs package.
--- configure.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
configure.in +1 -1
@@ -6,7 +6,7 @@ AC_CONFIG_SRCDIR([src/ibverbs.h]) AC_CONFIG_AUX_DIR(config) AC_CONFIG_MACRO_DIR(config) AC_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(libibverbs, 1.1.5) +AM_INIT_AUTOMAKE([foreign]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) dnl Checks for programs
Signature · 6 lines
1.7.3.4 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 2/7 Makefile.am: Fix an automake warning
In reply to a message not in the archiveAvoid that automake reports the following warning message:
Makefile.am:1: INCLUDES' is the old name for AM_CPPFLAGS' (or `*_CPPFLAGS')
A quote from the automake manual:
INCLUDES
This does the same job as AM_CPPFLAGS (or any per-target _CPPFLAGS variable if it is used). It is an older name for the same functionality. This variable is deprecated; we suggest using AM_CPPFLAGS and per-target _CPPFLAGS instead.
--- Makefile.am | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Makefile.am +1 -1
@@ -1,4 +1,4 @@ -INCLUDES = -I$(srcdir)/include +AM_CPPFLAGS = -I$(srcdir)/include lib_LTLIBRARIES = src/libibverbs.la
Signature · 6 lines
1.7.3.4 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 3/7 autogen.sh: Introduce autoreconf
In reply to a message not in the archiveThere is no need to invoke the different autotools individually - autoreconf already does that.
--- autogen.sh | 7 +------ 1 files changed, 1 insertions(+), 6 deletions(-)
autogen.sh +1 -6
@@ -1,8 +1,3 @@ #! /bin/sh -set -x -aclocal -I config -libtoolize --force --copy -autoheader -automake --foreign --add-missing --copy -autoconf +autoreconf -ivf
Signature · 6 lines
1.7.3.4 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 4/7 .gitignore: Ignore files generated by the autotools
In reply to a message not in the archive--- .gitignore | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
.gitignore +5 -0
@@ -15,3 +15,8 @@ Makefile config.status stamp-h1 libtool +config/libtool.m4 +config/ltoptions.m4 +config/ltsugar.m4 +config/ltversion.m4 +config/lt~obsolete.m4
Signature · 6 lines
1.7.3.4 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 5/7 32-bit compiler warning fix
In reply to a message not in the archiveAvoid that the code in src/memory.c triggers a compiler warning when compiled on a 32-bit system.
--- src/memory.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
src/memory.c +2 -1
@@ -44,6 +44,7 @@#include <string.h> #include <dirent.h> #include <limits.h> +#include <inttypes.h> #include "ibverbs.h"
@@ -116,7 +117,7 @@ static unsigned long get_page_size(void *base)int n;uintptr_t range_start, range_end; - n =sscanf (buf,"%lx-%lx" , &range_start, &range_end); + n =sscanf (buf,"%" SCNxPTR"-%" SCNxPTR, &range_start, &range_end);if (n <2 )continue ;
Signature · 6 lines
1.7.3.4 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 6/7 Fix a compiler warning about an unused function
In reply to a message not in the archive--- src/memory.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
src/memory.c +2 -0
@@ -269,6 +269,7 @@ static void __mm_rotate_left(struct ibv_mem_node *node) node->parent = tmp; } +#if 0 static int verify (struct ibv_mem_node *node) {int hl, hr;
@@ -294,6 +295,7 @@ static int verify(struct ibv_mem_node *node) return hl + 1; } +#endif static void __mm_add_rebalance (struct ibv_mem_node *node) {
Signature · 6 lines
1.7.3.4 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 7/7 Fix a compiler warning related to NVALGRIND
In reply to a message not in the archiveAvoid that compiling with NVALGRIND defined and the latest Valgrind header files triggers compiler warnings. Recently the Valgrind client request implementation has been modified in order to not trigger compiler warnings when building with gcc 4.6. A side effect of that change is that Valgrind client request macros that return a value have to be cast to void in order to avoid a compiler warning.
For more information, see also:
* Valgrind manual about VALGRIND_MAKE_MEM_DEFINED (http://valgrind.org/docs/manual/mc-manual.html).
* Valgrind trunk r11755 (http://article.gmane.org/gmane.comp.debugging.valgrind.devel/13489).
--- src/cmd.c | 42 +++++++++++++++++++++--------------------- src/ibverbs.h | 2 +- src/verbs.c | 2 +- 3 files changed, 23 insertions(+), 23 deletions(-)
src/cmd.c +21 -21
@@ -71,7 +71,7 @@ static int ibv_cmd_get_context_v2(struct ibv_context *context,if (write (context->cmd_fd, cmd, cmd_size) != cmd_size)return errno; -VALGRIND_MAKE_MEM_DEFINED (resp, resp_size); + (void )VALGRIND_MAKE_MEM_DEFINED (resp, resp_size); context->async_fd = resp->async_fd; context->num_comp_vectors =1 ;
@@ -95,7 +95,7 @@ int ibv_cmd_get_context(struct ibv_context *context, struct ibv_get_context *cmdif (write (context->cmd_fd, cmd, cmd_size) != cmd_size)return errno; -VALGRIND_MAKE_MEM_DEFINED (resp, resp_size); + (void )VALGRIND_MAKE_MEM_DEFINED (resp, resp_size); context->async_fd = resp->async_fd; context->num_comp_vectors = resp->num_comp_vectors;
@@ -115,7 +115,7 @@ int ibv_cmd_query_device(struct ibv_context *context,if (write (context->cmd_fd, cmd, cmd_size) != cmd_size)return errno; -VALGRIND_MAKE_MEM_DEFINED (&resp,sizeof resp); + (void )VALGRIND_MAKE_MEM_DEFINED (&resp,sizeof resp);memset (device_attr->fw_ver,0 ,sizeof device_attr->fw_ver); *raw_fw_ver = resp.fw_ver;
@@ -175,7 +175,7 @@ int ibv_cmd_query_port(struct ibv_context *context, uint8_t port_num,if (write (context->cmd_fd, cmd, cmd_size) != cmd_size)return errno; -VALGRIND_MAKE_MEM_DEFINED (&resp,sizeof resp); + (void )VALGRIND_MAKE_MEM_DEFINED (&resp,sizeof resp); port_attr->state = resp.state; port_attr->max_mtu = resp.max_mtu;
@@ -210,7 +210,7 @@ int ibv_cmd_alloc_pd(struct ibv_context *context, struct ibv_pd *pd,if (write (context->cmd_fd, cmd, cmd_size) != cmd_size)return errno; -VALGRIND_MAKE_MEM_DEFINED (resp, resp_size); + (void )VALGRIND_MAKE_MEM_DEFINED (resp, resp_size); pd->handle = resp->pd_handle; pd->context = context;
@@ -249,7 +249,7 @@ int ibv_cmd_reg_mr(struct ibv_pd *pd, void *addr, size_t length,if (write (pd->context->cmd_fd, cmd, cmd_size) != cmd_size)return errno; -VALGRIND_MAKE_MEM_DEFINED (resp, resp_size); + (void )VALGRIND_MAKE_MEM_DEFINED (resp, resp_size); mr->handle = resp->mr_handle; mr->lkey = resp->lkey;
@@ -292,7 +292,7 @@ static int ibv_cmd_create_cq_v2(struct ibv_context *context, int cqe,if (write (context->cmd_fd, cmd, cmd_size) != cmd_size)return errno; -VALGRIND_MAKE_MEM_DEFINED (resp, resp_size); + (void )VALGRIND_MAKE_MEM_DEFINED (resp, resp_size); cq->handle = resp->cq_handle; cq->cqe = resp->cqe;
@@ -321,7 +321,7 @@ int ibv_cmd_create_cq(struct ibv_context *context, int cqe,if (write (context->cmd_fd, cmd, cmd_size) != cmd_size)return errno; -VALGRIND_MAKE_MEM_DEFINED (resp, resp_size); + (void )VALGRIND_MAKE_MEM_DEFINED (resp, resp_size); cq->handle = resp->cq_handle; cq->cqe = resp->cqe;
@@ -352,7 +352,7 @@ int ibv_cmd_poll_cq(struct ibv_cq *ibcq, int ne, struct ibv_wc *wc) goto out; } -VALGRIND_MAKE_MEM_DEFINED (resp, rsize); + (void )VALGRIND_MAKE_MEM_DEFINED (resp, rsize);for (i =0 ; i < resp->count; i++) { wc[i].wr_id = resp->wc[i].wr_id;
@@ -403,7 +403,7 @@ int ibv_cmd_resize_cq(struct ibv_cq *cq, int cqe,if (write (cq->context->cmd_fd, cmd, cmd_size) != cmd_size)return errno; -VALGRIND_MAKE_MEM_DEFINED (resp, resp_size); + (void )VALGRIND_MAKE_MEM_DEFINED (resp, resp_size); cq->cqe = resp->cqe;
@@ -438,7 +438,7 @@ int ibv_cmd_destroy_cq(struct ibv_cq *cq)if (write (cq->context->cmd_fd, &cmd,sizeof cmd) !=sizeof cmd)return errno; -VALGRIND_MAKE_MEM_DEFINED (&resp,sizeof resp); + (void )VALGRIND_MAKE_MEM_DEFINED (&resp,sizeof resp);pthread_mutex_lock (&cq->mutex); while (cq->comp_events_completed != resp.comp_events_reported ||
@@ -464,7 +464,7 @@ int ibv_cmd_create_srq(struct ibv_pd *pd,if (write (pd->context->cmd_fd, cmd, cmd_size) != cmd_size)return errno; -VALGRIND_MAKE_MEM_DEFINED (resp, resp_size); + (void )VALGRIND_MAKE_MEM_DEFINED (resp, resp_size); srq->handle = resp->srq_handle; srq->context = pd->context;
@@ -546,7 +546,7 @@ int ibv_cmd_query_srq(struct ibv_srq *srq, struct ibv_srq_attr *srq_attr,if (write (srq->context->cmd_fd, cmd, cmd_size) != cmd_size)return errno; -VALGRIND_MAKE_MEM_DEFINED (&resp,sizeof resp); + (void )VALGRIND_MAKE_MEM_DEFINED (&resp,sizeof resp); srq_attr->max_wr = resp.max_wr; srq_attr->max_sge = resp.max_sge;
@@ -583,7 +583,7 @@ int ibv_cmd_destroy_srq(struct ibv_srq *srq)if (write (srq->context->cmd_fd, &cmd,sizeof cmd) !=sizeof cmd)return errno; -VALGRIND_MAKE_MEM_DEFINED (&resp,sizeof resp); + (void )VALGRIND_MAKE_MEM_DEFINED (&resp,sizeof resp);pthread_mutex_lock (&srq->mutex);while (srq->events_completed != resp.events_reported)
@@ -618,7 +618,7 @@ int ibv_cmd_create_qp(struct ibv_pd *pd,if (write (pd->context->cmd_fd, cmd, cmd_size) != cmd_size)return errno; -VALGRIND_MAKE_MEM_DEFINED (resp, resp_size); + (void )VALGRIND_MAKE_MEM_DEFINED (resp, resp_size); qp->handle = resp->qp_handle; qp->qp_num = resp->qpn;
@@ -665,7 +665,7 @@ int ibv_cmd_query_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr,if (write (qp->context->cmd_fd, cmd, cmd_size) != cmd_size)return errno; -VALGRIND_MAKE_MEM_DEFINED (&resp,sizeof resp); + (void )VALGRIND_MAKE_MEM_DEFINED (&resp,sizeof resp); attr->qkey = resp.qkey; attr->rq_psn = resp.rq_psn;
@@ -886,7 +886,7 @@ int ibv_cmd_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr,if (write (ibqp->context->cmd_fd, cmd, cmd_size) != cmd_size) ret = errno; -VALGRIND_MAKE_MEM_DEFINED (&resp,sizeof resp); + (void )VALGRIND_MAKE_MEM_DEFINED (&resp,sizeof resp); wr_count = resp.bad_wr;if (wr_count) {
@@ -947,7 +947,7 @@ int ibv_cmd_post_recv(struct ibv_qp *ibqp, struct ibv_recv_wr *wr,if (write (ibqp->context->cmd_fd, cmd, cmd_size) != cmd_size) ret = errno; -VALGRIND_MAKE_MEM_DEFINED (&resp,sizeof resp); + (void )VALGRIND_MAKE_MEM_DEFINED (&resp,sizeof resp); wr_count = resp.bad_wr;if (wr_count) {
@@ -1008,7 +1008,7 @@ int ibv_cmd_post_srq_recv(struct ibv_srq *srq, struct ibv_recv_wr *wr,if (write (srq->context->cmd_fd, cmd, cmd_size) != cmd_size) ret = errno; -VALGRIND_MAKE_MEM_DEFINED (&resp,sizeof resp); + (void )VALGRIND_MAKE_MEM_DEFINED (&resp,sizeof resp); wr_count = resp.bad_wr;if (wr_count) {
@@ -1046,7 +1046,7 @@ int ibv_cmd_create_ah(struct ibv_pd *pd, struct ibv_ah *ah,if (write (pd->context->cmd_fd, &cmd,sizeof cmd) !=sizeof cmd)return errno; -VALGRIND_MAKE_MEM_DEFINED (&resp,sizeof resp); + (void )VALGRIND_MAKE_MEM_DEFINED (&resp,sizeof resp); ah->handle = resp.handle; ah->context = pd->context;
@@ -1082,7 +1082,7 @@ int ibv_cmd_destroy_qp(struct ibv_qp *qp)if (write (qp->context->cmd_fd, &cmd,sizeof cmd) !=sizeof cmd)return errno; -VALGRIND_MAKE_MEM_DEFINED (&resp,sizeof resp); + (void )VALGRIND_MAKE_MEM_DEFINED (&resp,sizeof resp);pthread_mutex_lock (&qp->mutex);while (qp->events_completed != resp.events_reported)
src/ibverbs.h +1 -1
@@ -49,7 +49,7 @@#endif /* HAVE_VALGRIND_MEMCHECK_H */ #ifndef VALGRIND_MAKE_MEM_DEFINED -# define VALGRIND_MAKE_MEM_DEFINED (addr, len) +# define VALGRIND_MAKE_MEM_DEFINED (addr, len) 0#endif #define HIDDEN __attribute__((visibility ("hidden")))
src/verbs.c +1 -1
@@ -226,7 +226,7 @@ struct ibv_comp_channel *ibv_create_comp_channel(struct ibv_context *context)return NULL ; } -VALGRIND_MAKE_MEM_DEFINED (&resp,sizeof resp); + (void )VALGRIND_MAKE_MEM_DEFINED (&resp,sizeof resp); channel->context = context; channel->fd = resp.fd;
Signature · 6 lines
1.7.3.4 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 2 lines · Bart Van Assche
This patch series addresses a few issues I noticed after having built libibverbs from the source tree available at kernel.org. Feedback is welcome.
Thanks Bart, all look good from a quick skim. Will apply when I get back from vacation in a couple of days.
If you are interested in doing the same fixes for libmthca and libmlx4 that would be welcome too.
- Roland
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html