* [PATCH rdma-core 5/8] acm: Fix wrong format attributes for error
From: Jason Gunthorpe @ 2016-10-14 22:14 UTC (permalink / raw)
To: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: Christoph Hellwig, Sean Hefty
In-Reply-To: <1476483257-16308-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
The arguments were swapped, and totally crash-when-run wrong.
Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
ibacm/src/acm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ibacm/src/acm.c b/ibacm/src/acm.c
index e512939dd765..523b78082ff8 100644
--- a/ibacm/src/acm.c
+++ b/ibacm/src/acm.c
@@ -2483,7 +2483,7 @@ static void acm_open_dev(struct ibv_device *ibdev)
ret = ibv_query_device(verbs, &attr);
if (ret) {
- acm_log(0, "ERROR - ibv_query_device (%s) %d\n", ret, ibdev->name);
+ acm_log(0, "ERROR - ibv_query_device (%d) %s\n", ret, ibdev->name);
goto err1;
}
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH rdma-core 4/8] Enable -Wredundant-decls
From: Jason Gunthorpe @ 2016-10-14 22:14 UTC (permalink / raw)
To: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: Christoph Hellwig, Sean Hefty
In-Reply-To: <1476483257-16308-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
This is useful to detect possible confusion/mistakes around function
prototypes.
Old libnl includes such a mistake so this warning is only turned on with
new distros.
Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
CMakeLists.txt | 20 ++++++++++++++++++++
ibacm/src/acm_util.h | 4 ++--
libibverbs/neigh.c | 3 ---
librdmacm/preload.c | 2 --
providers/mlx4/mlx4.h | 6 ------
5 files changed, 22 insertions(+), 13 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 58de78d6cde0..bd58a7039618 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -269,6 +269,23 @@ endif()
RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WSTRICT_PROTOTYPES "-Wstrict-prototypes")
RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WOLD_STYLE_DEFINITION "-Wold-style-definition")
+# Old versions of libnl have a duplicated rtnl_route_put, disbale the warning on those
+# systems
+if (NOT NL_KIND EQUAL 0)
+ set(SAFE_CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES}")
+ set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
+ set(CMAKE_REQUIRED_INCLUDES "${NL_INCLUDE_DIRS}")
+ set(CMAKE_REQUIRED_FLAGS "-Wredundant-decls")
+ CHECK_C_SOURCE_COMPILES("
+ #include <netlink/route/route.h>
+ int main(int argc,const char *argv[]) { return 0; }"
+ HAVE_C_WREDUNDANT_DECLS
+ FAIL_REGEX "warning")
+ set(CMAKE_REQUIRED_INCLUDES "${SAFE_CMAKE_REQUIRED_INCLUDES}")
+ set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
+endif()
+RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WREDUNDANT_DECLS "-Wredundant-decls")
+
#-------------------------
# Build Prep
# Write out a git ignore file to the build directory if it isn't the source
@@ -354,3 +371,6 @@ endif()
if (NOT HAVE_C_WORKING_MISSING_FIELD_INITIALIZERS)
message(STATUS " -Wmissing-field-initializers does NOT work")
endif()
+if (NOT HAVE_C_WREDUNDANT_DECLS)
+ message(STATUS " -Wredundant-decls does NOT work")
+endif()
diff --git a/ibacm/src/acm_util.h b/ibacm/src/acm_util.h
index 055122cbeb86..a83d915f13e8 100644
--- a/ibacm/src/acm_util.h
+++ b/ibacm/src/acm_util.h
@@ -31,17 +31,17 @@
#define ACM_IF_H
#include <infiniband/verbs.h>
+#include <infiniband/acm_prov.h>
#ifdef ACME_PRINTS
+#undef acm_log
#define acm_log(level, format, ...) \
printf(format, ## __VA_ARGS__)
#else /* !ACME_PRINTS */
#define acm_log(level, format, ...) \
acm_write(level, "%s: "format, __func__, ## __VA_ARGS__)
-
-void acm_write(int level, const char *format, ...);
#endif /* ACME_PRINTS */
int acm_if_is_ib(char *ifname);
diff --git a/libibverbs/neigh.c b/libibverbs/neigh.c
index 67a83eb0fd27..1856aab74842 100644
--- a/libibverbs/neigh.c
+++ b/libibverbs/neigh.c
@@ -36,9 +36,6 @@ extern unsigned int if_nametoindex(__const char *__ifname) __THROW;
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
-/* Workaround - declaration missing */
-extern int rtnl_link_vlan_get_id(struct rtnl_link *);
-
#ifndef HAVE_LIBNL1
#include <netlink/route/link/vlan.h>
#endif
diff --git a/librdmacm/preload.c b/librdmacm/preload.c
index cf258bf8eb3a..c924f499b7c7 100644
--- a/librdmacm/preload.c
+++ b/librdmacm/preload.c
@@ -132,8 +132,6 @@ struct config_entry {
static struct config_entry *config;
static int config_cnt;
-extern char *program_invocation_short_name;
-
static void free_config(void)
{
diff --git a/providers/mlx4/mlx4.h b/providers/mlx4/mlx4.h
index a2d39e169c15..b851e953c36b 100644
--- a/providers/mlx4/mlx4.h
+++ b/providers/mlx4/mlx4.h
@@ -85,12 +85,6 @@ struct mlx4_xsrq_table {
int mask;
};
-void mlx4_init_xsrq_table(struct mlx4_xsrq_table *xsrq_table, int size);
-struct mlx4_srq *mlx4_find_xsrq(struct mlx4_xsrq_table *xsrq_table, uint32_t srqn);
-int mlx4_store_xsrq(struct mlx4_xsrq_table *xsrq_table, uint32_t srqn,
- struct mlx4_srq *srq);
-void mlx4_clear_xsrq(struct mlx4_xsrq_table *xsrq_table, uint32_t srqn);
-
enum {
MLX4_XRC_QPN_BIT = (1 << 23)
};
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH rdma-core 3/8] verbs: Use cmake to detect if net/if.h vs netling/route/link.h is broken
From: Jason Gunthorpe @ 2016-10-14 22:14 UTC (permalink / raw)
To: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: Christoph Hellwig, Sean Hefty
In-Reply-To: <1476483257-16308-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
If not then just use the header directly, otherwise use the work around.
The issue is that old libnl libraries include linux/if.h and the
declarations there conflict with net/if.h. New libraries do not
do this.
Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
CMakeLists.txt | 16 ++++++++++++++++
buildlib/config.h.in | 2 ++
libibverbs/neigh.c | 5 +++--
3 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bede766adf4d..58de78d6cde0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -210,6 +210,18 @@ else()
set(NL_LIBRARIES "")
endif()
+# Older stuff blows up if these headers are included together
+if (NOT NL_KIND EQUAL 0)
+ set(SAFE_CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES}")
+ set(CMAKE_REQUIRED_INCLUDES "${NL_INCLUDE_DIRS}")
+ CHECK_C_SOURCE_COMPILES("
+#include <netlink/route/link.h>
+#include <net/if.h>
+ int main(int argc,const char *argv[]) {return 0;}"
+ HAVE_WORKING_IF_H)
+ set(CMAKE_REQUIRED_INCLUDES "${SAFE_CMAKE_REQUIRED_INCLUDES}")
+endif()
+
# Statically determine sizeof(long), this is largely unnecessary, no new code
# should rely on this.
check_type_size("long" SIZEOF_LONG BUILTIN_TYPES_ONLY LANGUAGE C)
@@ -325,6 +337,10 @@ if (NL_KIND EQUAL 1)
endif()
if (NL_KIND EQUAL 0)
message(STATUS " neighbour resolution NOT enabled")
+else()
+ if (NOT HAVE_WORKING_IF_H)
+ message(STATUS " netlink/route/link.h and net/if.h NOT co-includable (old headers)")
+ endif()
endif()
if (NOT HAVE_RDMA_USER_RXE)
message(STATUS " rdma/rdma_user_rxe.h NOT found (old system kernel headers)")
diff --git a/buildlib/config.h.in b/buildlib/config.h.in
index 99103b779baf..23781807bce8 100644
--- a/buildlib/config.h.in
+++ b/buildlib/config.h.in
@@ -31,6 +31,8 @@
// FIXME This has been supported in compilers forever, we should just fail to build on such old systems.
#cmakedefine HAVE_FUNC_ATTRIBUTE_ALWAYS_INLINE 1
+#cmakedefine HAVE_WORKING_IF_H 1
+
@SIZEOF_LONG_CODE@
#if @NL_KIND@ == 3
diff --git a/libibverbs/neigh.c b/libibverbs/neigh.c
index 5acfcf06fcde..67a83eb0fd27 100644
--- a/libibverbs/neigh.c
+++ b/libibverbs/neigh.c
@@ -20,10 +20,11 @@
#include <ifaddrs.h>
#include <netdb.h>
#include <assert.h>
-#ifndef _LINUX_IF_H
+#if HAVE_WORKING_IF_H
#include <net/if.h>
#else
-/*Workaround when there's a collision between the includes */
+/* We need this decl from net/if.h but old systems do not let use co-include
+ net/if.h and netlink/route/link.h */
extern unsigned int if_nametoindex(__const char *__ifname) __THROW;
#endif
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH rdma-core 2/8] Enable -Wwrite-strings
From: Jason Gunthorpe @ 2016-10-14 22:14 UTC (permalink / raw)
To: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: Christoph Hellwig, Sean Hefty
In-Reply-To: <1476483257-16308-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
The is useful to detect possible writing to read only memory.
The compiler places strings in .rodata so they are unwritable and
are technically const.
Add consts as necessary, no casts were added so this should be safe.
Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
CMakeLists.txt | 1 +
ibacm/include/infiniband/acm_prov.h | 4 ++--
ibacm/prov/acmp/src/acmp.c | 2 +-
ibacm/src/acm.c | 8 ++++----
ibacm/src/acm_util.h | 2 +-
ibacm/src/acme.c | 8 ++++----
ibacm/src/parse.c | 2 +-
iwpmd/iwarp_pm.h | 2 +-
iwpmd/iwarp_pm_common.c | 7 ++++---
libibverbs/sysfs.c | 13 +++++++------
librdmacm/examples/cmatose.c | 2 +-
librdmacm/examples/cmtime.c | 4 ++--
librdmacm/examples/common.c | 2 +-
librdmacm/examples/common.h | 2 +-
librdmacm/examples/rcopy.c | 2 +-
librdmacm/examples/rdma_client.c | 4 ++--
librdmacm/examples/rdma_server.c | 2 +-
librdmacm/examples/rdma_xclient.c | 2 +-
librdmacm/examples/rdma_xserver.c | 2 +-
librdmacm/examples/riostream.c | 2 +-
librdmacm/examples/rping.c | 2 +-
librdmacm/examples/rstream.c | 2 +-
librdmacm/examples/udaddy.c | 2 +-
librdmacm/examples/udpong.c | 2 +-
srp_daemon/srp_daemon.c | 29 +++++++++++++++++------------
srp_daemon/srp_daemon.h | 2 +-
26 files changed, 60 insertions(+), 52 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 21a93892c858..bede766adf4d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -112,6 +112,7 @@ RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WARNINGS
"-Wall -Wextra -Wno-sign-compare -Wno-unused-parameter")
RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WMISSING_PROTOTYPES "-Wmissing-prototypes")
RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WMISSING_DECLARATIONS "-Wmissing-declarations")
+RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WWRITE_STRINGS "-Wwrite-strings")
# At some point around 5.4 gcc fixed missing-field-initializers to ignore this
# common idiom we use extensively. Since this is a useful warning for
diff --git a/ibacm/include/infiniband/acm_prov.h b/ibacm/include/infiniband/acm_prov.h
index 890e6baeb5e8..00baf582b74e 100644
--- a/ibacm/include/infiniband/acm_prov.h
+++ b/ibacm/include/infiniband/acm_prov.h
@@ -61,7 +61,7 @@ struct acm_address {
struct acm_provider {
size_t size;
uint32_t version;
- char *name;
+ const char *name;
int (*open_device)(const struct acm_device *device,
void **dev_context);
void (*close_device)(void *dev_context);
@@ -113,7 +113,7 @@ acm_alloc_sa_mad(const struct acm_endpoint *endpoint, void *context,
extern void acm_free_sa_mad(struct acm_sa_mad *mad);
extern int acm_send_sa_mad(struct acm_sa_mad *mad);
-extern char * acm_get_opts_file(void);
+extern const char *acm_get_opts_file(void);
extern void acm_increment_counter(int type);
#endif /* ACM_PROV_H */
diff --git a/ibacm/prov/acmp/src/acmp.c b/ibacm/prov/acmp/src/acmp.c
index d70501aff8e8..9ec7db44b0d1 100644
--- a/ibacm/prov/acmp/src/acmp.c
+++ b/ibacm/prov/acmp/src/acmp.c
@@ -2868,7 +2868,7 @@ static void acmp_set_options(void)
FILE *f;
char s[120];
char opt[32], value[256];
- char *opts_file = acm_get_opts_file();
+ const char *opts_file = acm_get_opts_file();
if (!(f = fopen(opts_file, "r")))
return;
diff --git a/ibacm/src/acm.c b/ibacm/src/acm.c
index 9186677fcc6f..e512939dd765 100644
--- a/ibacm/src/acm.c
+++ b/ibacm/src/acm.c
@@ -221,9 +221,9 @@ static struct sa_data {
/*
* Service options - may be set through ibacm_opts.cfg file.
*/
-static char *acme = IBACM_BIN_PATH "/ib_acme -A";
-static char *opts_file = ACM_CONF_DIR "/" ACM_OPTS_FILE;
-static char *addr_file = ACM_CONF_DIR "/" ACM_ADDR_FILE;
+static const char *acme = IBACM_BIN_PATH "/ib_acme -A";
+static const char *opts_file = ACM_CONF_DIR "/" ACM_OPTS_FILE;
+static const char *addr_file = ACM_CONF_DIR "/" ACM_ADDR_FILE;
static char log_file[128] = IBACM_LOG_FILE;
static int log_level = 0;
static char lock_file[128] = IBACM_PID_FILE;
@@ -292,7 +292,7 @@ int ib_any_gid(union ibv_gid *gid)
return ((gid->global.subnet_prefix | gid->global.interface_id) == 0);
}
-char * acm_get_opts_file(void)
+const char *acm_get_opts_file(void)
{
return opts_file;
}
diff --git a/ibacm/src/acm_util.h b/ibacm/src/acm_util.h
index 5243f8a7e750..055122cbeb86 100644
--- a/ibacm/src/acm_util.h
+++ b/ibacm/src/acm_util.h
@@ -53,6 +53,6 @@ typedef void (*acm_if_iter_cb)(char *ifname, union ibv_gid *gid, uint16_t pkey,
char *ip_str, void *ctx);
int acm_if_iter_sys(acm_if_iter_cb cb, void *ctx);
-char **parse(char *args, int *count);
+char **parse(const char *args, int *count);
#endif /* ACM_IF_H */
diff --git a/ibacm/src/acme.c b/ibacm/src/acme.c
index 6b5b2ecb7f8a..a924dad21089 100644
--- a/ibacm/src/acme.c
+++ b/ibacm/src/acme.c
@@ -44,13 +44,13 @@
#include "libacm.h"
#include "acm_util.h"
-static char *dest_dir = ACM_CONF_DIR;
-static char *addr_file = ACM_ADDR_FILE;
-static char *opts_file = ACM_OPTS_FILE;
+static const char *dest_dir = ACM_CONF_DIR;
+static const char *addr_file = ACM_ADDR_FILE;
+static const char *opts_file = ACM_OPTS_FILE;
static char *dest_addr;
static char *src_addr;
-static char *svc_arg = "localhost";
+static const char *svc_arg = "localhost";
static char *dest_arg;
static char *src_arg;
static char addr_type = 'u';
diff --git a/ibacm/src/parse.c b/ibacm/src/parse.c
index 52e66ab814e3..15aab17f8b0a 100644
--- a/ibacm/src/parse.c
+++ b/ibacm/src/parse.c
@@ -70,7 +70,7 @@ static char *expand(char *basename, char *args, int *str_cnt, int *str_size)
return str_buf;
}
-char **parse(char *args, int *count)
+char **parse(const char *args, int *count)
{
char **ptrs = NULL;
char *str_buf, *cpy, *token, *next;
diff --git a/iwpmd/iwarp_pm.h b/iwpmd/iwarp_pm.h
index 766e34fe03c7..b5a5a457a423 100644
--- a/iwpmd/iwarp_pm.h
+++ b/iwpmd/iwarp_pm.h
@@ -225,7 +225,7 @@ int send_iwpm_nlmsg(int, struct nl_msg *, int);
struct nl_msg *create_iwpm_nlmsg(__u16, int);
-void print_iwpm_sockaddr(struct sockaddr_storage *, char *, __u32);
+void print_iwpm_sockaddr(struct sockaddr_storage *, const char *, __u32);
__be16 get_sockaddr_port(struct sockaddr_storage *sockaddr);
diff --git a/iwpmd/iwarp_pm_common.c b/iwpmd/iwarp_pm_common.c
index ee9d11953018..58b1089a1998 100644
--- a/iwpmd/iwarp_pm_common.c
+++ b/iwpmd/iwarp_pm_common.c
@@ -39,7 +39,7 @@
#endif
/* iwpm config params */
-static char * iwpm_param_names[IWPM_PARAM_NUM] =
+static const char * iwpm_param_names[IWPM_PARAM_NUM] =
{ "nl_sock_rbuf_size" };
static int iwpm_param_vals[IWPM_PARAM_NUM] =
{ 0 };
@@ -609,8 +609,9 @@ int is_wcard_ipaddr(struct sockaddr_storage *search_addr)
* print_iwpm_sockaddr - Print socket address (IP address and Port)
* @sockaddr: socket address to print
* @msg: message to print
- */
-void print_iwpm_sockaddr(struct sockaddr_storage *sockaddr, char *msg, __u32 dbg_flag)
+ */
+void print_iwpm_sockaddr(struct sockaddr_storage *sockaddr, const char *msg,
+ __u32 dbg_flag)
{
struct sockaddr_in6 *sockaddr_v6;
struct sockaddr_in *sockaddr_v4;
diff --git a/libibverbs/sysfs.c b/libibverbs/sysfs.c
index d463241ade08..f45fa1a3614d 100644
--- a/libibverbs/sysfs.c
+++ b/libibverbs/sysfs.c
@@ -42,11 +42,11 @@
#include "ibverbs.h"
-static char *sysfs_path;
+static const char *sysfs_path;
const char *ibv_get_sysfs_path(void)
{
- char *env = NULL;
+ const char *env = NULL;
if (sysfs_path)
return sysfs_path;
@@ -60,12 +60,13 @@ const char *ibv_get_sysfs_path(void)
if (env) {
int len;
+ char *dup;
- sysfs_path = strndup(env, IBV_SYSFS_PATH_MAX);
- len = strlen(sysfs_path);
- while (len > 0 && sysfs_path[len - 1] == '/') {
+ sysfs_path = dup = strndup(env, IBV_SYSFS_PATH_MAX);
+ len = strlen(dup);
+ while (len > 0 && dup[len - 1] == '/') {
--len;
- sysfs_path[len] = '\0';
+ dup[len] = '\0';
}
} else
sysfs_path = "/sys";
diff --git a/librdmacm/examples/cmatose.c b/librdmacm/examples/cmatose.c
index d7bd92d72468..d9b6ca622393 100644
--- a/librdmacm/examples/cmatose.c
+++ b/librdmacm/examples/cmatose.c
@@ -75,7 +75,7 @@ static struct cmatest test;
static int connections = 1;
static int message_size = 100;
static int message_count = 10;
-static char *port = "7471";
+static const char *port = "7471";
static uint8_t set_tos = 0;
static uint8_t tos;
static uint8_t migrate = 0;
diff --git a/librdmacm/examples/cmtime.c b/librdmacm/examples/cmtime.c
index f0b4d0276288..b2a39cedd303 100644
--- a/librdmacm/examples/cmtime.c
+++ b/librdmacm/examples/cmtime.c
@@ -48,7 +48,7 @@
static struct rdma_addrinfo hints, *rai;
static struct rdma_event_channel *channel;
-static char *port = "7471";
+static const char *port = "7471";
static char *dst_addr;
static char *src_addr;
static int timeout = 2000;
@@ -66,7 +66,7 @@ enum step {
STEP_CNT
};
-static char *step_str[] = {
+static const char *step_str[] = {
"create id",
"bind addr",
"resolve addr",
diff --git a/librdmacm/examples/common.c b/librdmacm/examples/common.c
index 09468ce6a03c..8037dd830fa8 100644
--- a/librdmacm/examples/common.c
+++ b/librdmacm/examples/common.c
@@ -47,7 +47,7 @@
int use_rs = 1;
-int get_rdma_addr(char *src, char *dst, char *port,
+int get_rdma_addr(const char *src, const char *dst, const char *port,
struct rdma_addrinfo *hints, struct rdma_addrinfo **rai)
{
struct rdma_addrinfo rai_hints, *res;
diff --git a/librdmacm/examples/common.h b/librdmacm/examples/common.h
index ac2d160b0044..28b977a075e6 100644
--- a/librdmacm/examples/common.h
+++ b/librdmacm/examples/common.h
@@ -78,7 +78,7 @@ enum rs_optimization {
opt_bandwidth
};
-int get_rdma_addr(char *src, char *dst, char *port,
+int get_rdma_addr(const char *src, const char *dst, const char *port,
struct rdma_addrinfo *hints, struct rdma_addrinfo **rai);
void size_str(char *str, size_t ssize, long long size);
diff --git a/librdmacm/examples/rcopy.c b/librdmacm/examples/rcopy.c
index 38f69291b1f5..9ff7ade29261 100644
--- a/librdmacm/examples/rcopy.c
+++ b/librdmacm/examples/rcopy.c
@@ -52,7 +52,7 @@ union rsocket_address {
struct sockaddr_storage storage;
};
-static char *port = "7427";
+static const char *port = "7427";
static char *dst_addr;
static char *dst_file;
static char *src_file;
diff --git a/librdmacm/examples/rdma_client.c b/librdmacm/examples/rdma_client.c
index fd7bbc20aa6a..c27047c5124f 100644
--- a/librdmacm/examples/rdma_client.c
+++ b/librdmacm/examples/rdma_client.c
@@ -36,8 +36,8 @@
#include <rdma/rdma_cma.h>
#include <rdma/rdma_verbs.h>
-static char *server = "127.0.0.1";
-static char *port = "7471";
+static const char *server = "127.0.0.1";
+static const char *port = "7471";
static struct rdma_cm_id *id;
static struct ibv_mr *mr, *send_mr;
diff --git a/librdmacm/examples/rdma_server.c b/librdmacm/examples/rdma_server.c
index 3c7c15e0d318..bcf649febf5f 100644
--- a/librdmacm/examples/rdma_server.c
+++ b/librdmacm/examples/rdma_server.c
@@ -36,7 +36,7 @@
#include <rdma/rdma_cma.h>
#include <rdma/rdma_verbs.h>
-static char *port = "7471";
+static const char *port = "7471";
static struct rdma_cm_id *listen_id, *id;
static struct ibv_mr *mr, *send_mr;
diff --git a/librdmacm/examples/rdma_xclient.c b/librdmacm/examples/rdma_xclient.c
index d86fee1b01ee..3518db95442b 100644
--- a/librdmacm/examples/rdma_xclient.c
+++ b/librdmacm/examples/rdma_xclient.c
@@ -37,7 +37,7 @@
#include <rdma/rdma_cma.h>
#include <rdma/rdma_verbs.h>
-static char *server = "127.0.0.1";
+static const char *server = "127.0.0.1";
static char port[6] = "7471";
static struct rdma_cm_id *id;
diff --git a/librdmacm/examples/rdma_xserver.c b/librdmacm/examples/rdma_xserver.c
index f838e7d5de8b..2fbb4bf5b339 100644
--- a/librdmacm/examples/rdma_xserver.c
+++ b/librdmacm/examples/rdma_xserver.c
@@ -38,7 +38,7 @@
#include <rdma/rdma_cma.h>
#include <rdma/rdma_verbs.h>
-static char *port = "7471";
+static const char *port = "7471";
static struct rdma_cm_id *listen_id, *id;
static struct ibv_mr *mr;
diff --git a/librdmacm/examples/riostream.c b/librdmacm/examples/riostream.c
index bdc1eec04ae8..bd8c60cdcb1d 100644
--- a/librdmacm/examples/riostream.c
+++ b/librdmacm/examples/riostream.c
@@ -88,7 +88,7 @@ static int transfer_size = 1000;
static int transfer_count = 1000;
static int buffer_size, inline_size = 64;
static char test_name[10] = "custom";
-static char *port = "7471";
+static const char *port = "7471";
static char *dst_addr;
static char *src_addr;
static struct timeval start, end;
diff --git a/librdmacm/examples/rping.c b/librdmacm/examples/rping.c
index c248e66aaa83..ad38f6da7096 100644
--- a/librdmacm/examples/rping.c
+++ b/librdmacm/examples/rping.c
@@ -1138,7 +1138,7 @@ static int get_addr(char *dst, struct sockaddr *addr)
return ret;
}
-static void usage(char *name)
+static void usage(const char *name)
{
printf("%s -s [-vVd] [-S size] [-C count] [-a addr] [-p port]\n",
basename(name));
diff --git a/librdmacm/examples/rstream.c b/librdmacm/examples/rstream.c
index 98b9d3f91ecb..59a0d4351ef5 100644
--- a/librdmacm/examples/rstream.c
+++ b/librdmacm/examples/rstream.c
@@ -90,7 +90,7 @@ static int transfer_size = 1000;
static int transfer_count = 1000;
static int buffer_size, inline_size = 64;
static char test_name[10] = "custom";
-static char *port = "7471";
+static const char *port = "7471";
static int keepalive;
static char *dst_addr;
static char *src_addr;
diff --git a/librdmacm/examples/udaddy.c b/librdmacm/examples/udaddy.c
index 5e89ca1e1d75..af0d6f713ed1 100644
--- a/librdmacm/examples/udaddy.c
+++ b/librdmacm/examples/udaddy.c
@@ -72,7 +72,7 @@ static struct cmatest test;
static int connections = 1;
static int message_size = 100;
static int message_count = 10;
-static char *port = "7174";
+static const char *port = "7174";
static uint8_t set_tos = 0;
static uint8_t tos;
static char *dst_addr;
diff --git a/librdmacm/examples/udpong.c b/librdmacm/examples/udpong.c
index 0f44f50e6e88..f8d56073012a 100644
--- a/librdmacm/examples/udpong.c
+++ b/librdmacm/examples/udpong.c
@@ -93,7 +93,7 @@ static int transfer_size = 1000;
static int transfer_count = 1000;
static int buffer_size;
static char test_name[10] = "custom";
-static char *port = "7174";
+static const char *port = "7174";
static char *dst_addr;
static char *src_addr;
static union socket_addr addr;
diff --git a/srp_daemon/srp_daemon.c b/srp_daemon/srp_daemon.c
index 6cb22e4c3f21..e0e550d81ab3 100644
--- a/srp_daemon/srp_daemon.c
+++ b/srp_daemon/srp_daemon.c
@@ -82,7 +82,7 @@ enum log_dest { log_to_syslog, log_to_stderr };
static int get_lid(struct umad_resources *umad_res, ib_gid_t *gid, uint16_t *lid);
static const int node_table_response_size = 1 << 18;
-static char *sysfs_path = "/sys";
+static const char *sysfs_path = "/sys";
static enum log_dest s_log_dest = log_to_syslog;
static int wakeup_pipe[2] = { -1, -1 };
@@ -152,7 +152,7 @@ static int check_process_uniqueness(struct config_t *conf)
}
static int srpd_sys_read_string(const char *dir_name, const char *file_name,
- char *str, int max_len)
+ char *str, int max_len)
{
char path[256], *s;
int fd, r;
@@ -177,7 +177,8 @@ static int srpd_sys_read_string(const char *dir_name, const char *file_name,
return 0;
}
-static int srpd_sys_read_gid(char *dir_name, char *file_name, uint8_t *gid)
+static int srpd_sys_read_gid(const char *dir_name, const char *file_name,
+ uint8_t *gid)
{
char buf[64], *str, *s;
uint16_t *ugid = (uint16_t *)gid;
@@ -195,7 +196,8 @@ static int srpd_sys_read_gid(char *dir_name, char *file_name, uint8_t *gid)
return 0;
}
-static int srpd_sys_read_uint64(char *dir_name, char *file_name, uint64_t *u)
+static int srpd_sys_read_uint64(const char *dir_name, const char *file_name,
+ uint64_t *u)
{
char buf[32];
int r;
@@ -234,7 +236,7 @@ static void usage(const char *argv0)
}
static int
-check_equal_uint64(char *dir_name, char *attr, uint64_t val)
+check_equal_uint64(char *dir_name, const char *attr, uint64_t val)
{
uint64_t attr_value;
@@ -245,7 +247,7 @@ check_equal_uint64(char *dir_name, char *attr, uint64_t val)
}
static int
-check_equal_uint16(char *dir_name, char *attr, uint16_t val)
+check_equal_uint16(char *dir_name, const char *attr, uint16_t val)
{
uint64_t attr_value;
@@ -309,7 +311,8 @@ void pr_err(const char *fmt, ...)
}
}
-static int check_not_equal_str(char *dir_name, char *attr, char *value)
+static int check_not_equal_str(const char *dir_name, const char *attr,
+ const char *value)
{
const int MAX_ATTR_STRING_LENGTH=64;
@@ -329,7 +332,8 @@ static int check_not_equal_str(char *dir_name, char *attr, char *value)
return 0;
}
-static int check_not_equal_int(char *dir_name, char *attr, int value)
+static int check_not_equal_int(const char *dir_name, const char *attr,
+ int value)
{
const int MAX_ATTR_STRING_LENGTH=64;
@@ -654,12 +658,13 @@ static void initialize_sysfs(void)
env = getenv("SYSFS_PATH");
if (env) {
int len;
+ char *dup;
- sysfs_path = strndup(env, 256);
- len = strlen(sysfs_path);
- while (len > 0 && sysfs_path[len - 1] == '/') {
+ sysfs_path = dup = strndup(env, 256);
+ len = strlen(dup);
+ while (len > 0 && dup[len - 1] == '/') {
--len;
- sysfs_path[len] = '\0';
+ dup[len] = '\0';
}
}
}
diff --git a/srp_daemon/srp_daemon.h b/srp_daemon/srp_daemon.h
index 5d42d51e6d1c..d9d92f10f84c 100644
--- a/srp_daemon/srp_daemon.h
+++ b/srp_daemon/srp_daemon.h
@@ -324,7 +324,7 @@ struct config_t {
int timeout;
int recalc_time;
int print_initiator_ext;
- char *rules_file;
+ const char *rules_file;
struct rule *rules;
int retry_timeout;
int tl_retry_count;
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH rdma-core 1/8] rdmacm: constify rdma_getaddrinfo public function
From: Jason Gunthorpe @ 2016-10-14 22:14 UTC (permalink / raw)
To: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: Christoph Hellwig, Sean Hefty
In-Reply-To: <1476483257-16308-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Like getaddrinfo most of the arguments should be const.
Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
librdmacm/acm.c | 3 ++-
librdmacm/addrinfo.c | 14 ++++++++------
librdmacm/cma.h | 3 ++-
librdmacm/man/rdma_getaddrinfo.3 | 6 +++---
librdmacm/rdma_cma.h | 4 ++--
5 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/librdmacm/acm.c b/librdmacm/acm.c
index ad6706b2592e..ccd5494c631d 100644
--- a/librdmacm/acm.c
+++ b/librdmacm/acm.c
@@ -363,7 +363,8 @@ static int ucma_ib_addr(struct sockaddr *addr, socklen_t len)
return len && addr && (addr->sa_family == AF_IB);
}
-void ucma_ib_resolve(struct rdma_addrinfo **rai, struct rdma_addrinfo *hints)
+void ucma_ib_resolve(struct rdma_addrinfo **rai,
+ const struct rdma_addrinfo *hints)
{
struct acm_msg msg;
struct acm_ep_addr_data *data;
diff --git a/librdmacm/addrinfo.c b/librdmacm/addrinfo.c
index 2c515a257a27..ac346438a6d0 100644
--- a/librdmacm/addrinfo.c
+++ b/librdmacm/addrinfo.c
@@ -45,7 +45,8 @@
static struct rdma_addrinfo nohints;
-static void ucma_convert_to_ai(struct addrinfo *ai, struct rdma_addrinfo *rai)
+static void ucma_convert_to_ai(struct addrinfo *ai,
+ const struct rdma_addrinfo *rai)
{
memset(ai, 0, sizeof(*ai));
if (rai->ai_flags & RAI_PASSIVE)
@@ -141,7 +142,8 @@ static int ucma_convert_in6(int ps, struct sockaddr_ib **dst, socklen_t *dst_len
}
static int ucma_convert_to_rai(struct rdma_addrinfo *rai,
- struct rdma_addrinfo *hints, struct addrinfo *ai)
+ const struct rdma_addrinfo *hints,
+ const struct addrinfo *ai)
{
int ret;
@@ -210,8 +212,8 @@ static int ucma_convert_to_rai(struct rdma_addrinfo *rai,
return ret;
}
-static int ucma_getaddrinfo(char *node, char *service,
- struct rdma_addrinfo *hints,
+static int ucma_getaddrinfo(const char *node, const char *service,
+ const struct rdma_addrinfo *hints,
struct rdma_addrinfo *rai)
{
struct addrinfo ai_hints;
@@ -232,8 +234,8 @@ static int ucma_getaddrinfo(char *node, char *service,
return ret;
}
-int rdma_getaddrinfo(char *node, char *service,
- struct rdma_addrinfo *hints,
+int rdma_getaddrinfo(const char *node, const char *service,
+ const struct rdma_addrinfo *hints,
struct rdma_addrinfo **res)
{
struct rdma_addrinfo *rai;
diff --git a/librdmacm/cma.h b/librdmacm/cma.h
index 1610e178dfdb..6fe786052dff 100644
--- a/librdmacm/cma.h
+++ b/librdmacm/cma.h
@@ -140,7 +140,8 @@ extern int af_ib_support;
void ucma_ib_init(void);
void ucma_ib_cleanup(void);
-void ucma_ib_resolve(struct rdma_addrinfo **rai, struct rdma_addrinfo *hints);
+void ucma_ib_resolve(struct rdma_addrinfo **rai,
+ const struct rdma_addrinfo *hints);
struct ib_connect_hdr {
uint8_t cma_version;
diff --git a/librdmacm/man/rdma_getaddrinfo.3 b/librdmacm/man/rdma_getaddrinfo.3
index cd819c6cdf42..9e133ffea0a5 100644
--- a/librdmacm/man/rdma_getaddrinfo.3
+++ b/librdmacm/man/rdma_getaddrinfo.3
@@ -5,9 +5,9 @@ rdma_getaddrinfo \- Provides transport independent address translation.
.B "#include <rdma/rdma_cma.h>"
.P
.B "int" rdma_getaddrinfo
-.BI "(char *" node ","
-.BI "char *" service ","
-.BI "struct rdma_addrinfo *" hints ","
+.BI "(const char *" node ","
+.BI "const char *" service ","
+.BI "const struct rdma_addrinfo *" hints ","
.BI "struct rdma_addrinfo **" res ");"
.SH ARGUMENTS
.IP "node" 12
diff --git a/librdmacm/rdma_cma.h b/librdmacm/rdma_cma.h
index 2055665a1496..45c492ab6217 100644
--- a/librdmacm/rdma_cma.h
+++ b/librdmacm/rdma_cma.h
@@ -668,8 +668,8 @@ int rdma_migrate_id(struct rdma_cm_id *id, struct rdma_event_channel *channel);
/**
* rdma_getaddrinfo - RDMA address and route resolution service.
*/
-int rdma_getaddrinfo(char *node, char *service,
- struct rdma_addrinfo *hints,
+int rdma_getaddrinfo(const char *node, const char *service,
+ const struct rdma_addrinfo *hints,
struct rdma_addrinfo **res);
void rdma_freeaddrinfo(struct rdma_addrinfo *res);
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH rdma-core 0/8] More warning fixing
From: Jason Gunthorpe @ 2016-10-14 22:14 UTC (permalink / raw)
To: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: Christoph Hellwig, Sean Hefty
This batch is on top of the series from Christoph Hellwig, it turns on a few
more useful gcc warnings and fixes the fall out.
Whole batch is here now: https://github.com/linux-rdma/rdma-core/pull/19
Jason Gunthorpe (8):
rdmacm: constify rdma_getaddrinfo public function
Enable -Wwrite-strings
verbs: Use cmake to detect if net/if.h vs netling/route/link.h is
broken
Enable -Wredundant-decls
acm: Fix wrong format attributes for error
acm: Fix format string usage with acm_log
Enable -Wformat=2
Enable -Wshadow
CMakeLists.txt | 55 ++++++++++++++++++++++++++++++++
buildlib/config.h.in | 2 ++
ibacm/include/infiniband/acm_prov.h | 7 +++--
ibacm/prov/acmp/src/acmp.c | 38 ++++++++++++-----------
ibacm/src/acm.c | 25 ++++++++-------
ibacm/src/acm_util.h | 6 ++--
ibacm/src/acme.c | 8 ++---
ibacm/src/parse.c | 2 +-
iwpmd/iwarp_pm.h | 2 +-
iwpmd/iwarp_pm_common.c | 7 +++--
libibverbs/examples/srq_pingpong.c | 1 -
libibverbs/examples/xsrq_pingpong.c | 6 ++--
libibverbs/neigh.c | 8 ++---
libibverbs/sysfs.c | 13 ++++----
libibverbs/verbs.h | 6 ++--
librdmacm/acm.c | 3 +-
librdmacm/addrinfo.c | 14 +++++----
librdmacm/cma.h | 3 +-
librdmacm/examples/cmatose.c | 2 +-
librdmacm/examples/cmtime.c | 4 +--
librdmacm/examples/common.c | 2 +-
librdmacm/examples/common.h | 2 +-
librdmacm/examples/rcopy.c | 2 +-
librdmacm/examples/rdma_client.c | 4 +--
librdmacm/examples/rdma_server.c | 2 +-
librdmacm/examples/rdma_xclient.c | 2 +-
librdmacm/examples/rdma_xserver.c | 2 +-
librdmacm/examples/riostream.c | 36 ++++++++++-----------
librdmacm/examples/rping.c | 2 +-
librdmacm/examples/rstream.c | 52 +++++++++++++++----------------
librdmacm/examples/udaddy.c | 2 +-
librdmacm/examples/udpong.c | 62 ++++++++++++++++++-------------------
librdmacm/man/rdma_getaddrinfo.3 | 6 ++--
librdmacm/preload.c | 2 --
librdmacm/rdma_cma.h | 4 +--
providers/mlx4/mlx4.h | 6 ----
providers/mthca/cq.c | 2 +-
srp_daemon/srp_daemon.c | 29 ++++++++++-------
srp_daemon/srp_daemon.h | 2 +-
39 files changed, 247 insertions(+), 186 deletions(-)
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PULL REQUEST] Please pull rdma.git (tag for-linus)
From: Doug Ledford @ 2016-10-14 21:01 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-rdma
In-Reply-To: <CA+55aFw39f5Mu38e6vrot=no8zT8Jaqq86iBJrRyX55UCq=VMg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 820 bytes --]
On 10/14/2016 4:45 PM, Linus Torvalds wrote:
> On Fri, Oct 14, 2016 at 1:37 PM, Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
>>
>> Early on in the merge window I mentioned I had a backlog of new drivers
>> waiting to be reviewed and that, in addition to the hns-roce driver, I
>> wanted to get possible a couple more reviewed. I ended up only having
>> the time to complete one of the additional drivers.
>
> This had better be the last of it, because if it's not, I'm not taking any more.
>
> Getting these kinds of updates on Friday afternoon just before the
> weekedn that the merge window is closing is very annoying.
>
> Linus
>
Yes, this is it.
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG Key ID: 0E572FDD
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]
^ permalink raw reply
* Re: [PULL REQUEST] Please pull rdma.git (tag for-linus)
From: Linus Torvalds @ 2016-10-14 20:45 UTC (permalink / raw)
To: Doug Ledford; +Cc: linux-rdma
In-Reply-To: <7c0a013c-6b5a-4031-9fd7-b511b1799528-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
On Fri, Oct 14, 2016 at 1:37 PM, Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
>
> Early on in the merge window I mentioned I had a backlog of new drivers
> waiting to be reviewed and that, in addition to the hns-roce driver, I
> wanted to get possible a couple more reviewed. I ended up only having
> the time to complete one of the additional drivers.
This had better be the last of it, because if it's not, I'm not taking any more.
Getting these kinds of updates on Friday afternoon just before the
weekedn that the merge window is closing is very annoying.
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PULL REQUEST] Please pull rdma.git (tag for-linus)
From: Doug Ledford @ 2016-10-14 20:37 UTC (permalink / raw)
To: Torvalds, Linus, linux-rdma
[-- Attachment #1.1: Type: text/plain, Size: 3983 bytes --]
Hi Linus,
Early on in the merge window I mentioned I had a backlog of new drivers
waiting to be reviewed and that, in addition to the hns-roce driver, I
wanted to get possible a couple more reviewed. I ended up only having
the time to complete one of the additional drivers. During Dave
Miller's pull request this go around, there were a series of 9 patches
to the QLogic qed net driver that add basic support for a paired RoCE
driver. That support is currently not functional because it is missing
the matching RoCE driver in the RDMA subsystem. I managed to finish
that review. However, because it goes against part of Dave's net pull,
and a part that was accepted a day or two after the merge window opened,
to apply cleanly it has to be applied to either the tip of Dave's net
branch, or as I did in this case, I just applied it to your master after
you had taken Dave's pull request. I know this is large for the end of
the merge window, my apologies for that. I have a considerable backlog
of new drivers awaiting review and final approval (still three more even
after the hns-roce and qedr), so I would appreciate it if we could take
this so I can check it off of my list.
Here's the boilerplate:
The following changes since commit e9f8f48bcac6f6dd37ad89ad63d1d1a497332313:
Merge tag 'metag-for-v4.9-rc1' of
git://git.kernel.org/pub/scm/linux/kernel/git/jhogan/metag (2016-10-14
11:11:39 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma.git
tags/for-linus
for you to fetch changes up to 993d1b52615e1a549e55875c3b74308391672d9f:
qedr: Add events support and register IB device (2016-10-14 15:00:10
-0400)
----------------------------------------------------------------
Merge of the qedr RoCE driver
----------------------------------------------------------------
Ram Amrani (10):
qedr: Add RoCE driver framework
qedr: Add support for RoCE HW init
qedr: Add support for user context verbs
qedr: Add support for PD,PKEY and CQ verbs
qedr: Add support for QP verbs
qedr: Add support for memory registeration verbs
qedr: Add support for data path
qedr: Add LL2 RoCE interface
qedr: Add GSI support
qedr: Add events support and register IB device
drivers/infiniband/Kconfig | 2 +
drivers/infiniband/hw/Makefile | 1 +
drivers/infiniband/hw/qedr/Kconfig | 7 +
drivers/infiniband/hw/qedr/Makefile | 3 +
drivers/infiniband/hw/qedr/main.c | 914 +++++++
drivers/infiniband/hw/qedr/qedr.h | 495 ++++
drivers/infiniband/hw/qedr/qedr_cm.c | 622 +++++
drivers/infiniband/hw/qedr/qedr_cm.h | 61 +
drivers/infiniband/hw/qedr/qedr_hsi.h | 56 +
drivers/infiniband/hw/qedr/qedr_hsi_rdma.h | 748 ++++++
drivers/infiniband/hw/qedr/verbs.c | 3547
++++++++++++++++++++++++++++
drivers/infiniband/hw/qedr/verbs.h | 101 +
drivers/net/ethernet/qlogic/Kconfig | 11 -
include/uapi/linux/pci_regs.h | 3 +
include/uapi/rdma/qedr-abi.h | 106 +
15 files changed, 6666 insertions(+), 11 deletions(-)
create mode 100644 drivers/infiniband/hw/qedr/Kconfig
create mode 100644 drivers/infiniband/hw/qedr/Makefile
create mode 100644 drivers/infiniband/hw/qedr/main.c
create mode 100644 drivers/infiniband/hw/qedr/qedr.h
create mode 100644 drivers/infiniband/hw/qedr/qedr_cm.c
create mode 100644 drivers/infiniband/hw/qedr/qedr_cm.h
create mode 100644 drivers/infiniband/hw/qedr/qedr_hsi.h
create mode 100644 drivers/infiniband/hw/qedr/qedr_hsi_rdma.h
create mode 100644 drivers/infiniband/hw/qedr/verbs.c
create mode 100644 drivers/infiniband/hw/qedr/verbs.h
create mode 100644 include/uapi/rdma/qedr-abi.h
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG Key ID: 0E572FDD
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]
^ permalink raw reply
* [PULL REQUEST] Please pull rdma.git (tag for-linus-2)
From: Doug Ledford @ 2016-10-14 20:25 UTC (permalink / raw)
To: Torvalds, Linus, David Miller, linux-rdma
[-- Attachment #1.1: Type: text/plain, Size: 5814 bytes --]
Hi Linus,
This is another isolated pull request. This merge window was the first
where Hauwei had to try and coordinate their patches between their net
driver and their new roce driver (similar to mlx4 and mlx5). They
didn't do horribly, but there were some issues (and we knew that because
they simply didn't know what to do in the beginning). As a result, I
had a set of patches that depended on some patches that normally would
have come to you via Dave's tree. Those patches have been on netdev@
for a while, so I got Dave to give me his approval to send them to you.
As such, the other 29 patches I had behind them are also now ready to
go. This catches the hns and hns-roce drivers up to current, and for
future patches we are working with them to get them up to speed on how
to do joint driver development so that they don't have these sorts of
cross tree dependency issues again. BTW, Dave gave me permission to add
his Acked-by: to the patches against the net tree, but I've had this
branch through 0day (but not linux-next since it was off by itself) and
I didn't want to rebase the series just to add Dave's ack for the 8
patches in the net area, so that's why I've Cc:ed him on the pull
request. Hope that was the right thing to do in that regard.
Here's the boilerplate:
The following changes since commit 528f1deb16e5b82e9fe161ebd8caa5983766f0f0:
IB/hns: Add support of ACPI to the Hisilicon RoCE driver (2016-08-25
10:05:10 -0400)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma.git
tags/for-linus-2
for you to fetch changes up to 1bdab400af5954932714e68ab3df0187a92916cb:
IB/hns: Fix for removal of redundant code (2016-10-03 11:43:15 -0400)
----------------------------------------------------------------
Updates to the hns drivers
- Small patch set for hns net driver that the roce patches depend on
- Various fixes to the hns-roce driver
- Add connection manager support to the hns-roce driver
----------------------------------------------------------------
Daode Huang (6):
net: hns: bug fix about setting coalsecs-usecs to 0
net: hns: add fini_process for v2 napi process
net: hns: delete repeat read fbd num after while
net: hns: fix the bug of forwarding table
net: hns: bug fix about broadcast/multicast packets
net: hns: delete redundant broadcast packet filter process
Kejian Yan (1):
net: hns: fix port not available after testing loopback
Lijun Ou (24):
IB/hns: Register HNS RoCE Driver get_netdev() with IB Core
IB/hns: Add & initialize "node_guid" parameter for RDMA CM
IB/hns: Fix the value of device_cap_flags
IB/hns: Fix two possible bugs for rdma cm
IB/hns: Add phy_port for computing GSI/QPN
IB/hns: Change the logic for allocating uar registers
IB/hns: Fix the bug of rdma cm connecting on user mode
IB/hns: Fix two bugs for rdma cm connecting
IB/hns: Add node_guid definition to the bindings document
IB/hns: Remove unused parameters in some functions
IB/hns: Remove parameters of resize cq
IB/hns: Fix bug of using uninit refcount and free
IB/hns: Simplify function of pd alloc and qp alloc
IB/hns: Remove unused parameter named qp_type
IB/hns: Modify the init of iboe lock
IB/hns: Fix bug of memory leakage for registering user mr
IB/hns: Return bad wr while post send failed
IB/hns: The Ack timeout need a lower limit value
IB/hns: Some items of qpc need to take user param
IB/hns: Validate mtu when modified qp
IB/hns: Cq has not been freed
IB/hns: Update the rq head when modify qp state
IB/hns: Fix the bug when platform_get_resource() exec fail
IB/hns: Delete the redundant lines in hns_roce_v1_m_qp()
Salil (1):
IB/hns: Fix for removal of redundant code
Wei Hu (Xavier) (3):
IB/hns: Fix bug of clear hem
IB/hns: Delete the sqp_start from the structure hns_roce_caps
IB/hns: Optimize code of aeq and ceq interrupt handle and fix the
bug of qpn
lipeng (1):
net: hns: fix port unavailable after hnae_reserve_buffer_map fail
.../bindings/infiniband/hisilicon-hns-roce.txt | 2 +
drivers/infiniband/hw/hns/hns_roce_cq.c | 23 +-
drivers/infiniband/hw/hns/hns_roce_device.h | 18 +-
drivers/infiniband/hw/hns/hns_roce_eq.c | 146 +++++-----
drivers/infiniband/hw/hns/hns_roce_eq.h | 4 +
drivers/infiniband/hw/hns/hns_roce_hem.c | 76 +-----
drivers/infiniband/hw/hns/hns_roce_hem.h | 4 +
drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 293
+++++++++++++++------
drivers/infiniband/hw/hns/hns_roce_hw_v1.h | 9 +
drivers/infiniband/hw/hns/hns_roce_main.c | 36 ++-
drivers/infiniband/hw/hns/hns_roce_mr.c | 3 +
drivers/infiniband/hw/hns/hns_roce_pd.c | 22 +-
drivers/infiniband/hw/hns/hns_roce_qp.c | 67 ++---
drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c | 11 +-
drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c | 13 +-
drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.h | 2 +
drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c | 10 -
drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.h | 1 -
drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c | 16 ++
drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h | 4 +
drivers/net/ethernet/hisilicon/hns/hns_enet.c | 107 +++++---
drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 7 +
22 files changed, 505 insertions(+), 369 deletions(-)
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG Key ID: 0E572FDD
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]
^ permalink raw reply
* [PATCH rdma-core 4/4] glue/redhat/spec: build split rpm packages
From: Jarod Wilson @ 2016-10-14 19:21 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Jarod Wilson
In-Reply-To: <20161014192136.11731-1-jarod-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
We're thinking that the upgrade path for our users will be simpler and
less surprising if we take rdma-core and split out the end result into the
same packages we currently ship in our distributions. End result with this
spec:
Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/rdma-core-11-1.el7.x86_64.rpm
Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/rdma-core-devel-11-1.el7.x86_64.rpm
Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/libibverbs-11-1.el7.x86_64.rpm
Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/libibverbs-utils-11-1.el7.x86_64.rpm
Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/ibacm-11-1.el7.x86_64.rpm
Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/iwpmd-11-1.el7.x86_64.rpm
Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/libibcm-11-1.el7.x86_64.rpm
Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/libibumad-11-1.el7.x86_64.rpm
Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/librdmacm-11-1.el7.x86_64.rpm
Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/librdmacm-utils-11-1.el7.x86_64.rpm
Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/srp_daemon-11-1.el7.x86_64.rpm
Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/libcxgb3-11-1.el7.x86_64.rpm
Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/libcxgb4-11-1.el7.x86_64.rpm
Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/libhfi1-11-1.el7.x86_64.rpm
Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/libi40iw-11-1.el7.x86_64.rpm
Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/libipathverbs-11-1.el7.x86_64.rpm
Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/libmlx4-11-1.el7.x86_64.rpm
Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/libmlx5-11-1.el7.x86_64.rpm
Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/libmthca-11-1.el7.x86_64.rpm
Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/libnes-11-1.el7.x86_64.rpm
Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/libocrdma-11-1.el7.x86_64.rpm
Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/librxe-11-1.el7.x86_64.rpm
Wrote: /home/jwilson/rpmbuild/RPMS/x86_64/rdma-core-debuginfo-11-1.el7.x86_64.rpm
Signed-off-by: Jarod Wilson <jarod-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
glue/redhat/rdma-core.spec | 477 +++++++++++++++++++++++++++++++++++++++++----
1 file changed, 442 insertions(+), 35 deletions(-)
diff --git a/glue/redhat/rdma-core.spec b/glue/redhat/rdma-core.spec
index 609b910..177d78b 100644
--- a/glue/redhat/rdma-core.spec
+++ b/glue/redhat/rdma-core.spec
@@ -7,10 +7,11 @@ Summary: RDMA core userspace libraries and daemons
# providers/ipathverbs/ Dual licensed using a BSD license with an extra patent clause
# providers/rxe/ Incorporates code from ipathverbs and contains the patent clause
# providers/hfi1verbs Uses the 3 Clause BSD license
-License: (GPLv2 or BSD) and (GPLv2 or PathScale-BSD)
+License: GPLv2 or BSD
Url: http://openfabrics.org/
Source: rdma-core-%{version}.tgz
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+# https://github.com/linux-rdma/rdma-core
+BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: binutils
BuildRequires: cmake >= 2.8.11
@@ -19,20 +20,15 @@ BuildRequires: pkgconfig
BuildRequires: pkgconfig(libnl-3.0)
BuildRequires: pkgconfig(libnl-route-3.0)
BuildRequires: valgrind-devel
+BuildRequires: libnl3-devel
+
+# Red Hat/Fedora previously shipped glue/redhat/ as a stand-alone
+# package called 'rdma', which we're supplanting here.
+Provides: rdma = %{version}-%{release}
+Obsoletes: rdma < %{version}-%{release}
# Since we recommend developers use Ninja, so should packagers, for consistency.
%define CMAKE_FLAGS %{nil}
-%if 0%{?suse_version}
-# SuSE releases have it, and sometime around cmake 3.3.2-1.2 the macros learned to use it.
-BuildRequires: ninja,make
-%define __builder ninja
-# cmake_install,make_jobs is specified by opensuse
-
-# Tumbleweed's cmake RPM macro adds -Wl,--no-undefined to the module flags
-# which is totally inappropriate and breaks building 'ENABLE_EXPORTS' style
-# module libraries (eg ibacmp).
-%define CMAKE_FLAGS -DCMAKE_MODULE_LINKER_FLAGS=""
-%else
%if 0%{?fedora} >= 23
# Ninja was introduced in FC23
BuildRequires: ninja-build
@@ -45,12 +41,225 @@ BuildRequires: make
%define make_jobs make -v %{?_smp_mflags}
%define cmake_install DESTDIR=%{buildroot} make install
%endif
+
+%define systemd_dep systemd-units
+%if 0%{?fedora} >= 18
+%define systemd_dep systemd
%endif
%description
-Temporary packaging
+RDMA core userspace infrastructure and documentation.
+
+%package devel
+Summary: RDMA core development libraries and headers
+Provides: libibcm-devel = %{version}-%{release}
+Provides: libibumad-devel = %{version}-%{release}
+Provides: libibverbs-devel = %{version}-%{release}
+Provides: librdmacm-devel = %{version}-%{release}
+
+%description devel
+RDMA core development libraries and headers.
+
+%package -n libibverbs
+Summary: A library for direct userspace use of RDMA (InfiniBand/iWARP) hardware
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+Requires: rdma-core
+
+%description -n libibverbs
+libibverbs is a library that allows userspace processes to use RDMA
+"verbs" as described in the InfiniBand Architecture Specification and
+the RDMA Protocol Verbs Specification. This includes direct hardware
+access from userspace to InfiniBand/iWARP adapters (kernel bypass) for
+fast path operations.
+
+For this library to be useful, a device-specific plug-in module should
+also be installed.
+
+%package -n libibverbs-utils
+Summary: Examples for the libibverbs library
+Requires: libibverbs%{?_isa} = %{version}-%{release}
+Requires: libibverbs-driver.%{_arch}
+
+%description -n libibverbs-utils
+Useful libibverbs example programs such as ibv_devinfo, which
+displays information about RDMA devices.
+
+%package -n ibacm
+Summary: InfiniBand Communication Manager Assistant
+Requires(post): %{systemd_dep}
+Requires(preun): %{systemd_dep}
+Requires(postun): %{systemd_dep}
+Requires: rdma-core
+
+%description -n ibacm
+The ibacm daemon helps reduce the load of managing path record lookups on
+large InfiniBand fabrics by providing a user space implementation of what
+is functionally similar to an ARP cache. The use of ibacm, when properly
+configured, can reduce the SA packet load of a large IB cluster from O(n^2)
+to O(n). The ibacm daemon is started and normally runs in the background,
+user applications need not know about this daemon as long as their app
+uses librdmacm to handle connection bring up/tear down. The librdmacm
+library knows how to talk directly to the ibacm daemon to retrieve data.
+
+%package -n iwpmd
+Summary: iWarp Port Mapper userspace daemon
+Requires(post): %{systemd_dep}
+Requires(preun): %{systemd_dep}
+Requires(postun): %{systemd_dep}
+Requires: rdma-core
+
+%description -n iwpmd
+iwpmd provides a userspace service for iWarp drivers to claim
+tcp ports through the standard socket interface.
+
+%package -n libibcm
+Summary: Userspace InfiniBand Connection Manager
+ExcludeArch: s390 s390x
+Requires: rdma-core
+
+%description -n libibcm
+libibcm provides a userspace library that handles the majority of the low
+level work required to open an RDMA connection between two machines.
+
+%package -n libibumad
+Summary: OpenFabrics Alliance InfiniBand umad (userspace management datagram) library
+Requires: rdma-core
+
+%description -n libibumad
+libibumad provides the userspace management datagram (umad) library
+functions, which sit on top of the umad modules in the kernel. These
+are used by the IB diagnostic and management tools, including OpenSM.
+
+%package -n librdmacm
+Summary: Userspace RDMA Connection Manager
+Requires: rdma-core
+
+%description -n librdmacm
+librdmacm provides a userspace RDMA Communication Managment API.
+
+%package -n librdmacm-utils
+Summary: Examples for the librdmacm library
+Requires: librdmacm%{?_isa} = %{version}-%{release}
+
+%description -n librdmacm-utils
+Example test programs for the librdmacm library.
+
+%package -n srp_daemon
+Summary: Tools for using the InfiniBand SRP protocol devices
+Obsoletes: srptools <= 1.0.3
+Provides: srptools = %{version}-%{release}
+Obsoletes: openib-srptools <= 0.0.6
+Requires(post): %{systemd_dep}
+Requires(preun): %{systemd_dep}
+Requires(postun): %{systemd_dep}
+Requires: rdma-core
+
+%description -n srp_daemon
+In conjunction with the kernel ib_srp driver, srptools allows you to
+discover and use SCSI devices via the SCSI RDMA Protocol over InfiniBand.
+
+%package -n libcxgb3
+Summary: Chelsio T3 iWARP HCA Userspace Driver
+Provides: libibverbs-driver.%{_arch}
+
+%description -n libcxgb3
+Userspace hardware driver for use with the libibverbs InfiniBand/iWARP verbs
+library. This driver enables Chelsio iWARP capable ethernet devices.
+
+%package -n libcxgb4
+Summary: Chelsio T4 iWARP HCA Userspace Driver
+Provides: libibverbs-driver.%{_arch}
+
+%description -n libcxgb4
+Userspace hardware driver for use with the libibverbs InfiniBand/iWARP verbs
+library. This driver enables Chelsio T4 based iWARP capable Ethernet devices.
+
+%package -n libhfi1
+Summary: Intel Omni-Path HFI Userspace Driver
+Provides: libibverbs-driver.%{_arch}
+
+%description -n libhfi1
+libhfi1 provides a device-specific userspace driver for Intel Host
+Fabric interface cards. This driver is designed for use with the
+libibverbs library.
+
+%package -n libi40iw
+Summary: Intel Ethernet Connection X722 RDMA Userspace Library
+Provides: libibverbs-driver.%{_arch}
+
+%description -n libi40iw
+libi40iw provides a device-specific RDMA userspace library for Intel
+Ethernet Connection X722 for use with the libibverbs library.
+
+%package -n libipathverbs
+Summary: QLogic InfiniPath HCA Userspace Driver
+Provides: libibverbs-driver.%{_arch}
+
+%description -n libipathverbs
+QLogic hardware driver for use with libibverbs user space verbs access
+library. This driver supports QLogic InfiniPath based cards.
+
+%package -n libmlx4
+Summary: Mellanox ConnectX-3 InfiniBand HCA Userspace Driver
+Provides: libibverbs-driver.%{_arch}
+
+%description -n libmlx4
+libmlx4 provides a device-specific userspace driver for Mellanox
+ConnectX-3 HCAs for use with the libibverbs library.
+
+%package -n libmlx5
+Summary: Mellanox Connect-IB/X-4+ InfiniBand HCA Userspace Driver
+Provides: libibverbs-driver.%{_arch}
+
+%description -n libmlx5
+bmlx5 provides a device-specific userspace driver for Mellanox
+Connect-IB/X-4+ HCAs for use with the libibverbs library.
+
+%package -n libmthca
+Summary: Mellanox InfiniBand HCA Userspace Driver
+Provides: libibverbs-driver.%{_arch}
+
+%description -n libmthca
+libmthca provides a device-specific userspace driver for Mellanox HCAs
+(MT23108 InfiniHost and MT25208 InfiniHost III Ex) for use with the
+libibverbs library.
-This is a simple example without the split sub packages to get things started.
+%package -n libnes
+Summary: NetEffect RNIC Userspace Driver
+Provides: libibverbs-driver.%{_arch}
+
+%description -n libnes
+Userspace hardware driver for use with the libibverbs InfiniBand/iWARP verbs
+library. This driver enables NetEffect iWARP capable ethernet devices.
+
+%package -n libocrdma
+Summary: Userspace Library for Emulex OneConnect RDMA/RoCE Device
+Provides: libibverbs-driver.%{_arch}
+
+%description -n libocrdma
+libocrdma provides a device-specific userspace driver for Emulex OneConnect
+RDMA/RoCE Adapters for use with the libibverbs library.
+
+%package -n librxe
+Summary: A software implementation of the RoCE protocol
+Provides: libibverbs-driver.%{_arch}
+
+%description -n librxe
+This is a software implementation of the RoCE protocol, which transports the
+full OFED RDMA protocol set (kernel and user mode) over layer 2 Ethernet.
+Infiniband (IB) transport and GRH headers are encapsulated in Ethernet packets
+of ether type 0x8915.
+
+Once a RXE instance has been created, communicating via RXE is the same as
+communicating via any OFED compatible Infiniband HCA, albeit in some cases with
+addressing implications.
+
+In particular, while the use of a GRH header is optional within IB subnets, it
+is mandatory with RoCE. Verbs applications written over IB verbs should work
+seamlessly, but they require provisioning of GRH information when creating address
+vectors. The library and driver are modified to provide for mapping from GID to
+MAC addresses required by the hardware.
%prep
%setup
@@ -91,8 +300,55 @@ This is a simple example without the split sub packages to get things started.
%install
%cmake_install
+mkdir -p %{buildroot}/%{_sysconfdir}/rdma
mkdir -p %{buildroot}/%{_docdir}/%{name}-%{version}
-install -m0644 Documentation/{ibacm,ibsrpdm,libibcm,libibverbs,librdmacm,rxe}.md %{buildroot}/%{_docdir}/%{name}-%{version}/
+install -D -m0644 Documentation/{ibacm,ibsrpdm,libibcm,libibverbs,librdmacm,rxe}.md %{buildroot}/%{_docdir}/%{name}-%{version}/
+install -D -m0644 README.md %{buildroot}/%{_docdir}/%{name}-%{version}/
+
+# Red Hat specific glue
+%global dracutlibdir %{_prefix}/lib/dracut
+%global sysmodprobedir %{_prefix}/lib/modprobe.d
+mkdir -p %{buildroot}/%{_sysconfdir}/sysconfig/network-scripts
+mkdir -p %{buildroot}%{_sysconfdir}/udev/rules.d
+mkdir -p %{buildroot}%{_libexecdir}
+mkdir -p %{buildroot}%{_udevrulesdir}
+mkdir -p %{buildroot}%{dracutlibdir}/modules.d/05rdma
+mkdir -p %{buildroot}%{sysmodprobedir}
+install -D -m0644 glue/redhat/rdma.conf %{buildroot}/%{_sysconfdir}/rdma/rdma.conf
+install -D -m0644 glue/redhat/rdma.sriov-vfs %{buildroot}/%{_sysconfdir}/rdma/sriov-vfs
+install -D -m0644 glue/redhat/rdma.mlx4.conf %{buildroot}/%{_sysconfdir}/rdma/mlx4.conf
+install -D -m0755 glue/redhat/rdma.ifup-ib %{buildroot}/%{_sysconfdir}/sysconfig/network-scripts/ifup-ib
+install -D -m0755 glue/redhat/rdma.ifdown-ib %{buildroot}/%{_sysconfdir}/sysconfig/network-scripts/ifdown-ib
+install -D -m0644 glue/redhat/rdma.service %{buildroot}%{_unitdir}/rdma.service
+install -D -m0644 glue/redhat/rdma.udev-ipoib-naming.rules %{buildroot}%{_sysconfdir}/udev/rules.d/70-persistent-ipoib.rules
+install -D -m0644 glue/redhat/rdma.mlx4.user.modprobe %{buildroot}%{_sysconfdir}/modprobe.d/mlx4.conf
+install -D -m0755 glue/redhat/rdma.modules-setup.sh %{buildroot}%{dracutlibdir}/modules.d/05rdma/module-setup.sh
+install -D -m0644 glue/redhat/rdma.udev-rules %{buildroot}%{_udevrulesdir}/98-rdma.rules
+install -D -m0644 glue/redhat/rdma.mlx4.sys.modprobe %{buildroot}%{sysmodprobedir}/libmlx4.conf
+install -D -m0644 glue/redhat/rdma.cxgb3.sys.modprobe %{buildroot}%{sysmodprobedir}/cxgb3.conf
+install -D -m0644 glue/redhat/rdma.cxgb4.sys.modprobe %{buildroot}%{sysmodprobedir}/cxgb4.conf
+install -D -m0755 glue/redhat/rdma.kernel-init %{buildroot}%{_libexecdir}/rdma-init-kernel
+install -D -m0755 glue/redhat/rdma.sriov-init %{buildroot}%{_libexecdir}/rdma-set-sriov-vf
+install -D -m0644 glue/redhat/rdma.fixup-mtrr.awk %{buildroot}%{_libexecdir}/rdma-fixup-mtrr.awk
+install -D -m0755 glue/redhat/rdma.mlx4-setup.sh %{buildroot}%{_libexecdir}/mlx4-setup.sh
+
+# ibacm
+%{buildroot}/%{_bindir}/ib_acme -D . -O
+# Fixup a multilib conflict in ibacm_opts.cfg:
+sed -i -e '/^# Specifies the directory of the provider libraries$/ a\
+# Use /usr/lib64/ibacm on 64bit, /usr/lib/libacm on 32bit.
+' -e 's%^\(# provider_lib_path /usr/\)lib\(64\)\?/ibacm$%\1lib64/ibacm%' ibacm_opts.cfg
+install -D -m0644 ibacm_opts.cfg %{buildroot}%{_sysconfdir}/rdma/
+install -D -m0644 glue/redhat/ibacm.service %{buildroot}%{_unitdir}/
+install -D -m0644 ibacm/man/*.1 %{buildroot}/%{_mandir}/man1/
+install -D -m0644 ibacm/man/*.7 %{buildroot}/%{_mandir}/man7/
+sed -e 's|@ACM_PROVIDER_DIR@|%{libdir}/%{name}/|g' -e 's|@CMAKE_INSTALL_FULL_LOCALSTATEDIR@|%{_localstatedir}|g' ibacm/man/ibacm_prov.7.in > %{buildroot}/%{_mandir}/man7/ibacm_prov.7
+
+# iwpmd
+install -D -m0644 glue/redhat/iwpmd.service %{buildroot}%{_unitdir}/
+
+# srp_daemon
+install -D -m0644 glue/redhat/srp_daemon.service %{buildroot}%{_unitdir}/
%if 0%{?_unitdir:1}
rm -rf %{buildroot}/%{_initrddir}/
@@ -103,25 +359,176 @@ rm -rf %{buildroot}/%{my_unitdir}/
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
+%post -n ibacm
+%systemd_post ibacm.service
+
+%preun -n ibacm
+%systemd_preun ibacm.service
+
+%postun -n ibacm
+%systemd_postun_with_restart ibacm.service
+
+%post -n libibcm -p /sbin/ldconfig
+%postun -n libibcm -p /sbin/ldconfig
+
%files
-%doc %{_mandir}/man*/*
-%{_bindir}/*
+%dir %{_sysconfdir}/rdma
+%doc %{_docdir}/%{name}-%{version}/README.md
+%config(noreplace) %{_sysconfdir}/rdma/*
+%config(noreplace) %{_sysconfdir}/udev/rules.d/*
+%config(noreplace) %{_sysconfdir}/modprobe.d/mlx4.conf
+%{_sysconfdir}/sysconfig/network-scripts/*
+%{_unitdir}/rdma.service
+%dir %{dracutlibdir}/modules.d/05rdma
+%{dracutlibdir}/modules.d/05rdma/module-setup.sh
+%{_udevrulesdir}/*
+%{sysmodprobedir}/libmlx4.conf
+%{sysmodprobedir}/cxgb3.conf
+%{sysmodprobedir}/cxgb4.conf
+%{_libexecdir}/rdma-init-kernel
+%{_libexecdir}/rdma-set-sriov-vf
+%{_libexecdir}/rdma-fixup-mtrr.awk
+%{_libexecdir}/mlx4-setup.sh
+%license COPYING.*
+
+%files devel
%{_includedir}/*
-%{_libdir}/lib*.so*
-%{_libdir}/libibverbs/*
+%{_libdir}/lib*.so
+%{_libdir}/rsocket/*.so
+%{_mandir}/man3/ibv_*
+%{_mandir}/man3/rdma*
+%{_mandir}/man3/umad*
+%{_mandir}/man3/*_to_ibv_rate.*
+%{_mandir}/man7/rdma_cm.*
+%{_mandir}/man7/rsocket.*
+
+%files -n libibverbs
+%dir %{_sysconfdir}/libibverbs.d
+%{_libdir}/libibverbs*.so.*
+%dir %{_libdir}/libibverbs
+%doc %{_docdir}/%{name}-%{version}/libibverbs.md
+
+%files -n libibverbs-utils
+%{_bindir}/ibv_*
+%{_mandir}/man1/ibv_*
+
+%files -n ibacm
+%config(noreplace) %{_sysconfdir}/rdma/ibacm_opts.cfg
+%{_bindir}/ib_acme
+%{_sbindir}/ibacm
+%{_mandir}/man1/ibacm.*
+%{_mandir}/man1/ib_acme.*
+%{_mandir}/man7/ibacm.*
+%{_mandir}/man7/ibacm_prov.*
+%{_unitdir}/ibacm.service
+%dir %{_libdir}/ibacm
%{_libdir}/ibacm/*
-%{_libdir}/rsocket/*
-%{_sbindir}/*
-%{_libexecdir}/*
-%{_docdir}/%{name}-%{version}/*
-%if 0%{?_unitdir:1}
-%{_unitdir}/*
-%else
-%config %{_initrddir}/*
-%endif
-%config %{_sysconfdir}/iwpmd.conf
-%config %{_sysconfdir}/srp_daemon.conf
-%config %{_sysconfdir}/libibverbs.d/*
-%config %{_sysconfdir}/logrotate.d/srp_daemon
-%{_sysconfdir}/modprobe.d/*
-%config %{_sysconfdir}/rsyslog.d/srp_daemon.conf
+%doc %{_docdir}/%{name}-%{version}/ibacm.md
+
+%files -n iwpmd
+%{_bindir}/iwpmd
+%{_unitdir}/iwpmd.service
+%config(noreplace) %{_sysconfdir}/iwpmd.conf
+%{_mandir}/man1/iwpmd.*
+%{_mandir}/man5/iwpmd.*
+
+%files -n libibcm
+%{_libdir}/libibcm*.so.*
+%doc %{_docdir}/%{name}-%{version}/libibcm.md
+
+%files -n libibumad
+%{_libdir}/libibumad*.so.*
+
+%files -n librdmacm
+%{_libdir}/librdmacm*.so.*
+%{_libdir}/rsocket/*.so.*
+%doc %{_docdir}/%{name}-%{version}/librdmacm.md
+
+%files -n librdmacm-utils
+%{_bindir}/cmtime
+%{_bindir}/mckey
+%{_bindir}/rcopy
+%{_bindir}/rdma_client
+%{_bindir}/rdma_server
+%{_bindir}/rdma_xclient
+%{_bindir}/rdma_xserver
+%{_bindir}/riostream
+%{_bindir}/rping
+%{_bindir}/rstream
+%{_bindir}/ucmatose
+%{_bindir}/udaddy
+%{_bindir}/udpong
+%{_mandir}/man1/mckey.*
+%{_mandir}/man1/rcopy.*
+%{_mandir}/man1/rdma_client.*
+%{_mandir}/man1/rdma_server.*
+%{_mandir}/man1/rdma_xclient.*
+%{_mandir}/man1/rdma_xserver.*
+%{_mandir}/man1/riostream.*
+%{_mandir}/man1/rping.*
+%{_mandir}/man1/rstream.*
+%{_mandir}/man1/ucmatose.*
+%{_mandir}/man1/udaddy.*
+
+%files -n srp_daemon
+%config(noreplace) %{_sysconfdir}/srp_daemon.conf
+%config(noreplace) %{_sysconfdir}/logrotate.d/srp_daemon
+%config(noreplace) %{_sysconfdir}/rsyslog.d/srp_daemon.conf
+%{_unitdir}/srp_daemon.service
+%{_sbindir}/ibsrpdm
+%{_sbindir}/srp_daemon
+%{_sbindir}/srp_daemon.sh
+%{_sbindir}/run_srp_daemon
+%{_mandir}/man1/ibsrpdm.1*
+%{_mandir}/man1/srp_daemon.1*
+%doc %{_docdir}/%{name}-%{version}/ibsrpdm.md
+
+%files -n libcxgb3
+%{_libdir}/libibverbs/libcxgb3-rdmav2.so
+%config(noreplace) %{_sysconfdir}/libibverbs.d/cxgb3.driver
+
+%files -n libcxgb4
+%{_libdir}/libibverbs/libcxgb4-rdmav2.so
+%config(noreplace) %{_sysconfdir}/libibverbs.d/cxgb4.driver
+
+%files -n libhfi1
+%{_libdir}/libibverbs/libhfi1verbs-rdmav2.so
+%config(noreplace) %{_sysconfdir}/libibverbs.d/hfi1verbs.driver
+
+%files -n libi40iw
+%{_libdir}/libibverbs/libi40iw-rdmav2.so
+%config(noreplace) %{_sysconfdir}/libibverbs.d/i40iw.driver
+
+%files -n libipathverbs
+%{_libdir}/libibverbs/libipathverbs-rdmav2.so
+%config(noreplace) %{_sysconfdir}/libibverbs.d/ipathverbs.driver
+%config(noreplace) %{_sysconfdir}/modprobe.d/truescale.conf
+%{_libexecdir}/truescale-serdes.cmds
+
+%files -n libmlx4
+%{_libdir}/libibverbs/libmlx4-rdmav2.so
+%config(noreplace) %{_sysconfdir}/libibverbs.d/mlx4.driver
+
+%files -n libmlx5
+%{_libdir}/libibverbs/libmlx5-rdmav2.so
+%config(noreplace) %{_sysconfdir}/libibverbs.d/mlx5.driver
+
+%files -n libmthca
+%{_libdir}/libibverbs/libmthca-rdmav2.so
+%config(noreplace) %{_sysconfdir}/libibverbs.d/mthca.driver
+
+%files -n libnes
+%{_libdir}/libibverbs/libnes-rdmav2.so
+%config(noreplace) %{_sysconfdir}/libibverbs.d/nes.driver
+
+%files -n libocrdma
+%{_libdir}/libibverbs/libocrdma-rdmav2.so
+%config(noreplace) %{_sysconfdir}/libibverbs.d/ocrdma.driver
+
+%files -n librxe
+%{_bindir}/rxe_cfg
+%{_mandir}/man7/rxe*
+%{_mandir}/man8/rxe*
+%{_libdir}/libibverbs/librxe-rdmav2.so
+%config(noreplace) %{_sysconfdir}/libibverbs.d/rxe.driver
+%doc %{_docdir}/%{name}-%{version}/rxe.md
--
2.10.0
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH rdma-core 3/4] glue/redhat: copy stock spec for RH customization
From: Jarod Wilson @ 2016-10-14 19:21 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Jarod Wilson
In-Reply-To: <20161014192136.11731-1-jarod-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
We're going to need to do a bit of majorly invasive surgery, and we're not
sure everyone else is going to want to package things this way, so we'll
make a copy of our own spec here, starting from the one in the tree.
Signed-off-by: Jarod Wilson <jarod-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
glue/redhat/rdma-core.spec | 127 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 127 insertions(+)
create mode 100644 glue/redhat/rdma-core.spec
diff --git a/glue/redhat/rdma-core.spec b/glue/redhat/rdma-core.spec
new file mode 100644
index 0000000..609b910
--- /dev/null
+++ b/glue/redhat/rdma-core.spec
@@ -0,0 +1,127 @@
+Name: rdma-core
+Version: 11
+Release: 1%{?dist}
+Summary: RDMA core userspace libraries and daemons
+
+# Almost everything is licensed under the OFA dual GPLv2, 2 Clause BSD license
+# providers/ipathverbs/ Dual licensed using a BSD license with an extra patent clause
+# providers/rxe/ Incorporates code from ipathverbs and contains the patent clause
+# providers/hfi1verbs Uses the 3 Clause BSD license
+License: (GPLv2 or BSD) and (GPLv2 or PathScale-BSD)
+Url: http://openfabrics.org/
+Source: rdma-core-%{version}.tgz
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+
+BuildRequires: binutils
+BuildRequires: cmake >= 2.8.11
+BuildRequires: gcc
+BuildRequires: pkgconfig
+BuildRequires: pkgconfig(libnl-3.0)
+BuildRequires: pkgconfig(libnl-route-3.0)
+BuildRequires: valgrind-devel
+
+# Since we recommend developers use Ninja, so should packagers, for consistency.
+%define CMAKE_FLAGS %{nil}
+%if 0%{?suse_version}
+# SuSE releases have it, and sometime around cmake 3.3.2-1.2 the macros learned to use it.
+BuildRequires: ninja,make
+%define __builder ninja
+# cmake_install,make_jobs is specified by opensuse
+
+# Tumbleweed's cmake RPM macro adds -Wl,--no-undefined to the module flags
+# which is totally inappropriate and breaks building 'ENABLE_EXPORTS' style
+# module libraries (eg ibacmp).
+%define CMAKE_FLAGS -DCMAKE_MODULE_LINKER_FLAGS=""
+%else
+%if 0%{?fedora} >= 23
+# Ninja was introduced in FC23
+BuildRequires: ninja-build
+%define CMAKE_FLAGS -GNinja
+%define make_jobs ninja -v %{?_smp_mflags}
+%define cmake_install DESTDIR=%{buildroot} ninja-build install
+%else
+# Fallback to make otherwise
+BuildRequires: make
+%define make_jobs make -v %{?_smp_mflags}
+%define cmake_install DESTDIR=%{buildroot} make install
+%endif
+%endif
+
+%description
+Temporary packaging
+
+This is a simple example without the split sub packages to get things started.
+
+%prep
+%setup
+
+%build
+
+# Detect if systemd is supported on this system
+%if 0%{?_unitdir:1}
+%define my_unitdir %{_unitdir}
+%else
+%define my_unitdir /tmp/
+%endif
+
+# New RPM defines _rundir, usually as /run
+%if 0%{?_rundir:1}
+%else
+%define _rundir /var/run
+%endif
+
+# Pass all of the rpm paths directly to GNUInstallDirs and our other defines.
+%cmake %{CMAKE_FLAGS} \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_BINDIR:PATH=%{_bindir} \
+ -DCMAKE_INSTALL_SBINDIR:PATH=%{_sbindir} \
+ -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} \
+ -DCMAKE_INSTALL_LIBEXECDIR:PATH=%{_libexecdir} \
+ -DCMAKE_INSTALL_LOCALSTATEDIR:PATH=%{_localstatedir} \
+ -DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=%{_sharedstatedir} \
+ -DCMAKE_INSTALL_INCLUDEDIR:PATH=%{_includedir} \
+ -DCMAKE_INSTALL_INFODIR:PATH=%{_infodir} \
+ -DCMAKE_INSTALL_MANDIR:PATH=%{_mandir} \
+ -DCMAKE_INSTALL_SYSCONFDIR:PATH=%{_sysconfdir} \
+ -DCMAKE_INSTALL_SYSTEMD_SERVICEDIR:PATH=%{my_unitdir} \
+ -DCMAKE_INSTALL_INITDDIR:PATH=%{_initrddir} \
+ -DCMAKE_INSTALL_RUNDIR:PATH=%{_rundir}
+%make_jobs
+
+%install
+%cmake_install
+
+mkdir -p %{buildroot}/%{_docdir}/%{name}-%{version}
+install -m0644 Documentation/{ibacm,ibsrpdm,libibcm,libibverbs,librdmacm,rxe}.md %{buildroot}/%{_docdir}/%{name}-%{version}/
+
+%if 0%{?_unitdir:1}
+rm -rf %{buildroot}/%{_initrddir}/
+%else
+rm -rf %{buildroot}/%{my_unitdir}/
+%endif
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%files
+%doc %{_mandir}/man*/*
+%{_bindir}/*
+%{_includedir}/*
+%{_libdir}/lib*.so*
+%{_libdir}/libibverbs/*
+%{_libdir}/ibacm/*
+%{_libdir}/rsocket/*
+%{_sbindir}/*
+%{_libexecdir}/*
+%{_docdir}/%{name}-%{version}/*
+%if 0%{?_unitdir:1}
+%{_unitdir}/*
+%else
+%config %{_initrddir}/*
+%endif
+%config %{_sysconfdir}/iwpmd.conf
+%config %{_sysconfdir}/srp_daemon.conf
+%config %{_sysconfdir}/libibverbs.d/*
+%config %{_sysconfdir}/logrotate.d/srp_daemon
+%{_sysconfdir}/modprobe.d/*
+%config %{_sysconfdir}/rsyslog.d/srp_daemon.conf
--
2.10.0
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH rdma-core 2/4] glue/redhat: add udev/systemd/etc infrastructure bits
From: Jarod Wilson @ 2016-10-14 19:21 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Jarod Wilson, Doug Ledford
In-Reply-To: <20161014192136.11731-1-jarod-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Red Hat has been shipping an "rdma" package, as well as it's own systemd
unit files for some daemons for a while now, in both Fedora and Red Hat
Enterprise Linux. Some of these are fairly RH-specific, but might be of
use to others, so we'd like to move them into the upstream source tree.
Most of these were authored by Doug Ledford, though I'm currently the one
that maintains (most of) them in RHEL.
CC: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Jarod Wilson <jarod-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
glue/redhat/ibacm.service | 12 ++
glue/redhat/iwpmd.service | 12 ++
glue/redhat/rdma.conf | 25 +++
glue/redhat/rdma.cxgb3.sys.modprobe | 1 +
glue/redhat/rdma.cxgb4.sys.modprobe | 1 +
glue/redhat/rdma.fixup-mtrr.awk | 160 ++++++++++++++++
glue/redhat/rdma.ifdown-ib | 183 ++++++++++++++++++
glue/redhat/rdma.ifup-ib | 308 +++++++++++++++++++++++++++++++
glue/redhat/rdma.kernel-init | 262 ++++++++++++++++++++++++++
glue/redhat/rdma.mlx4-setup.sh | 91 +++++++++
glue/redhat/rdma.mlx4.conf | 27 +++
glue/redhat/rdma.mlx4.sys.modprobe | 5 +
glue/redhat/rdma.mlx4.user.modprobe | 21 +++
glue/redhat/rdma.modules-setup.sh | 30 +++
glue/redhat/rdma.service | 15 ++
glue/redhat/rdma.sriov-init | 137 ++++++++++++++
glue/redhat/rdma.sriov-vfs | 41 ++++
glue/redhat/rdma.udev-ipoib-naming.rules | 13 ++
glue/redhat/rdma.udev-rules | 18 ++
glue/redhat/srp_daemon.service | 17 ++
20 files changed, 1379 insertions(+)
create mode 100644 glue/redhat/ibacm.service
create mode 100644 glue/redhat/iwpmd.service
create mode 100644 glue/redhat/rdma.conf
create mode 100644 glue/redhat/rdma.cxgb3.sys.modprobe
create mode 100644 glue/redhat/rdma.cxgb4.sys.modprobe
create mode 100644 glue/redhat/rdma.fixup-mtrr.awk
create mode 100644 glue/redhat/rdma.ifdown-ib
create mode 100644 glue/redhat/rdma.ifup-ib
create mode 100644 glue/redhat/rdma.kernel-init
create mode 100644 glue/redhat/rdma.mlx4-setup.sh
create mode 100644 glue/redhat/rdma.mlx4.conf
create mode 100644 glue/redhat/rdma.mlx4.sys.modprobe
create mode 100644 glue/redhat/rdma.mlx4.user.modprobe
create mode 100644 glue/redhat/rdma.modules-setup.sh
create mode 100644 glue/redhat/rdma.service
create mode 100644 glue/redhat/rdma.sriov-init
create mode 100644 glue/redhat/rdma.sriov-vfs
create mode 100644 glue/redhat/rdma.udev-ipoib-naming.rules
create mode 100644 glue/redhat/rdma.udev-rules
create mode 100644 glue/redhat/srp_daemon.service
diff --git a/glue/redhat/ibacm.service b/glue/redhat/ibacm.service
new file mode 100644
index 0000000..1cd031a
--- /dev/null
+++ b/glue/redhat/ibacm.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Starts the InfiniBand Address Cache Manager daemon
+Documentation=man:ibacm
+Requires=rdma.service
+After=rdma.service opensm.service
+
+[Service]
+Type=forking
+ExecStart=/usr/sbin/ibacm
+
+[Install]
+WantedBy=network.target
diff --git a/glue/redhat/iwpmd.service b/glue/redhat/iwpmd.service
new file mode 100644
index 0000000..ff19acd
--- /dev/null
+++ b/glue/redhat/iwpmd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Starts the IWPMD daemon
+Documentation=file:///usr/share/doc/iwpmd/README
+After=network.target syslog.target
+
+[Service]
+Type=simple
+LimitNOFILE=102400
+ExecStart=/usr/bin/iwpmd
+
+[Install]
+WantedBy=multi-user.target
diff --git a/glue/redhat/rdma.conf b/glue/redhat/rdma.conf
new file mode 100644
index 0000000..9446564
--- /dev/null
+++ b/glue/redhat/rdma.conf
@@ -0,0 +1,25 @@
+# Load IPoIB
+IPOIB_LOAD=yes
+# Load SRP (SCSI Remote Protocol initiator support) module
+SRP_LOAD=yes
+# Load SRPT (SCSI Remote Protocol target support) module
+SRPT_LOAD=yes
+# Load iSER (iSCSI over RDMA initiator support) module
+ISER_LOAD=yes
+# Load iSERT (iSCSI over RDMA target support) module
+ISERT_LOAD=yes
+# Load RDS (Reliable Datagram Service) network protocol
+RDS_LOAD=no
+# Load NFSoRDMA client transport module
+XPRTRDMA_LOAD=yes
+# Load NFSoRDMA server transport module
+SVCRDMA_LOAD=no
+# Load Tech Preview device driver modules
+TECH_PREVIEW_LOAD=no
+# Should we modify the system mtrr registers? We may need to do this if you
+# get messages from the ib_ipath driver saying that it couldn't enable
+# write combining for the PIO buffs on the card.
+#
+# Note: recent kernels should do this for us, but in case they don't, we'll
+# leave this option
+FIXUP_MTRR_REGS=no
diff --git a/glue/redhat/rdma.cxgb3.sys.modprobe b/glue/redhat/rdma.cxgb3.sys.modprobe
new file mode 100644
index 0000000..d5925a7
--- /dev/null
+++ b/glue/redhat/rdma.cxgb3.sys.modprobe
@@ -0,0 +1 @@
+install cxgb3 /sbin/modprobe --ignore-install cxgb3 $CMDLINE_OPTS && /sbin/modprobe iw_cxgb3
diff --git a/glue/redhat/rdma.cxgb4.sys.modprobe b/glue/redhat/rdma.cxgb4.sys.modprobe
new file mode 100644
index 0000000..44163ab
--- /dev/null
+++ b/glue/redhat/rdma.cxgb4.sys.modprobe
@@ -0,0 +1 @@
+install cxgb4 /sbin/modprobe --ignore-install cxgb4 $CMDLINE_OPTS && /sbin/modprobe iw_cxgb4
diff --git a/glue/redhat/rdma.fixup-mtrr.awk b/glue/redhat/rdma.fixup-mtrr.awk
new file mode 100644
index 0000000..a57ca76
--- /dev/null
+++ b/glue/redhat/rdma.fixup-mtrr.awk
@@ -0,0 +1,160 @@
+# This is a simple script that checks the contents of /proc/mtrr to see if
+# the BIOS maker for the computer took the easy way out in terms of
+# specifying memory regions when there is a hole below 4GB for PCI access
+# and the machine has 4GB or more of RAM. When the contents of /proc/mtrr
+# show a 4GB mapping of write-back cached RAM, minus punch out hole(s) of
+# uncacheable regions (the area reserved for PCI access), then it becomes
+# impossible for the ib_ipath driver to set write_combining on its PIO
+# buffers. To correct the problem, remap the lower memory region in various
+# chunks up to the start of the punch out hole(s), then delete the punch out
+# hole(s) entirely as they aren't needed any more. That way, ib_ipath will
+# be able to set write_combining on its PIO memory access region.
+
+BEGIN {
+ regs = 0
+}
+
+function check_base(mem)
+{
+ printf "Base memory data: base=0x%08x, size=0x%x\n", base[mem], size[mem] > "/dev/stderr"
+ if (size[mem] < (512 * 1024 * 1024))
+ return 0
+ if (type[mem] != "write-back")
+ return 0
+ if (base[mem] >= (4 * 1024 * 1024 * 1024))
+ return 0
+ return 1
+}
+
+function check_hole(hole)
+{
+ printf "Hole data: base=0x%08x, size=0x%x\n", base[hole], size[hole] > "/dev/stderr"
+ if (size[hole] > (1 * 1024 * 1024 * 1024))
+ return 0
+ if (type[hole] != "uncachable")
+ return 0
+ if ((base[hole] + size[hole]) > (4 * 1024 * 1024 * 1024))
+ return 0
+ return 1
+}
+
+function build_entries(start, end, new_base, new_size, tmp_base)
+{
+ # mtrr registers require alignment of blocks, so a 256MB chunk must
+ # be 256MB aligned. Additionally, all blocks must be a power of 2
+ # in size. So, do the largest power of two size that we can and
+ # still have start + block <= end, rinse and repeat.
+ tmp_base = start
+ do {
+ new_base = tmp_base
+ new_size = 4096
+ while (((new_base + new_size) < end) &&
+ ((new_base % new_size) == 0))
+ new_size = lshift(new_size, 1)
+ if (((new_base + new_size) > end) ||
+ ((new_base % new_size) != 0))
+ new_size = rshift(new_size, 1)
+ printf "base=0x%x size=0x%x type=%s\n",
+ new_base, new_size, type[mem] > "/dev/stderr"
+ printf "base=0x%x size=0x%x type=%s\n",
+ new_base, new_size, type[mem] > "/proc/mtrr"
+ fflush("")
+ tmp_base = new_base + new_size
+ } while (tmp_base < end)
+}
+
+{
+ gsub("^reg", "")
+ gsub(": base=", " ")
+ gsub(" [(].*), size=", " ")
+ gsub(": ", " ")
+ gsub(", count=.*$", "")
+ register[regs] = strtonum($1)
+ base[regs] = strtonum($2)
+ size[regs] = strtonum($3)
+ human_size[regs] = size[regs]
+ if (match($3, "MB")) { size[regs] *= 1024*1024; mult[regs] = "MB" }
+ else { size[regs] *= 1024; mult[regs] = "KB" }
+ type[regs] = $4
+ enabled[regs] = 1
+ end[regs] = base[regs] + size[regs]
+ regs++
+}
+
+END {
+ # First we need to find our base memory region. We only care about
+ # the memory register that starts at base 0. This is the only one
+ # that we can reliably know is our global memory region, and the
+ # only one that we can reliably check against overlaps. It's entirely
+ # possible that any memory region not starting at 0 and having an
+ # overlap with another memory region is in fact intentional and we
+ # shouldn't touch it.
+ for(i=0; i<regs; i++)
+ if (base[i] == 0)
+ break
+ # Did we get a valid base register?
+ if (i == regs)
+ exit 1
+ mem = i
+ if (!check_base(mem))
+ exit 1
+
+ cur_hole = 0
+ for(i=0; i<regs; i++) {
+ if (i == mem)
+ continue
+ if (base[i] < end[mem] && check_hole(i))
+ holes[cur_hole++] = i
+ }
+ if (cur_hole == 0) {
+ print "Nothing to do" > "/dev/stderr"
+ exit 1
+ }
+ printf "Found %d punch-out holes\n", cur_hole > "/dev/stderr"
+
+ # We need to sort the holes according to base address
+ for(j = 0; j < cur_hole - 1; j++) {
+ for(i = cur_hole - 1; i > j; i--) {
+ if(base[holes[i]] < base[holes[i-1]]) {
+ tmp = holes[i]
+ holes[i] = holes[i-1]
+ holes[i-1] = tmp
+ }
+ }
+ }
+ # OK, the common case would be that the BIOS is mapping holes out
+ # of the 4GB memory range, and that our hole(s) are consecutive and
+ # that our holes and our memory region end at the same place. However,
+ # things like machines with 8GB of RAM or more can foul up these
+ # common traits.
+ #
+ # So, our modus operandi is to disable all of the memory/hole regions
+ # to start, then build new base memory zones that in the end add
+ # up to the same as our original zone minus the holes. We know that
+ # we will never have a hole listed here that belongs to a valid
+ # hole punched in a write-combining memory region because you can't
+ # overlay write-combining on top of write-back and we know our base
+ # memory region is write-back, so in order for this hole to overlap
+ # our base memory region it can't be also overlapping a write-combining
+ # region.
+ printf "disable=%d\n", register[mem] > "/dev/stderr"
+ printf "disable=%d\n", register[mem] > "/proc/mtrr"
+ fflush("")
+ enabled[mem] = 0
+ for(i=0; i < cur_hole; i++) {
+ printf "disable=%d\n", register[holes[i]] > "/dev/stderr"
+ printf "disable=%d\n", register[holes[i]] > "/proc/mtrr"
+ fflush("")
+ enabled[holes[i]] = 0
+ }
+ build_entries(base[mem], base[holes[0]])
+ for(i=0; i < cur_hole - 1; i++)
+ if (base[holes[i+1]] > end[holes[i]])
+ build_entries(end[holes[i]], base[holes[i+1]])
+ if (end[mem] > end[holes[i]])
+ build_entries(end[holes[i]], end[mem])
+ # We changed up the mtrr regs, so signal to the rdma script to
+ # reload modules that need the mtrr regs to be right.
+ exit 0
+}
+
diff --git a/glue/redhat/rdma.ifdown-ib b/glue/redhat/rdma.ifdown-ib
new file mode 100644
index 0000000..1cb284d
--- /dev/null
+++ b/glue/redhat/rdma.ifdown-ib
@@ -0,0 +1,183 @@
+#!/bin/bash
+# Network Interface Configuration System
+# Copyright (c) 1996-2013 Red Hat, Inc. all rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License, version 2,
+# as published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+. /etc/init.d/functions
+
+cd /etc/sysconfig/network-scripts
+. ./network-functions
+
+[ -f ../network ] && . ../network
+
+CONFIG=${1}
+
+source_config
+
+# Allow the user to override the detection of our physical device by passing
+# it in. No checking is done, if the user gives us a bogus dev, it's
+# their problem.
+[ -n "${PHYSDEV}" ] && REALDEVICE="$PHYSDEV"
+
+. /etc/sysconfig/network
+
+# Check to make sure the device is actually up
+check_device_down ${DEVICE} && exit 0
+
+# If we are a P_Key device, we need to munge a few things
+if [ "${PKEY}" = yes ]; then
+ [ -z "${PKEY_ID}" ] && {
+ net_log $"InfiniBand IPoIB device: PKEY=yes requires a PKEY_ID"
+ exit 1
+ }
+ [ -z "${PHYSDEV}" ] && {
+ net_log $"InfiniBand IPoIB device: PKEY=yes requires a PHYSDEV"
+ exit 1
+ }
+ # Normalize our PKEY_ID to have the high bit set
+ NEW_PKEY_ID=`printf "0x%04x" $(( 0x8000 | ${PKEY_ID} ))`
+ NEW_PKEY_NAME=`printf "%04x" ${NEW_PKEY_ID}`
+ [ "${DEVICE}" != "${PHYSDEV}.${NEW_PKEY_NAME}" ] && {
+ net_log $"Configured DEVICE name does not match what new device name would be. This
+is most likely because once the PKEY_ID was normalized, it no longer
+resulted in the expected device naming, and so the DEVICE entry in the
+config file needs to be updated to match. This can also be caused by
+giving PKEY_ID as a hex number but without using the mandatory 0x prefix.
+ Configured DEVICE=$DEVICE
+ Configured PHYSDEV=$PHYSDEV
+ Configured PKEY_ID=$PKEY_ID
+ Calculated PKEY_ID=$NEW_PKEY_ID
+ Calculated name=${PHYSDEV}.${NEW_PKEY_NAME}"
+ exit 1
+ }
+ [ -d "/sys/class/net/${DEVICE}" ] || exit 0
+ # When we get to downing the IP address, we need REALDEVICE to
+ # point to our PKEY device
+ REALDEVICE="${DEVICE}"
+fi
+
+
+if [ "${SLAVE}" != "yes" -o -z "${MASTER}" ]; then
+if [ -n "${HWADDR}" -a -z "${MACADDR}" ]; then
+ HWADDR=$(echo $HWADDR | tail -c 24)
+ FOUNDMACADDR=$(get_hwaddr ${REALDEVICE} | tail -c 24)
+ if [ -n "${FOUNDMACADDR}" -a "${FOUNDMACADDR}" != "${HWADDR}" ]; then
+ NEWCONFIG=$(get_config_by_hwaddr ${FOUNDMACADDR})
+ if [ -n "${NEWCONFIG}" ]; then
+ eval $(LANG=C grep -F "DEVICE=" $NEWCONFIG)
+ else
+ net_log $"Device ${DEVICE} has MAC address ${FOUNDMACADDR}, instead of configured address ${HWADDR}. Ignoring."
+ exit 1
+ fi
+ if [ -n "${NEWCONFIG}" -a "${NEWCONFIG##*/}" != "${CONFIG##*/}" -a "${DEVICE}" = "${REALDEVICE}" ]; then
+ exec /sbin/ifdown ${NEWCONFIG}
+ else
+ net_log $"Device ${DEVICE} has MAC address ${FOUNDMACADDR}, instead of configured address ${HWADDR}. Ignoring."
+ exit 1
+ fi
+ fi
+fi
+fi
+
+if is_bonding_device ${DEVICE} ; then
+ for device in $(LANG=C grep -l "^[[:space:]]*MASTER=\"\?${DEVICE}\"\?\([[:space:]#]\|$\)" /etc/sysconfig/network-scripts/ifcfg-*) ; do
+ is_ignored_file "$device" && continue
+ /sbin/ifdown ${device##*/}
+ done
+ for arg in $BONDING_OPTS ; do
+ key=${arg%%=*};
+ [[ "${key}" != "arp_ip_target" ]] && continue
+ value=${arg##*=};
+ if [ "${value:0:1}" != "" ]; then
+ OLDIFS=$IFS;
+ IFS=',';
+ for arp_ip in $value; do
+ if grep -q $arp_ip /sys/class/net/${DEVICE}/bonding/arp_ip_target; then
+ echo "-$arp_ip" > /sys/class/net/${DEVICE}/bonding/arp_ip_target
+ fi
+ done
+ IFS=$OLDIFS;
+ else
+ value=${value#+};
+ if grep -q $value /sys/class/net/${DEVICE}/bonding/arp_ip_target; then
+ echo "-$value" > /sys/class/net/${DEVICE}/bonding/arp_ip_target
+ fi
+ fi
+ done
+fi
+
+/etc/sysconfig/network-scripts/ifdown-ipv6 ${CONFIG}
+
+retcode=0
+[ -n "$(pidof -x dhclient)" ] && {
+ for VER in "" 6 ; do
+ if [ -f "/var/run/dhclient$VER-${DEVICE}.pid" ]; then
+ dhcpid=$(cat /var/run/dhclient$VER-${DEVICE}.pid)
+ generate_lease_file_name $VER
+ if [[ "$DHCPRELEASE" = [yY1]* ]]; then
+ /sbin/dhclient -r -lf ${LEASEFILE} -pf /var/run/dhclient$VER-${DEVICE}.pid ${DEVICE} >/dev/null 2>&1
+ retcode=$?
+ else
+ kill $dhcpid >/dev/null 2>&1
+ retcode=$?
+ reason=STOP$VER interface=${DEVICE} /sbin/dhclient-script
+ fi
+ if [ -f "/var/run/dhclient$VER-${DEVICE}.pid" ]; then
+ rm -f /var/run/dhclient$VER-${DEVICE}.pid
+ kill $dhcpid >/dev/null 2>&1
+ fi
+ fi
+ done
+}
+# we can't just delete the configured address because that address
+# may have been changed in the config file since the device was
+# brought up. Flush all addresses associated with this
+# instance instead.
+if [ -d "/sys/class/net/${REALDEVICE}" ]; then
+ if [ "${REALDEVICE}" = "${DEVICE}" ]; then
+ ip addr flush dev ${REALDEVICE} scope global 2>/dev/null
+ else
+ ip addr flush dev ${REALDEVICE} label ${DEVICE} scope global 2>/dev/null
+ fi
+
+ if [ "${SLAVE}" = "yes" -a -n "${MASTER}" ]; then
+ echo "-${DEVICE}" > /sys/class/net/${MASTER}/bonding/slaves 2>/dev/null
+ fi
+
+ if [ "${REALDEVICE}" = "${DEVICE}" ]; then
+ ip link set dev ${DEVICE} down 2>/dev/null
+ fi
+fi
+[ "$retcode" = "0" ] && retcode=$?
+
+# wait up to 5 seconds for device to actually come down...
+waited=0
+while ! check_device_down ${DEVICE} && [ "$waited" -lt 50 ] ; do
+ usleep 10000
+ waited=$(($waited+1))
+done
+
+if [ "$retcode" = 0 ] ; then
+ /etc/sysconfig/network-scripts/ifdown-post $CONFIG
+ # do NOT use $? because ifdown should return whether or not
+ # the interface went down.
+fi
+
+if [ -n "$PKEY" ]; then
+ # PKey PKEY
+ echo "$NEW_PKEY_ID" > /sys/class/net/${PHYSDEV}/delete_child
+fi
+
+exit $retcode
diff --git a/glue/redhat/rdma.ifup-ib b/glue/redhat/rdma.ifup-ib
new file mode 100644
index 0000000..bb4d4f7
--- /dev/null
+++ b/glue/redhat/rdma.ifup-ib
@@ -0,0 +1,308 @@
+#!/bin/bash
+# Network Interface Configuration System
+# Copyright (c) 1996-2013 Red Hat, Inc. all rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License, version 2,
+# as published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+. /etc/init.d/functions
+
+cd /etc/sysconfig/network-scripts
+. ./network-functions
+
+[ -f ../network ] && . ../network
+
+CONFIG="${1}"
+
+need_config "${CONFIG}"
+
+source_config
+
+# Allow the user to override the detection of our physical device by passing
+# it in. No checking is done, if the user gives us a bogus dev, it's
+# their problem.
+[ -n "${PHYSDEV}" ] && REALDEVICE="$PHYSDEV"
+
+if [ "${BOOTPROTO}" = "dhcp" ]; then
+ DYNCONFIG=true
+fi
+
+# load the module associated with that device
+# /sbin/modprobe ${REALDEVICE}
+is_available_wait ${REALDEVICE} ${DEVTIMEOUT}
+
+# bail out, if the MAC does not fit
+if [ -n "${HWADDR}" ]; then
+ FOUNDMACADDR=$(get_hwaddr ${REALDEVICE} | tail -c 24)
+ HWADDR=$(echo $HWADDR | tail -c 24)
+ if [ "${FOUNDMACADDR}" != "${HWADDR}" ]; then
+ net_log $"Device ${DEVICE} has different MAC address than expected, ignoring."
+ exit 1
+ fi
+fi
+
+# now check the real state
+is_available ${REALDEVICE} || {
+ if [ -n "$alias" ]; then
+ net_log $"$alias device ${DEVICE} does not seem to be present, delaying initialization."
+ else
+ net_log $"Device ${DEVICE} does not seem to be present, delaying initialization."
+ fi
+ exit 1
+}
+
+# if we are a P_Key device, create the device if needed
+if [ "${PKEY}" = yes ]; then
+ [ -z "${PKEY_ID}" ] && {
+ net_log $"InfiniBand IPoIB device: PKEY=yes requires a PKEY_ID"
+ exit 1
+ }
+ [ -z "${PHYSDEV}" ] && {
+ net_log $"InfiniBand IPoIB device: PKEY=yes requires a PHYSDEV"
+ exit 1
+ }
+ # Normalize our PKEY_ID to have the high bit set
+ NEW_PKEY_ID=`printf "0x%04x" $(( 0x8000 | ${PKEY_ID} ))`
+ NEW_PKEY_NAME=`printf "%04x" ${NEW_PKEY_ID}`
+ [ "${DEVICE}" != "${PHYSDEV}.${NEW_PKEY_NAME}" ] && {
+ net_log $"Configured DEVICE name does not match what new device name would be. This
+is most likely because once the PKEY_ID was normalized, it no longer
+resulted in the expected device naming, and so the DEVICE entry in the
+config file needs to be updated to match. This can also be caused by
+giving PKEY_ID as a hex number but without using the mandatory 0x prefix.
+ Configured DEVICE=$DEVICE
+ Configured PHYSDEV=$PHYSDEV
+ Configured PKEY_ID=$PKEY_ID
+ Calculated PKEY_ID=$NEW_PKEY_ID
+ Calculated name=${PHYSDEV}.${NEW_PKEY_NAME}"
+ exit 1
+ }
+ [ -d "/sys/class/net/${DEVICE}" ] ||
+ echo "${NEW_PKEY_ID}" > "/sys/class/net/${PHYSDEV}/create_child"
+ [ -d "/sys/class/net/${DEVICE}" ] || {
+ echo "Failed to create child device $NEW_PKEY_ID of $PHYSDEV"
+ exit 1
+ }
+ # When we get to setting up the IP address, we need REALDEVICE to
+ # point to our new PKEY device
+ REALDEVICE="${DEVICE}"
+fi
+
+
+if [ -n "${MACADDR}" ]; then
+ net_log $"IPoIB devices do not support setting the MAC address of the interface"
+ # ip link set dev ${DEVICE} address ${MACADDR}
+fi
+
+# First, do we even support setting connected mode?
+if [ -e /sys/class/net/${DEVICE}/mode ]; then
+ # OK, set the mode in all cases, that way it gets reset on a down/up
+ # cycle, allowing people to change the mode without rebooting
+ if [ "${CONNECTED_MODE}" = yes ]; then
+ echo connected > /sys/class/net/${DEVICE}/mode
+ # cap the MTU where we should based upon mode
+ [ -z "$MTU" ] && MTU=65520
+ [ "$MTU" -gt 65520 ] && MTU=65520
+ else
+ echo datagram > /sys/class/net/${DEVICE}/mode
+ # cap the MTU where we should based upon mode
+ [ -z "$MTU" ] && MTU=2044
+ [ "$MTU" -gt 2044 ] && MTU=2044
+ fi
+fi
+
+if [ -n "${MTU}" ]; then
+ ip link set dev ${DEVICE} mtu ${MTU}
+fi
+
+# slave device?
+if [ "${SLAVE}" = yes -a "${ISALIAS}" = no -a "${MASTER}" != "" ]; then
+ install_bonding_driver ${MASTER}
+ grep -wq "${DEVICE}" /sys/class/net/${MASTER}/bonding/slaves 2>/dev/null || {
+ /sbin/ip link set dev ${DEVICE} down
+ echo "+${DEVICE}" > /sys/class/net/${MASTER}/bonding/slaves 2>/dev/null
+ }
+ ethtool_set
+
+ exit 0
+fi
+
+# Bonding initialization. For DHCP, we need to enslave the devices early,
+# so it can actually get an IP.
+if [ "$ISALIAS" = no ] && is_bonding_device ${DEVICE} ; then
+ install_bonding_driver ${DEVICE}
+ /sbin/ip link set dev ${DEVICE} up
+ for device in $(LANG=C grep -l "^[[:space:]]*MASTER=\"\?${DEVICE}\"\?\([[:space:]#]\|$\)" /etc/sysconfig/network-scripts/ifcfg-*) ; do
+ is_ignored_file "$device" && continue
+ /sbin/ifup ${device##*/}
+ done
+
+ [ -n "${LINKDELAY}" ] && /bin/sleep ${LINKDELAY}
+
+ # add the bits to setup the needed post enslavement parameters
+ for arg in $BONDING_OPTS ; do
+ key=${arg%%=*};
+ value=${arg##*=};
+ if [ "${key}" = "primary" ]; then
+ echo $value > /sys/class/net/${DEVICE}/bonding/$key
+ fi
+ done
+fi
+
+
+if [ -n "${DYNCONFIG}" ] && [ -x /sbin/dhclient ]; then
+ if [[ "${PERSISTENT_DHCLIENT}" = [yY1]* ]]; then
+ ONESHOT="";
+ else
+ ONESHOT="-1";
+ fi;
+ generate_config_file_name
+ generate_lease_file_name
+ DHCLIENTARGS="${DHCLIENTARGS} -H ${DHCP_HOSTNAME:-${HOSTNAME%%.*}} ${ONESHOT} -q ${DHCLIENTCONF} -lf ${LEASEFILE} -pf /var/run/dhclient-${DEVICE}.pid"
+ echo
+ echo -n $"Determining IP information for ${DEVICE}..."
+ if [[ "${PERSISTENT_DHCLIENT}" != [yY1]* ]] && check_link_down ${DEVICE}; then
+ echo $" failed; no link present. Check cable?"
+ exit 1
+ fi
+
+ ethtool_set
+
+ if /sbin/dhclient ${DHCLIENTARGS} ${DEVICE} ; then
+ echo $" done."
+ dhcpipv4="good"
+ else
+ echo $" failed."
+ if [[ "${IPV4_FAILURE_FATAL}" = [Yy1]* ]] ; then
+ exit 1
+ fi
+ if [[ "$IPV6INIT" != [yY1]* && "$DHCPV6C" != [yY1]* ]] ; then
+ exit 1
+ fi
+ net_log "Unable to obtain IPv4 DHCP address ${DEVICE}." warning
+ fi
+# end dynamic device configuration
+else
+ if [ -z "${IPADDR}" -a -z "${IPADDR0}" -a -z "${IPADDR1}" -a -z "${IPADDR2}" ]; then
+ # enable device without IP, useful for e.g. PPPoE
+ ip link set dev ${REALDEVICE} up
+ ethtool_set
+ [ -n "${LINKDELAY}" ] && /bin/sleep ${LINKDELAY}
+ else
+
+ expand_config
+
+ [ -n "${ARP}" ] && \
+ ip link set dev ${REALDEVICE} $(toggle_value arp $ARP)
+
+ if ! ip link set dev ${REALDEVICE} up ; then
+ net_log $"Failed to bring up ${DEVICE}."
+ exit 1
+ fi
+
+ ethtool_set
+
+ [ -n "${LINKDELAY}" ] && /bin/sleep ${LINKDELAY}
+
+ if [ "${DEVICE}" = "lo" ]; then
+ SCOPE="scope host"
+ else
+ SCOPE=${SCOPE:-}
+ fi
+
+ if [ -n "$SRCADDR" ]; then
+ SRC="src $SRCADDR"
+ else
+ SRC=
+ fi
+
+ # set IP address(es)
+ for idx in {0..256} ; do
+ if [ -z "${ipaddr[$idx]}" ]; then
+ break
+ fi
+
+ if ! LC_ALL=C ip addr ls ${REALDEVICE} | LC_ALL=C grep -q "${ipaddr[$idx]}/${prefix[$idx]}" ; then
+ [ "${REALDEVICE}" != "lo" ] && [ "${arpcheck[$idx]}" != "no" ] && \
+ /sbin/arping -q -c 2 -w 3 -D -I ${REALDEVICE} ${ipaddr[$idx]}
+ if [ $? = 1 ]; then
+ net_log $"Error, some other host already uses address ${ipaddr[$idx]}."
+ exit 1
+ fi
+
+ if ! ip addr add ${ipaddr[$idx]}/${prefix[$idx]} \
+ brd ${broadcast[$idx]:-+} dev ${REALDEVICE} ${SCOPE} label ${DEVICE}; then
+ net_log $"Error adding address ${ipaddr[$idx]} for ${DEVICE}."
+ fi
+ fi
+
+ if [ -n "$SRCADDR" ]; then
+ sysctl -w "net.ipv4.conf.${REALDEVICE}.arp_filter=1" >/dev/null 2>&1
+ fi
+
+ # update ARP cache of neighboring computers
+ if [ "${REALDEVICE}" != "lo" ]; then
+ /sbin/arping -q -A -c 1 -I ${REALDEVICE} ${ipaddr[$idx]}
+ ( sleep 2;
+ /sbin/arping -q -U -c 1 -I ${REALDEVICE} ${ipaddr[$idx]} ) > /dev/null 2>&1 < /dev/null &
+ fi
+ done
+
+ # Set a default route.
+ if [ "${DEFROUTE}" != "no" ] && [ -z "${GATEWAYDEV}" -o "${GATEWAYDEV}" = "${REALDEVICE}" ]; then
+ # set up default gateway. replace if one already exists
+ if [ -n "${GATEWAY}" ] && [ "$(ipcalc --network ${GATEWAY} ${netmask[0]} 2>/dev/null)" = "NETWORK=${NETWORK}" ]; then
+ ip route replace default ${METRIC:+metric $METRIC} \
+ via ${GATEWAY} ${WINDOW:+window $WINDOW} ${SRC} \
+ ${GATEWAYDEV:+dev $GATEWAYDEV} ||
+ net_log $"Error adding default gateway ${GATEWAY} for ${DEVICE}."
+ elif [ "${GATEWAYDEV}" = "${DEVICE}" ]; then
+ ip route replace default ${METRIC:+metric $METRIC} \
+ ${SRC} ${WINDOW:+window $WINDOW} dev ${REALDEVICE} ||
+ net_log $"Erorr adding default gateway for ${REALDEVICE}."
+ fi
+ fi
+ fi
+fi
+
+# Add Zeroconf route.
+if [ -z "${NOZEROCONF}" -a "${ISALIAS}" = "no" -a "${REALDEVICE}" != "lo" ]; then
+ ip route add 169.254.0.0/16 dev ${REALDEVICE} metric $((1000 + $(cat /sys/class/net/${REALDEVICE}/ifindex))) scope link
+fi
+
+# Inform firewall which network zone (empty means default) this interface belongs to
+if [ -x /usr/bin/firewall-cmd -a "${REALDEVICE}" != "lo" ]; then
+ /usr/bin/firewall-cmd --zone="${ZONE}" --change-interface="${DEVICE}" > /dev/null 2>&1
+fi
+
+# IPv6 initialisation?
+/etc/sysconfig/network-scripts/ifup-ipv6 ${CONFIG}
+if [[ "${DHCPV6C}" = [Yy1]* ]] && [ -x /sbin/dhclient ]; then
+ generate_config_file_name 6
+ generate_lease_file_name 6
+ echo
+ echo -n $"Determining IPv6 information for ${DEVICE}..."
+ if /sbin/dhclient -6 -1 ${DHCPV6C_OPTIONS} ${DHCLIENTCONF} -lf ${LEASEFILE} -pf /var/run/dhclient6-${DEVICE}.pid -H ${DHCP_HOSTNAME:-${HOSTNAME%%.*}} ${DEVICE} ; then
+ echo $" done."
+ else
+ echo $" failed."
+ if [ "${dhcpipv4}" = "good" -o -n "${IPADDR}" ]; then
+ net_log "Unable to obtain IPv6 DHCP address ${DEVICE}." warning
+ else
+ exit 1
+ fi
+ fi
+fi
+
+exec /etc/sysconfig/network-scripts/ifup-post ${CONFIG} ${2}
+
diff --git a/glue/redhat/rdma.kernel-init b/glue/redhat/rdma.kernel-init
new file mode 100644
index 0000000..6cb4732
--- /dev/null
+++ b/glue/redhat/rdma.kernel-init
@@ -0,0 +1,262 @@
+#!/bin/bash
+#
+# Bring up the kernel RDMA stack
+#
+# This is usually run automatically by systemd after a hardware activation
+# event in udev has triggered a start of the rdma.service unit
+#
+
+shopt -s nullglob
+
+CONFIG=/etc/rdma/rdma.conf
+MTRR_SCRIPT=/usr/libexec/rdma-fixup-mtrr.awk
+
+LOAD_ULP_MODULES=""
+LOAD_CORE_USER_MODULES="ib_umad ib_uverbs ib_ucm rdma_ucm"
+LOAD_CORE_CM_MODULES="iw_cm ib_cm rdma_cm"
+LOAD_CORE_MODULES="ib_core ib_mad ib_sa ib_addr"
+LOAD_TECH_PREVIEW_DRIVERS="no"
+
+if [ -f $CONFIG ]; then
+ . $CONFIG
+
+ if [ "${RDS_LOAD}" == "yes" ]; then
+ IPOIB_LOAD=yes
+ fi
+
+ if [ "${IPOIB_LOAD}" == "yes" ]; then
+ LOAD_ULP_MODULES="ib_ipoib"
+ fi
+
+ if [ "${RDS_LOAD}" == "yes" -a -f /lib/modules/`uname -r`/kernel/net/rds/rds.ko ]; then
+ LOAD_ULP_MODULES="$LOAD_ULP_MODULES rds"
+ if [ -f /lib/modules/`uname -r`/kernel/net/rds/rds_tcp.ko ]; then
+ LOAD_ULP_MODULES="$LOAD_ULP_MODULES rds_tcp"
+ fi
+ if [ -f /lib/modules/`uname -r`/kernel/net/rds/rds_rdma.ko ]; then
+ LOAD_ULP_MODULES="$LOAD_ULP_MODULES rds_rdma"
+ fi
+ fi
+
+ if [ "${SRP_LOAD}" == "yes" ]; then
+ LOAD_ULP_MODULES="$LOAD_ULP_MODULES ib_srp"
+ fi
+
+ if [ "${SRPT_LOAD}" == "yes" ]; then
+ LOAD_ULP_MODULES="$LOAD_ULP_MODULES ib_srpt"
+ fi
+
+ if [ "${ISER_LOAD}" == "yes" ]; then
+ LOAD_ULP_MODULES="$LOAD_ULP_MODULES ib_iser"
+ fi
+
+ if [ "${ISERT_LOAD}" == "yes" ]; then
+ LOAD_ULP_MODULES="$LOAD_ULP_MODULES ib_isert"
+ fi
+
+ if [ "${XPRTRDMA_LOAD}" == "yes" ]; then
+ LOAD_ULP_MODULES="$LOAD_ULP_MODULES xprtrdma"
+ fi
+
+ if [ "${SVCRDMA_LOAD}" == "yes" ]; then
+ LOAD_ULP_MODULES="$LOAD_ULP_MODULES svcrdma"
+ fi
+ if [ "${TECH_PREVIEW_LOAD}" == "yes" ]; then
+ LOAD_TECH_PREVIEW_DRIVERS="$TECH_PREVIEW_LOAD"
+ fi
+else
+ LOAD_ULP_MODULES="ib_ipoib"
+fi
+
+# If module $1 is loaded return - 0 else - 1
+is_loaded()
+{
+ /sbin/lsmod | grep -w "$1" > /dev/null 2>&1
+ return $?
+}
+
+load_modules()
+{
+ local RC=0
+
+ for module in $*; do
+ if ! /sbin/modinfo $module > /dev/null 2>&1; then
+ # do not attempt to load modules which do not exist
+ continue
+ fi
+ if ! is_loaded $module; then
+ /sbin/modprobe $module
+ res=$?
+ RC=$[ $RC + $res ]
+ if [ $res -ne 0 ]; then
+ echo
+ echo "Failed to load module $module"
+ fi
+ fi
+ done
+ return $RC
+}
+
+# This function is a horrible hack to work around BIOS authors that should
+# be shot. Specifically, certain BIOSes will map the entire 4GB address
+# space as write-back cacheable when the machine has 4GB or more of RAM, and
+# then they will exclude the reserved PCI I/O addresses from that 4GB
+# cacheable mapping by making on overlapping uncacheable mapping. However,
+# once you do that, it is then impossible to set *any* of the PCI I/O
+# address space as write-combining. This is an absolute death-knell to
+# certain IB hardware. So, we unroll this mapping here. Instead of
+# punching a hole in a single 4GB mapping, we redo the base 4GB mapping as
+# a series of discreet mappings that effectively are the same as the 4GB
+# mapping minus the hole, and then we delete the uncacheable mappings that
+# are used to punch the hole. This then leaves the PCI I/O address space
+# unregistered (which defaults it to uncacheable), but available for
+# write-combining mappings where needed.
+check_mtrr_registers()
+{
+ # If we actually change the mtrr registers, then the awk script will
+ # return true, and we need to unload the ib_ipath module if it's already
+ # loaded. The udevtrigger in load_hardware_modules will immediately
+ # reload the ib_ipath module for us, so there shouldn't be a problem.
+ [ -f /proc/mtrr -a -f $MTRR_SCRIPT ] &&
+ awk -f $MTRR_SCRIPT /proc/mtrr 2>/dev/null &&
+ if is_loaded ib_ipath; then
+ /sbin/rmmod ib_ipath
+ fi
+}
+
+load_hardware_modules()
+{
+ local -i RC=0
+
+ [ "$FIXUP_MTRR_REGS" = "yes" ] && check_mtrr_registers
+ # We match both class NETWORK and class INFINIBAND devices since our
+ # iWARP hardware is listed under class NETWORK. The side effect of
+ # this is that we might cause a non-iWARP network driver to be loaded.
+ udevadm trigger --subsystem-match=pci --attr-nomatch=driver --attr-match=class=0x020000 --attr-match=class=0x0c0600
+ udevadm settle
+ if [ -r /proc/device-tree ]; then
+ if [ -n "`ls /proc/device-tree | grep lhca`" ]; then
+ if ! is_loaded ib_ehca; then
+ load_modules ib_ehca
+ RC+=$?
+ fi
+ fi
+ fi
+ if is_loaded mlx4_core -a ! is_loaded mlx4_ib; then
+ load_modules mlx4_ib
+ RC+=$?
+ fi
+ if is_loaded mlx4_core -a ! is_loaded mlx4_en; then
+ load_modules mlx4_en
+ RC+=$?
+ fi
+ if is_loaded mlx5_core -a ! is_loaded mlx5_ib; then
+ load_modules mlx5_ib
+ RC+=$?
+ fi
+ if is_loaded cxgb3 -a ! is_loaded iw_cxgb3; then
+ load_modules iw_cxgb3
+ RC+=$?
+ fi
+ if is_loaded cxgb4 -a ! is_loaded iw_cxgb4; then
+ load_modules iw_cxgb4
+ RC+=$?
+ fi
+ if is_loaded be2net -a ! is_loaded ocrdma; then
+ load_modules ocrdma
+ RC+=$?
+ fi
+ if is_loaded enic -a ! is_loaded usnic_verbs; then
+ load_modules usnic_verbs
+ RC+=$?
+ fi
+ if [ "${LOAD_TECH_PREVIEW_DRIVERS}" == "yes" ]; then
+ if is_loaded i40e -a ! is_loaded i40iw; then
+ load_modules i40iw
+ RC+=$?
+ fi
+ fi
+ return $RC
+}
+
+errata_58()
+{
+ # Check AMD chipset issue Errata #58
+ if test -x /sbin/lspci && test -x /sbin/setpci; then
+ if ( /sbin/lspci -nd 1022:1100 | grep "1100" > /dev/null ) &&
+ ( /sbin/lspci -nd 1022:7450 | grep "7450" > /dev/null ) &&
+ ( /sbin/lspci -nd 15b3:5a46 | grep "5a46" > /dev/null ); then
+ CURVAL=`/sbin/setpci -d 1022:1100 69`
+ for val in $CURVAL
+ do
+ if [ "${val}" != "c0" ]; then
+ /sbin/setpci -d 1022:1100 69=c0
+ if [ $? -eq 0 ]; then
+ break
+ else
+ echo "Failed to apply AMD-8131 Errata #58 workaround"
+ fi
+ fi
+ done
+ fi
+ fi
+}
+
+errata_56()
+{
+ # Check AMD chipset issue Errata #56
+ if test -x /sbin/lspci && test -x /sbin/setpci; then
+ if ( /sbin/lspci -nd 1022:1100 | grep "1100" > /dev/null ) &&
+ ( /sbin/lspci -nd 1022:7450 | grep "7450" > /dev/null ) &&
+ ( /sbin/lspci -nd 15b3:5a46 | grep "5a46" > /dev/null ); then
+ bus=""
+ # Look for devices AMD-8131
+ for dev in `/sbin/setpci -v -f -d 1022:7450 19 | cut -d':' -f1,2`
+ do
+ bus=`/sbin/setpci -s $dev 19`
+ rev=`/sbin/setpci -s $dev 8`
+ # Look for Tavor attach to secondary bus of this devices
+ for device in `/sbin/setpci -f -s $bus: -d 15b3:5a46 19`
+ do
+ if [ $rev -lt 13 ]; then
+ /sbin/setpci -d 15b3:5a44 72=14
+ if [ $? -eq 0 ]; then
+ break
+ else
+ echo
+ echo "Failed to apply AMD-8131 Errata #56 workaround"
+ fi
+ else
+ continue
+ fi
+ # If more than one device is on the bus the issue a
+ # warning
+ num=`/sbin/setpci -f -s $bus: 0 | wc -l | sed 's/\ *//g'`
+ if [ $num -gt 1 ]; then
+ echo "Warning: your current PCI-X configuration might be incorrect."
+ echo "see AMD-8131 Errata 56 for more details."
+ fi
+ done
+ done
+ fi
+ fi
+}
+
+
+load_hardware_modules
+RC=$[ $RC + $? ]
+load_modules $LOAD_CORE_MODULES
+RC=$[ $RC + $? ]
+load_modules $LOAD_CORE_CM_MODULES
+RC=$[ $RC + $? ]
+load_modules $LOAD_CORE_USER_MODULES
+RC=$[ $RC + $? ]
+load_modules $LOAD_ULP_MODULES
+RC=$[ $RC + $? ]
+
+errata_58
+errata_56
+
+/usr/libexec/rdma-set-sriov-vf
+
+exit $RC
diff --git a/glue/redhat/rdma.mlx4-setup.sh b/glue/redhat/rdma.mlx4-setup.sh
new file mode 100644
index 0000000..5e71ade
--- /dev/null
+++ b/glue/redhat/rdma.mlx4-setup.sh
@@ -0,0 +1,91 @@
+#!/bin/bash
+dir="/sys/bus/pci/drivers/mlx4_core"
+[ ! -d $dir ] && exit 1
+pushd $dir >/dev/null
+
+function set_dual_port() {
+ device=$1
+ port1=$2
+ port2=$3
+ pushd $device >/dev/null
+ cur_p1=`cat mlx4_port1`
+ cur_p2=`cat mlx4_port2`
+
+ # special case the "eth eth" mode as we need port2 to
+ # actually switch to eth before the driver will let us
+ # switch port1 to eth as well
+ if [ "$port1" == "eth" ]; then
+ if [ "$port2" != "eth" ]; then
+ echo "In order for port1 to be eth, port2 to must also be eth"
+ popd >/dev/null
+ return
+ fi
+ if [ "$cur_p2" != "eth" -a "$cur_p2" != "auto (eth)" ]; then
+ tries=0
+ echo "$port2" > mlx4_port2 2>/dev/null
+ sleep .25
+ cur_p2=`cat mlx4_port2`
+ while [ "$cur_p2" != "eth" -a "$cur_p2" != "auto (eth)" -a $tries -lt 10 ]; do
+ sleep .25
+ let tries++
+ cur_p2=`cat mlx4_port2`
+ done
+ if [ "$cur_p2" != "eth" -a "$cur_p2" != "auto (eth)" ]; then
+ echo "Failed to set port2 to eth mode"
+ popd >/dev/null
+ return
+ fi
+ fi
+ if [ "$cur_p1" != "eth" -a "$cur_p1" != "auto (eth)" ]; then
+ tries=0
+ echo "$port1" > mlx4_port1 2>/dev/null
+ sleep .25
+ cur_p1=`cat mlx4_port1`
+ while [ "$cur_p1" != "eth" -a "$cur_p1" != "auto (eth)" -a $tries -lt 10 ]; do
+ sleep .25
+ let tries++
+ cur_p1=`cat mlx4_port1`
+ done
+ if [ "$cur_p1" != "eth" -a "$cur_p1" != "auto (eth)" ]; then
+ echo "Failed to set port1 to eth mode"
+ fi
+ fi
+ popd >/dev/null
+ return
+ fi
+
+ # our mode is not eth <anything> as that is covered above
+ # so we should be able to succesfully set the ports in
+ # port1 then port2 order
+ if [ "$cur_p1" != "$port1" -o "$cur_p2" != "$port2" ]; then
+ # Try setting the ports in order first
+ echo "$port1" > mlx4_port1 2>/dev/null ; sleep .1
+ echo "$port2" > mlx4_port2 2>/dev/null ; sleep .1
+ cur_p1=`cat mlx4_port1`
+ cur_p2=`cat mlx4_port2`
+ fi
+
+ if [ "$cur_p1" != "$port1" -o "$cur_p2" != "$port2" ]; then
+ # Try reverse order this time
+ echo "$port2" > mlx4_port2 2>/dev/null ; sleep .1
+ echo "$port1" > mlx4_port1 2>/dev/null ; sleep .1
+ cur_p1=`cat mlx4_port1`
+ cur_p2=`cat mlx4_port2`
+ fi
+
+ if [ "$cur_p1" != "$port1" -o "$cur_p2" != "$port2" ]; then
+ echo "Error setting port type on mlx4 device $device"
+ fi
+
+ popd >/dev/null
+ return
+}
+
+
+while read device port1 port2 ; do
+ [ -d "$device" ] || continue
+ [ -z "$port1" ] && continue
+ [ -f "$device/mlx4_port2" -a -z "$port2" ] && continue
+ [ -f "$device/mlx4_port2" ] && set_dual_port $device $port1 $port2 || echo "$port1" > "$device/mlx4_port1"
+done
+popd 2&>/dev/null
diff --git a/glue/redhat/rdma.mlx4.conf b/glue/redhat/rdma.mlx4.conf
new file mode 100644
index 0000000..71207cc
--- /dev/null
+++ b/glue/redhat/rdma.mlx4.conf
@@ -0,0 +1,27 @@
+# Config file for mlx4 hardware port settings
+# This file is read when the mlx4_core module is loaded and used to
+# set the port types for any hardware found. If a card is not listed
+# in this file, then its port types are left alone.
+#
+# Format:
+# <pci_device_of_card> <port1_type> [port2_type]
+#
+# @port1 and @port2:
+# One of auto, ib, or eth. No checking is performed to make sure that
+# combinations are valid. Invalid inputs will result in the driver
+# not setting the port to the type requested. port1 is required at
+# all times, port2 is required for dual port cards.
+#
+# Example:
+# 0000:0b:00.0 eth eth
+#
+# You can find the right pci device to use for any given card by loading
+# the mlx4_core module, then going to /sys/bus/pci/drivers/mlx4_core and
+# seeing what possible PCI devices are listed there. The possible values
+# for ports are: ib, eth, and auto. However, not all cards support all
+# types, so if you get messages from the kernel that your selected port
+# type isn't supported, there's nothing this script can do about it. Also,
+# some cards don't support using different types on the two ports (aka,
+# both ports must be either eth or ib). Again, we can't set what the kernel
+# or hardware won't support.
+#
diff --git a/glue/redhat/rdma.mlx4.sys.modprobe b/glue/redhat/rdma.mlx4.sys.modprobe
new file mode 100644
index 0000000..781562c
--- /dev/null
+++ b/glue/redhat/rdma.mlx4.sys.modprobe
@@ -0,0 +1,5 @@
+# WARNING! - This file is overwritten any time the rdma rpm package is
+# updated. Please do not make any changes to this file. Instead, make
+# changes to the mlx4.conf file. It's contents are preserved if they
+# have been changed from the default values.
+install mlx4_core /sbin/modprobe --ignore-install mlx4_core $CMDLINE_OPTS && (if [ -f /usr/libexec/mlx4-setup.sh -a -f /etc/rdma/mlx4.conf ]; then /usr/libexec/mlx4-setup.sh < /etc/rdma/mlx4.conf; fi; /sbin/modprobe mlx4_en; if /sbin/modinfo mlx4_ib > /dev/null 2>&1; then /sbin/modprobe mlx4_ib; fi)
diff --git a/glue/redhat/rdma.mlx4.user.modprobe b/glue/redhat/rdma.mlx4.user.modprobe
new file mode 100644
index 0000000..c8b4cce
--- /dev/null
+++ b/glue/redhat/rdma.mlx4.user.modprobe
@@ -0,0 +1,21 @@
+# This file is intended for users to select the various module options
+# they need for the mlx4 driver. On upgrade of the rdma package,
+# any user made changes to this file are preserved. Any changes made
+# to the libmlx4.conf file in this directory are overwritten on
+# pacakge upgrade.
+#
+# Some sample options and what they would do
+# Enable debugging output, device managed flow control, and disable SRIOV
+#options mlx4_core debug_level=1 log_num_mgm_entry_size=-1 probe_vf=0 num_vfs=0
+#
+# Enable debugging output and create SRIOV devices, but don't attach any of
+# the child devices to the host, only the parent device
+#options mlx4_core debug_level=1 probe_vf=0 num_vfs=7
+#
+# Enable debugging output, SRIOV, and attach one of the SRIOV child devices
+# in addition to the parent device to the host
+#options mlx4_core debug_level=1 probe_vf=1 num_vfs=7
+#
+# Enable per priority flow control for send and receive, setting both priority
+# 1 and 2 as no drop priorities
+#options mlx4_en pfctx=3 pfcrx=3
diff --git a/glue/redhat/rdma.modules-setup.sh b/glue/redhat/rdma.modules-setup.sh
new file mode 100644
index 0000000..19a182f
--- /dev/null
+++ b/glue/redhat/rdma.modules-setup.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+check() {
+ [ -n "$hostonly" -a -c /sys/class/infiniband_verbs/uverbs0 ] && return 0
+ [ -n "$hostonly" ] && return 255
+ return 0
+}
+
+depends() {
+ return 0
+}
+
+install() {
+ inst /etc/rdma/rdma.conf
+ inst /etc/rdma/mlx4.conf
+ inst /etc/rdma/sriov-vfs
+ inst /usr/libexec/rdma-init-kernel
+ inst /usr/libexec/rdma-fixup-mtrr.awk
+ inst /usr/libexec/mlx4-setup.sh
+ inst /usr/libexec/rdma-set-sriov-vf
+ inst /usr/lib/modprobe.d/libmlx4.conf
+ inst_multiple lspci setpci awk sleep
+ inst_multiple -o /etc/modprobe.d/mlx4.conf
+ inst_rules 98-rdma.rules 70-persistent-ipoib.rules
+}
+
+installkernel() {
+ hostonly='' instmods =drivers/infiniband =drivers/net/ethernet/mellanox =drivers/net/ethernet/chelsio =drivers/net/ethernet/cisco =drivers/net/ethernet/emulex =drivers/target
+ hostonly='' instmods crc-t10dif crct10dif_common
+}
diff --git a/glue/redhat/rdma.service b/glue/redhat/rdma.service
new file mode 100644
index 0000000..514ef58
--- /dev/null
+++ b/glue/redhat/rdma.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Initialize the iWARP/InfiniBand/RDMA stack in the kernel
+Documentation=file:/etc/rdma/rdma.conf
+RefuseManualStop=true
+DefaultDependencies=false
+Conflicts=emergency.target emergency.service
+Before=network.target remote-fs-pre.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/libexec/rdma-init-kernel
+
+[Install]
+WantedBy=sysinit.target
diff --git a/glue/redhat/rdma.sriov-init b/glue/redhat/rdma.sriov-init
new file mode 100644
index 0000000..0d7cbc6
--- /dev/null
+++ b/glue/redhat/rdma.sriov-init
@@ -0,0 +1,137 @@
+#!/bin/bash
+#
+# Initialize SRIOV virtual devices
+#
+# This is usually run automatically by systemd after a hardware activation
+# event in udev has triggered a start of the rdma.service unit
+port=1
+
+function __get_parent_pci_dev()
+{
+ pushd /sys/bus/pci/devices/$pci_dev >/dev/null 2>&1
+ ppci_dev=`ls -l physfn | cut -f 2 -d '/'`
+ popd >/dev/null 2>&1
+}
+
+function __get_parent_ib_dev()
+{
+ ib_dev=`ls -l | awk '/'$ppci_dev'/ { print $9 }'`
+}
+
+function __get_parent_net_dev()
+{
+ for netdev in /sys/bus/pci/devices/$ppci_dev/net/* ; do
+ if [ "$port" -eq `cat $netdev/dev_port` ]; then
+ netdev=`basename $netdev`
+ break
+ fi
+ done
+}
+
+function __get_vf_num()
+{
+ pushd /sys/bus/pci/devices/$ppci_dev >/dev/null 2>&1
+ vf=`ls -l virtfn* | awk '/'$pci_dev'/ { print $9 }' | sed -e 's/virtfn//'`
+ popd >/dev/null 2>&1
+}
+
+function __en_sriov_set_vf()
+{
+ pci_dev=$1
+ shift
+ [ "$1" = "port" ] && port=$2 && shift 2
+ # We find our parent device by the netdev registered port number,
+ # however, the netdev port numbers start at 0 while the port
+ # numbers on the card start at 1, so we subtract 1 from our
+ # configured port number to get the netdev number
+ let port--
+ # Now we need to fill in the necessary information to pass to the ip
+ # command
+ __get_parent_pci_dev
+ __get_parent_net_dev
+ __get_vf_num
+ # The rest is easy. Either the user passed valid arguments as options
+ # or they didn't
+ ip link set dev $netdev vf $vf $*
+}
+
+function __ib_sriov_set_vf()
+{
+ pci_dev=$1
+ shift
+ [ "$1" = "port" ] && port=$2 && shift 2
+ guid=""
+ __get_parent_pci_dev
+ __get_parent_ib_dev
+ [ -f $ib_dev/iov/$pci_dev/ports/$port/gid_idx/0 ] || return
+ while [ -n "$1" ]; do
+ case $1 in
+ guid)
+ guid=$2
+ shift 2
+ ;;
+ pkey)
+ shift 1
+ break
+ ;;
+ *)
+ echo "Unknown option in $src"
+ shift
+ ;;
+ esac
+ done
+ if [ -n "$guid" ]; then
+ guid_idx=`cat "$ib_dev/iov/$pci_dev/ports/$port/gid_idx/0"`
+ echo "$guid" > "$ib_dev/iov/ports/$port/admin_guids/$guid_idx"
+ fi
+ i=0
+ while [ -n "$1" ]; do
+ for pkey in $ib_dev/iov/ports/$port/pkeys/*; do
+ if [ `cat $pkey` = "$1" ]; then
+ echo `basename $pkey` > $ib_dev/iov/$pci_dev/ports/$port/pkey_idx/$i
+ let i++
+ break
+ fi
+ done
+ shift
+ done
+}
+
+[ -d /sys/class/infiniband ] || return
+pushd /sys/class/infiniband >/dev/null 2>&1
+
+if [ -z "$*" ]; then
+ src=/etc/rdma/sriov-vfs
+ [ -f "$src" ] || return
+ grep -v "^#" $src | while read -a args; do
+ # When we use read -a to read into an array, the index starts at
+ # 0, unlike below where the arg count starts at 1
+ port=1
+ next_arg=1
+ [ "${args[$next_arg]}" = "port" ] && next_arg=3
+ case ${args[$next_arg]} in
+ guid|pkey)
+ __ib_sriov_set_vf ${args[*]}
+ ;;
+ mac|vlan|rate|spoofchk|enable)
+ __en_sriov_set_vf ${args[*]}
+ ;;
+ *)
+ ;;
+ esac
+ done
+else
+ [ "$2" = "port" ] && next_arg=$4 || next_arg=$2
+ case $next_arg in
+ guid|pkey)
+ __ib_sriov_set_vf $*
+ ;;
+ mac|vlan|rate|spoofchk|enable)
+ __en_sriov_set_vf $*
+ ;;
+ *)
+ ;;
+ esac
+fi
+
+popd >/dev/null 2>&1
diff --git a/glue/redhat/rdma.sriov-vfs b/glue/redhat/rdma.sriov-vfs
new file mode 100644
index 0000000..ef3e6c0
--- /dev/null
+++ b/glue/redhat/rdma.sriov-vfs
@@ -0,0 +1,41 @@
+# All lines in this file that start with a # are comments,
+# all other lines will be processed without argument checks
+# Format of this file is one sriov vf setting per line with
+# arguments as follows:
+# vf [port #] [ethernet settings | infiniband settings]
+#
+# @vf - PCI address of device to configure as found in
+# /sys/bus/pci/devices/
+#
+# [port @port] - Optional: the port number we are setting on
+# the device. We always assume port 1 unless told
+# otherwise.
+#
+# Ethernet settings:
+# mac <mac address> [additional options]
+# @mac - mac address to assign to vf...this is currently required by
+# the ip program if you wish to be able to set any of the other
+# settings. If you don't set anything on a vf, it will get a
+# random mac address and you may use static IP addressing to
+# have a consistent IP address in spite of the random mac
+# @* - additional arguments are passed to ip link without any
+# further processing/checking, additional options that could
+# be passed as of the time of writing this are:
+# [ vlan VLANID [ qos VLAN-QOS ] ]
+# [ rate TXRATE ]
+# [ spoofchk { on | off} ]
+# [ state { auto | enable | disable} ]
+#
+# InfiniBand settings:
+# [guid <guid>] [pkey <space separated list of pkeys>]
+# @guid - 64bit GUID value to assign to vf. Omit this option to
+# use a subnet manager assigned GUID.
+# @pkey - one or more pkeys to assign to this guest, must be last
+# item on line
+#
+# Examples:
+#
+# 0000:44:00.1 guid 05011403007bcba1 pkey 0xffff 0x8002
+# 0000:44:00.1 port 2 mac aa:bb:cc:dd:ee:f0 spoofchk on
+# 0000:44:00.2 port 1 pkey 0x7fff 0x0002
+# 0000:44:00.2 port 2 mac aa:bb:cc:dd:ee:f1 vlan 10 spoofchk on state enable
diff --git a/glue/redhat/rdma.udev-ipoib-naming.rules b/glue/redhat/rdma.udev-ipoib-naming.rules
new file mode 100644
index 0000000..1002470
--- /dev/null
+++ b/glue/redhat/rdma.udev-ipoib-naming.rules
@@ -0,0 +1,13 @@
+# This is a sample udev rules file that demonstrates how to get udev to
+# set the name of IPoIB interfaces to whatever you wish. There is a
+# 16 character limit on network device names though, so don't go too nuts
+#
+# Important items to note: ATTR{type}=="32" is IPoIB interfaces, and the
+# ATTR{address} match must start with ?* and only reference the last 8
+# bytes of the address or else the address might not match on any given
+# start of the IPoIB stack
+#
+# Note: as of rhel7, udev is case sensitive on the address field match
+# and all addresses need to be in lower case.
+#
+# ACTION=="add", SUBSYSTEM=="net", DRIVERS=="?*", ATTR{type}=="32", ATTR{address}=="?*00:02:c9:03:00:31:78:f2", NAME="mlx4_ib3"
diff --git a/glue/redhat/rdma.udev-rules b/glue/redhat/rdma.udev-rules
new file mode 100644
index 0000000..0c7a8fc
--- /dev/null
+++ b/glue/redhat/rdma.udev-rules
@@ -0,0 +1,18 @@
+# We list all the various kernel modules that drive hardware in the
+# InfiniBand stack (and a few in the network stack that might not actually
+# be RDMA capable, but we don't know that at this time and it's safe to
+# enable the IB stack, so do so unilaterally) and on load of any of that
+# hardware, we trigger the rdma.service load in systemd
+
+SUBSYSTEM=="module", KERNEL=="cxgb*", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}="rdma.service"
+SUBSYSTEM=="module", KERNEL=="ib_*", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}="rdma.service"
+SUBSYSTEM=="module", KERNEL=="mlx*", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}="rdma.service"
+SUBSYSTEM=="module", KERNEL=="iw_*", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}="rdma.service"
+SUBSYSTEM=="module", KERNEL=="be2net", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}="rdma.service"
+SUBSYSTEM=="module", KERNEL=="enic", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}="rdma.service"
+
+# When we detect a new verbs device is added to the system, set the node
+# description on that device
+# If rdma-ndd is installed, defer the setting of the node description to it.
+SUBSYSTEM=="infiniband", KERNEL=="*", ACTION=="add", TEST!="/usr/sbin/rdma-ndd", RUN+="/bin/bash -c 'sleep 1; echo -n `hostname -s` %k > /sys/class/infiniband/%k/node_desc'"
+
diff --git a/glue/redhat/srp_daemon.service b/glue/redhat/srp_daemon.service
new file mode 100644
index 0000000..f9c4b1e
--- /dev/null
+++ b/glue/redhat/srp_daemon.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=Start or stop the daemon that attaches to SRP devices
+Documentation=file:///etc/rdma/rdma.conf file:///etc/srp_daemon.conf
+DefaultDependencies=false
+Conflicts=emergency.target emergency.service
+Requires=rdma.service
+Wants=opensm.service
+After=rdma.service opensm.service
+After=network.target
+Before=remote-fs-pre.target
+
+[Service]
+Type=simple
+ExecStart=/usr/sbin/srp_daemon.sh
+
+[Install]
+WantedBy=remote-fs-pre.target
--
2.10.0
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH rdma-core 1/4] rpm spec: install documentation too
From: Jarod Wilson @ 2016-10-14 19:21 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Jarod Wilson
In-Reply-To: <20161014192136.11731-1-jarod-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
At least in the Red Hat world, we like to install the documentation files
provided in a given source tree.
Signed-off-by: Jarod Wilson <jarod-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
rdma-core.spec | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/rdma-core.spec b/rdma-core.spec
index 96c86fe..609b910 100644
--- a/rdma-core.spec
+++ b/rdma-core.spec
@@ -91,6 +91,9 @@ This is a simple example without the split sub packages to get things started.
%install
%cmake_install
+mkdir -p %{buildroot}/%{_docdir}/%{name}-%{version}
+install -m0644 Documentation/{ibacm,ibsrpdm,libibcm,libibverbs,librdmacm,rxe}.md %{buildroot}/%{_docdir}/%{name}-%{version}/
+
%if 0%{?_unitdir:1}
rm -rf %{buildroot}/%{_initrddir}/
%else
@@ -110,6 +113,7 @@ rm -rf %{buildroot}/%{my_unitdir}/
%{_libdir}/rsocket/*
%{_sbindir}/*
%{_libexecdir}/*
+%{_docdir}/%{name}-%{version}/*
%if 0%{?_unitdir:1}
%{_unitdir}/*
%else
--
2.10.0
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH rdma-core 0/4] rdma-core infrastructure
From: Jarod Wilson @ 2016-10-14 19:21 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Jarod Wilson
This is a set of patches to make some minor changes to the stock spec file,
add a bunch of userspace glue that Red Hat has been shipping on it's own in
Red Hat Enterprise Linux and Fedora for a while now, and a revised split
package spec file that we're likely to use in at least RHEL, to preserve the
current packaging split.
Jarod Wilson (4):
rpm spec: install documentation too
glue/redhat: add udev/systemd/etc infrastructure bits
glue/redhat: copy stock spec for RH customization
glue/redhat/spec: build split rpm packages
glue/redhat/ibacm.service | 12 +
glue/redhat/iwpmd.service | 12 +
glue/redhat/rdma-core.spec | 534 +++++++++++++++++++++++++++++++
glue/redhat/rdma.conf | 25 ++
glue/redhat/rdma.cxgb3.sys.modprobe | 1 +
glue/redhat/rdma.cxgb4.sys.modprobe | 1 +
glue/redhat/rdma.fixup-mtrr.awk | 160 +++++++++
glue/redhat/rdma.ifdown-ib | 183 +++++++++++
glue/redhat/rdma.ifup-ib | 308 ++++++++++++++++++
glue/redhat/rdma.kernel-init | 262 +++++++++++++++
glue/redhat/rdma.mlx4-setup.sh | 91 ++++++
glue/redhat/rdma.mlx4.conf | 27 ++
glue/redhat/rdma.mlx4.sys.modprobe | 5 +
glue/redhat/rdma.mlx4.user.modprobe | 21 ++
glue/redhat/rdma.modules-setup.sh | 30 ++
glue/redhat/rdma.service | 15 +
glue/redhat/rdma.sriov-init | 137 ++++++++
glue/redhat/rdma.sriov-vfs | 41 +++
glue/redhat/rdma.udev-ipoib-naming.rules | 13 +
glue/redhat/rdma.udev-rules | 18 ++
glue/redhat/srp_daemon.service | 17 +
rdma-core.spec | 4 +
22 files changed, 1917 insertions(+)
create mode 100644 glue/redhat/ibacm.service
create mode 100644 glue/redhat/iwpmd.service
create mode 100644 glue/redhat/rdma-core.spec
create mode 100644 glue/redhat/rdma.conf
create mode 100644 glue/redhat/rdma.cxgb3.sys.modprobe
create mode 100644 glue/redhat/rdma.cxgb4.sys.modprobe
create mode 100644 glue/redhat/rdma.fixup-mtrr.awk
create mode 100644 glue/redhat/rdma.ifdown-ib
create mode 100644 glue/redhat/rdma.ifup-ib
create mode 100644 glue/redhat/rdma.kernel-init
create mode 100644 glue/redhat/rdma.mlx4-setup.sh
create mode 100644 glue/redhat/rdma.mlx4.conf
create mode 100644 glue/redhat/rdma.mlx4.sys.modprobe
create mode 100644 glue/redhat/rdma.mlx4.user.modprobe
create mode 100644 glue/redhat/rdma.modules-setup.sh
create mode 100644 glue/redhat/rdma.service
create mode 100644 glue/redhat/rdma.sriov-init
create mode 100644 glue/redhat/rdma.sriov-vfs
create mode 100644 glue/redhat/rdma.udev-ipoib-naming.rules
create mode 100644 glue/redhat/rdma.udev-rules
create mode 100644 glue/redhat/srp_daemon.service
--
2.10.0
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [bug] build the user-space stack code in github is fail on ubuntu
From: Jason Gunthorpe @ 2016-10-14 16:48 UTC (permalink / raw)
To: oulijun; +Cc: Leon Romanovsky, linux-rdma, Linuxarm
In-Reply-To: <5800A835.5020207-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
On Fri, Oct 14, 2016 at 05:41:09PM +0800, oulijun wrote:
> > Run Build Command:/usr/sbin/ninja cmTryCompileExec2838577708
I should also point out that ubuntu has two things called ninja, you
want the 'ninja-build' package, not the 'ninja' (eg the /usr/sbin
version).
You probably have to deinstall the ninja package.
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [bug] build the user-space stack code in github is fail on ubuntu
From: Jason Gunthorpe @ 2016-10-14 16:46 UTC (permalink / raw)
To: oulijun; +Cc: Leon Romanovsky, Linuxarm, linux-rdma
In-Reply-To: <5800A467.2020602-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
On Fri, Oct 14, 2016 at 05:24:55PM +0800, oulijun wrote:
> ubuntu@62fe1357a077:~/rdma_core/rdma-core/build_1$ cmake ..
> CMake Error at CMakeLists.txt:199 (message):
> Cannot find libnl-3.0 or libnl-1
There are directions in README.md you need to follow:
$ apt-get install build-essential cmake gcc libnl-3-dev libnl-route-3-dev ninja-build pkg-config valgrind
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: Introduction of libqedr to the Consolidated Userspace RDMA Library Repo
From: Jason Gunthorpe @ 2016-10-14 16:42 UTC (permalink / raw)
To: Amrani, Ram
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Elior, Ariel,
Kalderon, Michal, Borundia, Rajesh,
dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
In-Reply-To: <SN1PR07MB220745646BCC093BCB5A4553F8DF0-mikhvbZlbf8TSoR2DauN2+FPX92sqiQdvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
On Fri, Oct 14, 2016 at 12:53:34PM +0000, Amrani, Ram wrote:
> If I follow correctly, I create a github account, clone
> rdma-plumbing,?add our code onto that and send you a pull request.
Yes.
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: trivial sparse fixes for rdma-core
From: Jason Gunthorpe @ 2016-10-14 16:40 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Leon Romanovsky, linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20161014051843.GB8073-jcswGhMUV9g@public.gmane.org>
On Fri, Oct 14, 2016 at 07:18:43AM +0200, Christoph Hellwig wrote:
> On Fri, Oct 14, 2016 at 07:37:05AM +0300, Leon Romanovsky wrote:
> > I didn't look on it yet, but maybe someone already knows the answer.
> > Can we run static analyzer tools as part of our TravisCI runs?
>
> Just run CC=cgcc cmake for sparse..
We need to run sparse in a pass/fail way for Travis, I use -Werror to
do this for gcc.
The sparse version easially installable in travis is 0.4.5~rc1, if we
need newer then we have to find an APT repository with it built for
trusty.
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH v3] IB/ipoib: move back IB LL address into the hard header
From: David Miller @ 2016-10-14 14:55 UTC (permalink / raw)
To: pabeni; +Cc: linux-rdma, dledford, sean.hefty, hal.rosenstock, jgunthorpe,
netdev
In-Reply-To: <9fce9b87ecc4c5c4f03401359806f40b1dcd0eb3.1476374992.git.pabeni@redhat.com>
From: Paolo Abeni <pabeni@redhat.com>
Date: Thu, 13 Oct 2016 18:26:56 +0200
> After the commit 9207f9d45b0a ("net: preserve IP control block
> during GSO segmentation"), the GSO CB and the IPoIB CB conflict.
> That destroy the IPoIB address information cached there,
> causing a severe performance regression, as better described here:
>
> http://marc.info/?l=linux-kernel&m=146787279825501&w=2
>
> This change moves the data cached by the IPoIB driver from the
> skb control lock into the IPoIB hard header, as done before
> the commit 936d7de3d736 ("IPoIB: Stop lying about hard_header_len
> and use skb->cb to stash LL addresses").
> In order to avoid GRO issue, on packet reception, the IPoIB driver
> stash into the skb a dummy pseudo header, so that the received
> packets have actually a hard header matching the declared length.
> To avoid changing the connected mode maximum mtu, the allocated
> head buffer size is increased by the pseudo header length.
>
> After this commit, IPoIB performances are back to pre-regression
> value.
>
> v2 -> v3: rebased
> v1 -> v2: avoid changing the max mtu, increasing the head buf size
>
> Fixes: 9207f9d45b0a ("net: preserve IP control block during GSO segmentation")
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Applied and queued up for -stable, thanks.
^ permalink raw reply
* Re: [PATCH v3] IB/ipoib: move back IB LL address into the hard header
From: Paolo Abeni @ 2016-10-14 14:48 UTC (permalink / raw)
To: Or Gerlitz
Cc: David Miller, Doug Ledford, Erez Shitrit, Alex Vesker,
linux-rdma@vger.kernel.org, Sean Hefty, Hal Rosenstock,
Jason Gunthorpe, Linux Netdev List, talal@mellanox.com
In-Reply-To: <CAJ3xEMi7DY7_3vM+553dC4w17W==CdUdtn5PdzzCCUxtj434dQ@mail.gmail.com>
On Fri, 2016-10-14 at 13:23 +0300, Or Gerlitz wrote:
>
> Paolo,
>
> Is this fix backportable to any kernel since the breakage?
yes, AFAIK this is beck-portable.
> AFAIR,
> Roland mentioned
> that a 2nd change introduced in 4.7-rc1 changed things a bit more such
> that the fix
> he had in his head didn't apply any more.
If you refer to shrinking both IPoIB and gso control buffer, as proposed
by Roland in:
http://marc.info/?l=linux-kernel&m=146787279825501&w=2
that will not work, since the gso control buffer is grown a bit since
the first time the bug was detected.
This patch does not have that sort of issue.
> I am still travelling after netdev and would like to put an eye on the
> patch and also see that @mellanox.com someone
Not sure if that helps, but a 3rd party has already confirmed privately
that this patch fixes the bug for them.
Paolo
^ permalink raw reply
* Re: [PATCH net-next 00/11] net: Fix netdev adjacency tracking
From: David Miller @ 2016-10-14 14:17 UTC (permalink / raw)
To: dsa-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR
Cc: jiri-VPRAkNaXOzVWk0Htik3J/w, netdev-u79uwXL29TY76Z2rM5mHXA,
dledford-H+wXaHxf7aLQT0dZR+AlfA,
sean.hefty-ral2JQCrhuEAvxtiuMwx3w,
hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w,
linux-rdma-u79uwXL29TY76Z2rM5mHXA,
j.vosburgh-Re5JQEeQqe8AvxtiuMwx3w, vfalico-Re5JQEeQqe8AvxtiuMwx3w,
andy-QlMahl40kYEqcZcGjlUOXw,
jeffrey.t.kirsher-ral2JQCrhuEAvxtiuMwx3w,
intel-wired-lan-qjLDD68F18P21nG7glBr7A
In-Reply-To: <1476305519-28833-1-git-send-email-dsa-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org>
From: David Ahern <dsa-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org>
Date: Wed, 12 Oct 2016 13:51:48 -0700
> The netdev adjacency tracking is failing to create proper dependencies
> for some topologies. For example this topology
>
> +--------+
> | myvrf |
> +--------+
> | |
> | +---------+
> | | macvlan |
> | +---------+
> | |
> +----------+
> | bridge |
> +----------+
> |
> +--------+
> | bond0 |
> +--------+
> |
> +--------+
> | eth3 |
> +--------+
>
> hits 1 of 2 problems depending on the order of enslavement. The base set of
> commands for both cases:
>
> ip link add bond1 type bond
> ip link set bond1 up
Your diagram uses the device name "bond0" but all of your command examples
use "bond1". Please fix this up, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: Introduction of libqedr to the Consolidated Userspace RDMA Library Repo
From: Amrani, Ram @ 2016-10-14 12:53 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Elior, Ariel,
Kalderon, Michal, Borundia, Rajesh,
dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
In-Reply-To: <20161013162942.GA5468-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
>Yes, many of the drivers copied the same stuff that is now gone. Here
>is a sampling
>
>https://github.com/linux-rdma/rdma-core/commit/1df0888f6a736e1612ce8b054d6c17651ebd003f
>https://github.com/linux-rdma/rdma-core/commit/6771a2051ea5efd30e142866f722d2dae6f565a7
>https://github.com/linux-rdma/rdma-core/commit/f29b3285f82815da3abdfea5be5c4f2d1ca92743
>https://github.com/linux-rdma/rdma-core/commit/9358a8a5484d1caa0c7ad1826e07d2105f58cc4e
>https://github.com/linux-rdma/rdma-core/commit/c5c7e32796b19c3707620a3d2f6b32d00d2fbc3c
OK, this is more clear to me now. I'll look up the git log to see if there are other relevant cleanups.
>You don't need a server, just a personal github account.
Oh, that sounds much simpler. I'll give it a try.
If I follow correctly, I create a github account, clone rdma-plumbing, add our code onto that
and send you a pull request.
Thanks,
Ram
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [bug] build the user-space stack code in github is fail on ubuntu
From: Leon Romanovsky @ 2016-10-14 11:56 UTC (permalink / raw)
To: oulijun; +Cc: linux-rdma, Linuxarm
In-Reply-To: <5800A835.5020207-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 2172 bytes --]
On Fri, Oct 14, 2016 at 05:41:09PM +0800, oulijun wrote:
> Sorry, it is my careless.
>
> it is fail for building rdma-core branch.
> build environment: ubuntu
>
> is the user-space stack in github not support to ubuntu?
>
> when use cmake build, the bug is as follows:
> ubuntu@62fe1357a077:~/rdma_core/rdma-core/build_1$ cmake ..
> -- Found PkgConfig: /usr/bin/pkg-config (found version "0.26")
> -- checking for modules 'libnl-3.0;libnl-route-3.0'
> -- found libnl-3.0, version 3.2.21
> -- found libnl-route-3.0, version 3.2.21
> -- Check size of long
> -- Check size of long - done
> -- Looking for rdma/rdma_user_rxe.h
> -- Looking for rdma/rdma_user_rxe.h - not found
> -- Looking for valgrind/memcheck.h
> -- Looking for valgrind/memcheck.h - found
> -- Looking for valgrind/drd.h
> -- Looking for valgrind/drd.h - found
> -- Performing Test LIBC_HAS_LIBRT
> -- Performing Test LIBC_HAS_LIBRT - Success
> -- Missing Optional Items:
> -- rdma/rdma_user_rxe.h NOT found (old system kernel headers)
> -- -Wmissing-field-initializers does NOT work
> -- Configuring done
> -- Generating done
> -- Build files have been written to: /home/ubuntu/rdma_core/rdma-core/build_1
>
> but if i directly use the build.sh, the log as fllows:
> -- The C compiler identification is GNU 4.8.4
> -- Check for working C compiler using: Ninja
> -- Check for working C compiler using: Ninja -- broken
> CMake Error at /usr/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message):
> The C compiler "/usr/bin/cc" is not able to compile a simple test program.
>
> It fails with the following output:
>
> Change Dir: /home/ubuntu/rdma_core/rdma-core/build/CMakeFiles/CMakeTmp
>
>
>
> Run Build Command:/usr/sbin/ninja cmTryCompileExec2838577708
>
> log: reading configuration file: cmTryCompileExec2838577708
>
>
>
> die: error: unable to read configuration file
>
>
>
> CMake will not be able to correctly generate this project.
> Call Stack (most recent call first):
> CMakeLists.txt:24 (project)
>
>
> -- Configuring incomplete, errors occurred!
According to error log, you didn't install ninja build system.
sudo apt-get install ninja-build
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: 【For help】 some tips for upstream the userspace driver code of hns_roce
From: Leon Romanovsky @ 2016-10-14 11:55 UTC (permalink / raw)
To: oulijun; +Cc: Doug Ledford, Linuxarm, linux-rdma
In-Reply-To: <58008835.3060403-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 440 bytes --]
On Fri, Oct 14, 2016 at 03:24:37PM +0800, oulijun wrote:
> Hi, Leon
> I have learned the guide and I am working it.
> I have learned the README.md in the branch of rdma-core.
> According to the instruction for building the user-space stack, it only
> support to build in Debian/Fedora/OpenSuSE/centos and ubuntu is not?
Did you install all required tools as mentioned in the readme?
I'm using Ubuntu and it builds on it perfectly.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox