[Pkg-ofed-commits] [librdmacm] 05/18: Imported Upstream version 1.0.8
Ana Beatriz Guerrero López
ana at moszumanska.debian.org
Wed Jul 2 13:58:24 UTC 2014
This is an automated email from the git hooks/post-receive script.
ana pushed a commit to branch master
in repository librdmacm.
commit 30300d9f49c3704cba5755022a2f433ca5287e24
Author: Ana Guerrero López <ana at ekaia.org>
Date: Wed Jul 2 15:58:06 2014 +0200
Imported Upstream version 1.0.8
---
configure | 20 ++++++++---------
configure.in | 4 ++--
examples/cmatose.c | 11 ++++++---
examples/rping.c | 60 ++++++++++++++++++++++++++++---------------------
examples/udaddy.c | 7 +++---
include/rdma/rdma_cma.h | 46 ++++++++++++++++++++-----------------
librdmacm.spec | 4 ++--
librdmacm.spec.in | 2 +-
man/rdma_bind_addr.3 | 4 ++--
man/rdma_get_cm_event.3 | 10 +++++++++
src/cma.c | 4 ++++
11 files changed, 103 insertions(+), 69 deletions(-)
diff --git a/configure b/configure
index 64ffbbf..ea33723 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for librdmacm 1.0.7.
+# Generated by GNU Autoconf 2.59 for librdmacm 1.0.8.
#
# Report bugs to <general at lists.openfabrics.org>.
#
@@ -423,8 +423,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='librdmacm'
PACKAGE_TARNAME='librdmacm'
-PACKAGE_VERSION='1.0.7'
-PACKAGE_STRING='librdmacm 1.0.7'
+PACKAGE_VERSION='1.0.8'
+PACKAGE_STRING='librdmacm 1.0.8'
PACKAGE_BUGREPORT='general at lists.openfabrics.org'
ac_unique_file="src/cma.c"
@@ -954,7 +954,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures librdmacm 1.0.7 to adapt to many kinds of systems.
+\`configure' configures librdmacm 1.0.8 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1020,7 +1020,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of librdmacm 1.0.7:";;
+ short | recursive ) echo "Configuration of librdmacm 1.0.8:";;
esac
cat <<\_ACEOF
@@ -1161,7 +1161,7 @@ fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-librdmacm configure 1.0.7
+librdmacm configure 1.0.8
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@@ -1175,7 +1175,7 @@ cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by librdmacm $as_me 1.0.7, which was
+It was created by librdmacm $as_me 1.0.8, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -1821,7 +1821,7 @@ fi
# Define the identity of the package.
PACKAGE=librdmacm
- VERSION=1.0.7
+ VERSION=1.0.8
cat >>confdefs.h <<_ACEOF
@@ -20908,7 +20908,7 @@ _ASBOX
} >&5
cat >&5 <<_CSEOF
-This file was extended by librdmacm $as_me 1.0.7, which was
+This file was extended by librdmacm $as_me 1.0.8, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -20971,7 +20971,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-librdmacm config.status 1.0.7
+librdmacm config.status 1.0.8
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
diff --git a/configure.in b/configure.in
index 54a9c96..c06f65e 100644
--- a/configure.in
+++ b/configure.in
@@ -1,11 +1,11 @@
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
-AC_INIT(librdmacm, 1.0.7, general at lists.openfabrics.org)
+AC_INIT(librdmacm, 1.0.8, general at lists.openfabrics.org)
AC_CONFIG_SRCDIR([src/cma.c])
AC_CONFIG_AUX_DIR(config)
AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(librdmacm, 1.0.7)
+AM_INIT_AUTOMAKE(librdmacm, 1.0.8)
AM_PROG_LIBTOOL
diff --git a/examples/cmatose.c b/examples/cmatose.c
index 2f6e5f6..ba6299e 100644
--- a/examples/cmatose.c
+++ b/examples/cmatose.c
@@ -80,6 +80,7 @@ static struct cmatest test;
static int connections = 1;
static int message_size = 100;
static int message_count = 10;
+static uint16_t port = 7471;
static uint8_t set_tos = 0;
static uint8_t tos;
static uint8_t migrate = 0;
@@ -536,7 +537,7 @@ static int run_server(void)
} else
test.src_in.sin_family = PF_INET;
- test.src_in.sin_port = 7471;
+ test.src_in.sin_port = port;
ret = rdma_bind_addr(listen_id, test.src_addr);
if (ret) {
printf("cmatose: bind address failed: %d\n", ret);
@@ -613,7 +614,7 @@ static int run_client(void)
if (ret)
return ret;
- test.dst_in.sin_port = 7471;
+ test.dst_in.sin_port = port;
printf("cmatose: connecting\n");
for (i = 0; i < connections; i++) {
@@ -666,7 +667,7 @@ int main(int argc, char **argv)
{
int op, ret;
- while ((op = getopt(argc, argv, "s:b:c:C:S:t:m")) != -1) {
+ while ((op = getopt(argc, argv, "s:b:c:C:S:t:p:m")) != -1) {
switch (op) {
case 's':
dst_addr = optarg;
@@ -687,6 +688,9 @@ int main(int argc, char **argv)
set_tos = 1;
tos = (uint8_t) atoi(optarg);
break;
+ case 'p':
+ port = atoi(optarg);
+ break;
case 'm':
migrate = 1;
break;
@@ -698,6 +702,7 @@ int main(int argc, char **argv)
printf("\t[-C message_count]\n");
printf("\t[-S message_size]\n");
printf("\t[-t type_of_service]\n");
+ printf("\t[-p port_number]\n");
printf("\t[-m(igrate)]\n");
exit(1);
}
diff --git a/examples/rping.c b/examples/rping.c
index 983ce1c..f5dd701 100644
--- a/examples/rping.c
+++ b/examples/rping.c
@@ -123,7 +123,7 @@ struct rping_cb {
struct rping_rdma_info recv_buf;/* malloc'd buffer */
struct ibv_mr *recv_mr; /* MR associated with this buffer */
- struct ibv_send_wr sq_wr; /* send work requrest record */
+ struct ibv_send_wr sq_wr; /* send work request record */
struct ibv_sge send_sgl;
struct rping_rdma_info send_buf;/* single send buf */
struct ibv_mr *send_mr;
@@ -143,9 +143,8 @@ struct rping_cb {
enum test_state state; /* used for cond/signalling */
sem_t sem;
+ struct sockaddr_in sin;
uint16_t port; /* dst port in NBO */
- uint32_t addr; /* dst addr in NBO */
- char *addr_str; /* dst addr string */
int verbose; /* verbose logging */
int count; /* ping count */
int size; /* ping data size */
@@ -227,9 +226,8 @@ static int rping_cma_event_handler(struct rdma_cm_id *cma_id,
break;
default:
- fprintf(stderr, "oof bad type!\n");
- sem_post(&cb->sem);
- ret = -1;
+ fprintf(stderr, "unhandled event: %s, ignoring\n",
+ rdma_event_str(event->event));
break;
}
@@ -600,7 +598,7 @@ static void *cq_thread(void *arg)
pthread_exit(NULL);
}
if (ev_cq != cb->cq) {
- fprintf(stderr, "Unkown CQ!\n");
+ fprintf(stderr, "Unknown CQ!\n");
pthread_exit(NULL);
}
ret = ibv_req_notify_cq(cb->cq, 0);
@@ -729,15 +727,10 @@ static int rping_test_server(struct rping_cb *cb)
static int rping_bind_server(struct rping_cb *cb)
{
- struct sockaddr_in sin;
int ret;
- memset(&sin, 0, sizeof(sin));
- sin.sin_family = AF_INET;
- sin.sin_addr.s_addr = cb->addr;
- sin.sin_port = cb->port;
-
- ret = rdma_bind_addr(cb->cm_id, (struct sockaddr *) &sin);
+ cb->sin.sin_port = cb->port;
+ ret = rdma_bind_addr(cb->cm_id, (struct sockaddr *) &cb->sin);
if (ret) {
fprintf(stderr, "rdma_bind_addr error %d\n", ret);
return ret;
@@ -997,16 +990,10 @@ static int rping_connect_client(struct rping_cb *cb)
static int rping_bind_client(struct rping_cb *cb)
{
- struct sockaddr_in sin;
int ret;
- memset(&sin, 0, sizeof(sin));
- sin.sin_family = AF_INET;
- sin.sin_addr.s_addr = cb->addr;
- sin.sin_port = cb->port;
-
- ret = rdma_resolve_addr(cb->cm_id, NULL, (struct sockaddr *) &sin,
- 2000);
+ cb->sin.sin_port = cb->port;
+ ret = rdma_resolve_addr(cb->cm_id, NULL, (struct sockaddr *) &cb->sin, 2000);
if (ret) {
fprintf(stderr, "rdma_resolve_addr error %d\n", ret);
return ret;
@@ -1068,6 +1055,28 @@ err1:
return ret;
}
+static int get_addr(char *dst, struct sockaddr_in *addr)
+{
+ struct addrinfo *res;
+ int ret;
+
+ ret = getaddrinfo(dst, NULL, NULL, &res);
+ if (ret) {
+ printf("getaddrinfo failed - invalid hostname or IP address\n");
+ return ret;
+ }
+
+ if (res->ai_family != PF_INET) {
+ ret = -1;
+ goto out;
+ }
+
+ *addr = *(struct sockaddr_in *) res->ai_addr;
+out:
+ freeaddrinfo(res);
+ return ret;
+}
+
static void usage(char *name)
{
printf("%s -s [-vVd] [-S size] [-C count] [-a addr] [-p port]\n",
@@ -1101,6 +1110,7 @@ int main(int argc, char *argv[])
cb->server = -1;
cb->state = IDLE;
cb->size = 64;
+ cb->sin.sin_family = PF_INET;
cb->port = htons(7174);
sem_init(&cb->sem, 0, 0);
@@ -1108,9 +1118,7 @@ int main(int argc, char *argv[])
while ((op=getopt(argc, argv, "a:Pp:C:S:t:scvVd")) != -1) {
switch (op) {
case 'a':
- cb->addr_str = optarg;
- cb->addr = inet_addr(optarg);
- DEBUG_LOG("ipaddr (%s)\n", optarg);
+ ret = get_addr(optarg, &cb->sin);
break;
case 'P':
persistent_server = 1;
@@ -1161,7 +1169,7 @@ int main(int argc, char *argv[])
default:
usage("rping");
ret = EINVAL;
- break;
+ goto out;
}
}
if (ret)
diff --git a/examples/udaddy.c b/examples/udaddy.c
index 60d9e16..0d69b05 100644
--- a/examples/udaddy.c
+++ b/examples/udaddy.c
@@ -74,6 +74,7 @@ static struct cmatest test;
static int connections = 1;
static int message_size = 100;
static int message_count = 10;
+static uint16_t port = 7174;
static uint8_t set_tos = 0;
static uint8_t tos;
static char *dst_addr;
@@ -244,7 +245,7 @@ static int addr_handler(struct cmatest_node *node)
ret = rdma_set_option(node->cma_id, RDMA_OPTION_ID,
RDMA_OPTION_ID_TOS, &tos, sizeof tos);
if (ret)
- printf("cmatose: set TOS option failed: %d\n", ret);
+ printf("udaddy: set TOS option failed: %d\n", ret);
}
ret = rdma_resolve_route(node->cma_id, 2000);
@@ -542,7 +543,7 @@ static int run_server(void)
} else
test.src_in.sin_family = PF_INET;
- test.src_in.sin_port = 7174;
+ test.src_in.sin_port = port;
ret = rdma_bind_addr(listen_id, test.src_addr);
if (ret) {
printf("udaddy: bind address failed: %d\n", ret);
@@ -595,7 +596,7 @@ static int run_client(void)
if (ret)
return ret;
- test.dst_in.sin_port = 7174;
+ test.dst_in.sin_port = port;
printf("udaddy: connecting\n");
for (i = 0; i < connections; i++) {
diff --git a/include/rdma/rdma_cma.h b/include/rdma/rdma_cma.h
index 76df90f..534489d 100644
--- a/include/rdma/rdma_cma.h
+++ b/include/rdma/rdma_cma.h
@@ -2,29 +2,33 @@
* Copyright (c) 2005 Voltaire Inc. All rights reserved.
* Copyright (c) 2005-2007 Intel Corporation. All rights reserved.
*
- * This Software is licensed under one of the following licenses:
+ * This software is available to you under a choice of one of two
+ * licenses. You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
*
- * 1) under the terms of the "Common Public License 1.0" a copy of which is
- * available from the Open Source Initiative, see
- * http://www.opensource.org/licenses/cpl.php.
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
*
- * 2) under the terms of the "The BSD License" a copy of which is
- * available from the Open Source Initiative, see
- * http://www.opensource.org/licenses/bsd-license.php.
+ * - Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer.
*
- * 3) under the terms of the "GNU General Public License (GPL) Version 2" a
- * copy of which is available from the Open Source Initiative, see
- * http://www.opensource.org/licenses/gpl-license.php.
- *
- * Licensee has the right to choose one of the above licenses.
- *
- * Redistributions of source code must retain the above copyright
- * notice and one of the license notices.
- *
- * Redistributions in binary form must reproduce both the above copyright
- * notice, one of the license notices in the documentation
- * and/or other materials provided with the distribution.
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
*
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*/
#if !defined(RDMA_CMA_H)
@@ -57,7 +61,9 @@ enum rdma_cm_event_type {
RDMA_CM_EVENT_DISCONNECTED,
RDMA_CM_EVENT_DEVICE_REMOVAL,
RDMA_CM_EVENT_MULTICAST_JOIN,
- RDMA_CM_EVENT_MULTICAST_ERROR
+ RDMA_CM_EVENT_MULTICAST_ERROR,
+ RDMA_CM_EVENT_ADDR_CHANGE,
+ RDMA_CM_EVENT_TIMEWAIT_EXIT
};
enum rdma_port_space {
diff --git a/librdmacm.spec b/librdmacm.spec
index ddb14dd..cef1016 100644
--- a/librdmacm.spec
+++ b/librdmacm.spec
@@ -1,7 +1,7 @@
-%define ver 1.0.7
+%define ver 1.0.8
Name: librdmacm
-Version: 1.0.7
+Version: 1.0.8
Release: 1%{?dist}
Summary: Userspace RDMA Connection Manager
diff --git a/librdmacm.spec.in b/librdmacm.spec.in
index 998dfc3..2c873c4 100644
--- a/librdmacm.spec.in
+++ b/librdmacm.spec.in
@@ -1,7 +1,7 @@
%define ver @VERSION@
Name: librdmacm
-Version: 1.0.7
+Version: 1.0.8
Release: 1%{?dist}
Summary: Userspace RDMA Connection Manager
diff --git a/man/rdma_bind_addr.3 b/man/rdma_bind_addr.3
index 46c48a3..06f30ce 100644
--- a/man/rdma_bind_addr.3
+++ b/man/rdma_bind_addr.3
@@ -22,8 +22,8 @@ to a specific port number, but it may also be called on the active side
of a connection before calling rdma_resolve_addr to bind to a specific
address.
.P
-If used to bind to port 0, the rdma_cm will select an available port
-and return it to the user.
+If used to bind to port 0, the rdma_cm will select an available port,
+which can be retrieved with rdma_get_src_port(3).
.SH "SEE ALSO"
rdma_create_id(3), rdma_listen(3), rdma_resolve_addr(3), rdma_create_qp(3),
rdma_get_local_addr(3), rdma_get_src_port(3)
diff --git a/man/rdma_get_cm_event.3 b/man/rdma_get_cm_event.3
index 1ba8797..79bf606 100644
--- a/man/rdma_get_cm_event.3
+++ b/man/rdma_get_cm_event.3
@@ -140,6 +140,16 @@ The multicast join operation (rdma_join_multicast) completed successfully.
An error either occurred joining a multicast group, or, if the group had
already been joined, on an existing group. The specified multicast group is
no longer accessible and should be rejoined, if desired.
+.IP RDMA_CM_EVENT_ADDR_CHANGE
+The network device associated with this ID through address resolution changed
+its HW address, eg following of bonding failover. This event can serve as a
+hint for applications who want the links used for their RDMA sessions to
+align with the network stack.
+.IP RDMA_CM_EVENT_TIMEWAIT_EXIT
+The QP associated with a connection has exited its timewait state and is now
+ready to be re-used. After a QP has been disconnected, it is maintained in
+a timewait state to allow any in flight packets to exit the network. After
+the timewait state has completed, the rdma_cm will report this event.
.SH "SEE ALSO"
rdma_ack_cm_event(3), rdma_create_event_channel(3), rdma_resolve_addr(3),
rdma_resolve_route(3), rdma_connect(3), rdma_listen(3), rdma_join_multicast(3),
diff --git a/src/cma.c b/src/cma.c
index fc98c8f..d4441ce 100644
--- a/src/cma.c
+++ b/src/cma.c
@@ -1438,6 +1438,10 @@ const char *rdma_event_str(enum rdma_cm_event_type event)
return "RDMA_CM_EVENT_MULTICAST_JOIN";
case RDMA_CM_EVENT_MULTICAST_ERROR:
return "RDMA_CM_EVENT_MULTICAST_ERROR";
+ case RDMA_CM_EVENT_ADDR_CHANGE:
+ return "RDMA_CM_EVENT_ADDR_CHANGE";
+ case RDMA_CM_EVENT_TIMEWAIT_EXIT:
+ return "RDMA_CM_EVENT_TIMEWAIT_EXIT";
default:
return "UNKNOWN EVENT";
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ofed/librdmacm.git
More information about the Pkg-ofed-commits
mailing list