1
1

Support the IBV_*_USNIC_* verbs constants.

These constants are now upstream (see
https://git.kernel.org/cgit/libs/infiniband/libibverbs.git/commit/?id=f57a9c67eabb9e7f19c624ac3c8c27b7be55796c),
so let's support them properly in Open MPI.

Added bonus: consolidating these checks up in
ompi_check_openfabrics.m4 allowed removing some custom checks and
AC_DEFINE's from the usnic configure.m4 script.

Also change the usnic/configure.m4 check for IBV_EVENT_GID_CHANGE to
use AC_CHECK_DECLS (vs. AC_CHECK_DECL).

cmr=v1.7.5:reviewer=dgoodell

This commit was SVN r30804.
Этот коммит содержится в:
Jeff Squyres 2014-02-24 18:57:04 +00:00
родитель 1b855eca8e
Коммит 5bedcc15bf
6 изменённых файлов: 39 добавлений и 30 удалений

Просмотреть файл

@ -152,7 +152,7 @@ AC_DEFUN([OMPI_CHECK_OPENFABRICS],[
# If we have the openib stuff available, find out what we've got
AS_IF([test "$ompi_check_openib_happy" = "yes"],
[AC_CHECK_DECLS([IBV_EVENT_CLIENT_REREGISTER, IBV_ACCESS_SO], [], [],
[AC_CHECK_DECLS([IBV_EVENT_CLIENT_REREGISTER, IBV_ACCESS_SO, IBV_TRANSPORT_USNIC, IBV_TRANSPORT_USNIC_UDP, IBV_NODE_USNIC], [], [],
[#include <infiniband/verbs.h>])
AC_CHECK_FUNCS([ibv_get_device_list ibv_resize_cq])

Просмотреть файл

@ -1121,7 +1121,7 @@ static bool port_is_usnic(ompi_common_verbs_port_item_t *port)
bool is_usnic = false;
uint32_t *vpi;
#if BTL_USNIC_HAVE_IBV_USNIC
#if HAVE_DECL_IBV_TRANSPORT_USNIC && HAVE_DECL_IBV_NODE_USNIC
/* If we have the IB_*_USNIC constants, then take any
device which advertises them */
if (IBV_TRANSPORT_USNIC == port->device->device->transport_type &&

Просмотреть файл

@ -1488,7 +1488,7 @@ static void module_async_event_callback(int fd, short flags, void *arg)
case IBV_EVENT_QP_FATAL:
case IBV_EVENT_PORT_ERR:
#if BTL_USNIC_HAVE_IBV_EVENT_GID_CHANGE
#if HAVE_DECL_IBV_EVENT_GID_CHANGE
case IBV_EVENT_GID_CHANGE:
#endif
default:

Просмотреть файл

@ -49,33 +49,12 @@ AC_DEFUN([MCA_ompi_btl_usnic_CONFIG],[
]
)
# Do we have the IBV_TRANSPORT_USNIC / IBV_NODE_USNIC defines?
# (note: if we have one, we have both)
btl_usnic_have_ibv_usnic=0
btl_usnic_have_ibv_event_gid_change=0
AS_IF([test "$btl_usnic_happy" = "yes"],
[AC_CHECK_DECL([IBV_NODE_USNIC],
[btl_usnic_have_ibv_usnic=1],
[],
[ #include <infiniband/verbs.h>
])
AC_CHECK_DECL([IBV_EVENT_GID_CHANGE],
[btl_usnic_have_ibv_event_gid_change=1],
[],
[ #include <infiniband/verbs.h>
])
AC_CHECK_DECLS([ibv_event_type_str], [], [],
[AC_CHECK_DECLS([IBV_EVENT_GID_CHANGE, ibv_event_type_str], [], [],
[#include <infiniband/verbs.h>
])
]
)
AC_DEFINE_UNQUOTED([BTL_USNIC_HAVE_IBV_USNIC],
[$btl_usnic_have_ibv_usnic],
[Whether we have IBV_NODE_USNIC / IBV_TRANSPORT_USNIC or not])
AC_DEFINE_UNQUOTED([BTL_USNIC_HAVE_IBV_EVENT_GID_CHANGE],
[$btl_usnic_have_ibv_event_gid_change],
[Whether we have IBV_EVENT_GID_CHANGE or not])
AS_IF([test "$btl_usnic_happy" = "yes"],
[btl_usnic_WRAPPER_EXTRA_LDFLAGS="$btl_usnic_LDFLAGS"

Просмотреть файл

@ -79,11 +79,17 @@ enum {
OMPI_COMMON_VERBS_FLAGS_UD = 0x4,
OMPI_COMMON_VERBS_FLAGS_TRANSPORT_IB = 0x8,
OMPI_COMMON_VERBS_FLAGS_TRANSPORT_IWARP = 0x10,
#if HAVE_DECL_IBV_TRANSPORT_USNIC
OMPI_COMMON_VERBS_FLAGS_TRANSPORT_USNIC = 0x20,
#endif
#if HAVE_DECL_IBV_TRANSPORT_USNIC_UDP
OMPI_COMMON_VERBS_FLAGS_TRANSPORT_USNIC_UDP = 0x40,
#endif
/* Note that these 2 link layer flags will only be useful if
defined(HAVE_IBV_LINK_LAYER_ETHERNET). Otherwise, they will be
ignored. */
OMPI_COMMON_VERBS_FLAGS_LINK_LAYER_IB = 0x20,
OMPI_COMMON_VERBS_FLAGS_LINK_LAYER_ETHERNET = 0x40,
OMPI_COMMON_VERBS_FLAGS_LINK_LAYER_IB = 0x80,
OMPI_COMMON_VERBS_FLAGS_LINK_LAYER_ETHERNET = 0x100,
OMPI_COMMON_VERBS_FLAGS_MAX
};

Просмотреть файл

@ -163,10 +163,16 @@ static bool want_this_port(char **include_list, char **exclude_list,
static const char *transport_name_to_str(enum ibv_transport_type transport_type)
{
switch(transport_type) {
case IBV_TRANSPORT_IB: return "IB";
case IBV_TRANSPORT_IWARP: return "IWARP";
case IBV_TRANSPORT_IB: return "IB";
case IBV_TRANSPORT_IWARP: return "IWARP";
#if HAVE_DECL_IBV_TRANSPORT_USNIC
case IBV_TRANSPORT_USNIC: return "usNIC";
#endif
#if HAVE_DECL_IBV_TRANSPORT_USNIC_UDP
case IBV_TRANSPORT_USNIC_UDP: return "usNIC UDP";
#endif
case IBV_TRANSPORT_UNKNOWN:
default: return "unknown";
default: return "unknown";
}
}
@ -331,6 +337,24 @@ opal_list_t *ompi_common_verbs_find_ports(const char *if_include,
transport_name_to_str(device->transport_type));
want = false;
}
#if HAVE_DECL_IBV_TRANSPORT_USNIC
if (flags & OMPI_COMMON_VERBS_FLAGS_TRANSPORT_USNIC &&
IBV_TRANSPORT_USNIC != device->transport_type) {
opal_output_verbose(5, stream, "verbs interface %s has wrong type (has %s, want usNIC)",
ibv_get_device_name(device),
transport_name_to_str(device->transport_type));
want = false;
}
#endif
#if HAVE_DECL_IBV_TRANSPORT_USNIC_UDP
if (flags & OMPI_COMMON_VERBS_FLAGS_TRANSPORT_USNIC_UDP &&
IBV_TRANSPORT_USNIC_UDP != device->transport_type) {
opal_output_verbose(5, stream, "verbs interface %s has wrong type (has %s, want usNIC/UDP)",
ibv_get_device_name(device),
transport_name_to_str(device->transport_type));
want = false;
}
#endif
/* Check for RC or UD QP support */
if (flags & OMPI_COMMON_VERBS_FLAGS_RC ||