Skip to content

Commit

Permalink
build: fix rdma configure logic
Browse files Browse the repository at this point in the history
Problem: when --enable-rdmatrans is explicitly requested, failure to
configure it is non-fatal.

Make it fatal if the feature cannot be enabled.

Also rename "rdmatrans" to "rdma" and label it experimental in the
configure help output since it is not production ready.  For example,
if configured, it unconditionally tries to listen on a hard wired
address.
  • Loading branch information
garlick committed Jan 19, 2025
1 parent 2038957 commit 9380f2d
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 35 deletions.
27 changes: 27 additions & 0 deletions config/x_ac_rdma.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
AC_DEFUN([X_AC_RDMA], [
got_rdma=no
AC_ARG_ENABLE([rdma],
[AS_HELP_STRING([--enable-rdma],
[build Infiniband RDMA transport (experimental)])],
[want_rdma=yes], [want_rdma=no])
if test x$want_rdma == xyes; then
X_AC_CHECK_COND_LIB(rdmacm, rdma_accept)
X_AC_CHECK_COND_LIB(ibverbs, ibv_alloc_pd)
AC_CHECK_HEADER([infiniband/verbs.h])
AC_CHECK_HEADER([rdma/rdma_cma.h])
if test x$ac_cv_lib_rdmacm_rdma_accept == xyes -a \
x$ac_cv_lib_ibverbs_ibv_alloc_pd == xyes -a \
x$ac_cv_header_infiniband_verbs_h == xyes -a \
x$ac_cv_header_rdma_rdma_cma_h == xyes; then
got_rdma=yes
AC_DEFINE([WITH_RDMA], [1], [build Infiniband RDMA transport])
else
AC_MSG_ERROR([Could not configure RDMA: missing ibverbs/rdmacm packages])
fi
fi
AM_CONDITIONAL([RDMA], [test "x$got_rdma" != xno])
])
26 changes: 0 additions & 26 deletions config/x_ac_rdmatrans.m4

This file was deleted.

2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ X_AC_CHECK_PTHREADS
X_AC_CHECK_COND_LIB(munge, munge_ctx_create)
X_AC_CHECK_COND_LIB(cap, cap_get_proc)
X_AC_TCMALLOC
X_AC_RDMATRANS
X_AC_RDMA

##
# For list.c, hostlist.c, hash.c
Expand Down
12 changes: 6 additions & 6 deletions src/cmd/diod.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#include "src/libdiod/diod_log.h"
#include "src/libdiod/diod_conf.h"
#include "src/libdiod/diod_sock.h"
#if WITH_RDMATRANS
#if WITH_RDMA
#include "src/libdiod/diod_rdma.h"
#endif

Expand Down Expand Up @@ -344,7 +344,7 @@ struct svc_struct {
pthread_t t;
int shutdown;
int reload;
#if WITH_RDMATRANS
#if WITH_RDMA
diod_rdma_t rdma;
pthread_t rdma_t;
#endif
Expand Down Expand Up @@ -421,7 +421,7 @@ _service_loop (void *arg)
return NULL;
}

#if WITH_RDMATRANS
#if WITH_RDMA
static void *
_service_loop_rdma (void *arg)
{
Expand Down Expand Up @@ -541,7 +541,7 @@ _service_run (srvmode_t mode, int rfdno, int wfdno)
case SRV_SOCKTEST:
if (!diod_sock_listen (l, &ss.fds, &ss.nfds))
msg_exit ("failed to set up listener");
#if WITH_RDMATRANS
#if WITH_RDMA
ss.rdma = diod_rdma_create ();
diod_rdma_listen (ss.rdma);
#endif
Expand Down Expand Up @@ -621,7 +621,7 @@ _service_run (srvmode_t mode, int rfdno, int wfdno)

if ((n = pthread_create (&ss.t, NULL, _service_loop, NULL)))
errn_exit (n, "pthread_create _service_loop");
#if WITH_RDMATRANS
#if WITH_RDMA
if ((n = pthread_create (&ss.rdma_t, NULL, _service_loop_rdma, NULL)))
errn_exit (n, "pthread_create _service_loop_rdma");
#endif
Expand All @@ -636,7 +636,7 @@ _service_run (srvmode_t mode, int rfdno, int wfdno)
}
if ((n = pthread_join (ss.t, NULL)))
errn_exit (n, "pthread_join _service_loop");
#if WITH_RDMATRANS
#if WITH_RDMA
if ((n = pthread_join (ss.rdma_t, NULL)))
errn_exit (n, "pthread_join _service_loop_rdma");
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/libdiod/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ libdiod_a_SOURCES = \
diod_ops.h \
lsderr.c

if RDMATRANS
if RDMA
libdiod_a_SOURCES += diod_rdma.c diod_rdma.h
endif

Expand Down
2 changes: 1 addition & 1 deletion src/libnpfs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ libnpfs_a_SOURCES += user-stub.c
endif
endif

if RDMATRANS
if RDMA
libnpfs_a_SOURCES += rdmatrans.c
endif

Expand Down

0 comments on commit 9380f2d

Please sign in to comment.