From 7388e422ebc57afa15741fe5ef9cee7b8edf7949 Mon Sep 17 00:00:00 2001 From: Sean Hefty Date: Tue, 6 Oct 2015 13:18:49 -0700 Subject: [PATCH] import --- meta | 7 +- patches/librdmacm-examples-r-io-stream | 47 +++++ patches/librdmacm-examples-use | 271 +++++++++++++++++++++++++ patches/librdmacm-rstream-c-use-proper | 27 +++ 4 files changed, 350 insertions(+), 2 deletions(-) create mode 100644 patches/librdmacm-examples-r-io-stream create mode 100644 patches/librdmacm-examples-use create mode 100644 patches/librdmacm-rstream-c-use-proper diff --git a/meta b/meta index f5290682..90299d6b 100644 --- a/meta +++ b/meta @@ -1,7 +1,10 @@ Version: 1 -Previous: 0225f07ea42c91dc08172ae8c9ce926b208e6649 -Head: fe4cc839e08a300b25592d16018bc904784e27ca +Previous: e4cce3a6998d6f593eb413cf9081aab8c8411382 +Head: 032bbe60ad32d59004447e03061a9f6d632cc55f Applied: + librdmacm-examples-use: c9ac6566b26c1402b2febe4f86a8d1025ee4c615 + librdmacm-rstream-c-use-proper: d92a480f0617ef93414bcbc996e51bdc27497c8a + librdmacm-examples-r-io-stream: 032bbe60ad32d59004447e03061a9f6d632cc55f Unapplied: bundle-18601-cma.mbox: 9b3ee24ae8f345ebcf7e977f766478126964619f raccept-invalid: 8d5251952074622e8be0c9828d5eb573b4a1c6d2 diff --git a/patches/librdmacm-examples-r-io-stream b/patches/librdmacm-examples-r-io-stream new file mode 100644 index 00000000..90a8e382 --- /dev/null +++ b/patches/librdmacm-examples-r-io-stream @@ -0,0 +1,47 @@ +Bottom: 00f44f686c92b3acfcdfe35b25d054cbebb5586b +Top: 5052d2075e5374773b258f1a88c3f2208f44218e +Author: Hal Rosenstock +Date: 2015-09-30 09:06:06 -0400 + +[librdmacm] examples/r[io]stream.c: Better handling of rpoll errors during client async rconnect + +Rather than silently exiting when connection is refused by server, +print error message (Connection refused) during async rconnect at client. + +Signed-off-by: Hal Rosenstock + + +--- + +diff --git a/examples/riostream.c b/examples/riostream.c +index 82dcd59..326028a 100644 +--- a/examples/riostream.c ++++ b/examples/riostream.c +@@ -470,8 +470,10 @@ static int client_connect(void) + fds.fd = rs; + fds.events = POLLOUT; + ret = do_poll(&fds, poll_timeout); +- if (ret) ++ if (ret) { ++ perror("rpoll"); + goto close; ++ } + + len = sizeof err; + ret = rgetsockopt(rs, SOL_SOCKET, SO_ERROR, &err, &len); +diff --git a/examples/rstream.c b/examples/rstream.c +index 34144b2..8e1e730 100644 +--- a/examples/rstream.c ++++ b/examples/rstream.c +@@ -469,8 +469,10 @@ static int client_connect(void) + fds.fd = rs; + fds.events = POLLOUT; + ret = do_poll(&fds, poll_timeout); +- if (ret) ++ if (ret) { ++ perror("rpoll"); + goto close; ++ } + + len = sizeof err; + ret = rs_getsockopt(rs, SOL_SOCKET, SO_ERROR, &err, &len); diff --git a/patches/librdmacm-examples-use b/patches/librdmacm-examples-use new file mode 100644 index 00000000..a038d50e --- /dev/null +++ b/patches/librdmacm-examples-use @@ -0,0 +1,271 @@ +Bottom: e67fb3e005c80605dc4de4f7a7b0db6221336c4b +Top: bf944a14b33ae10dba3d15c130307c7f22369866 +Author: Hal Rosenstock +Date: 2015-09-30 09:02:04 -0400 + +[librdmacm] examples: Use gai_strerror rather than perror for [rdma_]getaddrinfo failures + +[rdma_]getaddrinfo error codes are decoded by gai_strerror (and not +set in errno) so replace perror calls following these failed calls. + +Signed-off-by: Hal Rosenstock + + +--- + +diff --git a/examples/cmatose.c b/examples/cmatose.c +index ab3e746..d7bd92d 100644 +--- a/examples/cmatose.c ++++ b/examples/cmatose.c +@@ -509,7 +509,7 @@ static int run_server(void) + + ret = get_rdma_addr(src_addr, dst_addr, port, &hints, &test.rai); + if (ret) { +- perror("cmatose: getrdmaaddr error"); ++ printf("cmatose: getrdmaaddr error: %s\n", gai_strerror(ret)); + goto out; + } + +@@ -582,7 +582,7 @@ static int run_client(void) + + ret = get_rdma_addr(src_addr, dst_addr, port, &hints, &test.rai); + if (ret) { +- perror("cmatose: getaddrinfo error"); ++ printf("cmatose: getaddrinfo error: %s\n", gai_strerror(ret)); + return ret; + } + +diff --git a/examples/cmtime.c b/examples/cmtime.c +index ebc660b..e45980b 100644 +--- a/examples/cmtime.c ++++ b/examples/cmtime.c +@@ -479,7 +479,7 @@ static int run_server(void) + + ret = get_rdma_addr(src_addr, dst_addr, port, &hints, &rai); + if (ret) { +- perror("getrdmaaddr error"); ++ printf("getrdmaaddr error: %s\n", gai_strerror(ret)); + goto out; + } + +@@ -508,7 +508,7 @@ static int run_client(void) + + ret = get_rdma_addr(src_addr, dst_addr, port, &hints, &rai); + if (ret) { +- perror("getaddrinfo error"); ++ printf("getaddrinfo error: %s\n", gai_strerror(ret)); + return ret; + } + +diff --git a/examples/mckey.c b/examples/mckey.c +index a6b5c4d..2032aa9 100644 +--- a/examples/mckey.c ++++ b/examples/mckey.c +@@ -452,7 +452,7 @@ static int get_addr(char *dst, struct sockaddr *addr) + + ret = getaddrinfo(dst, NULL, NULL, &res); + if (ret) { +- printf("getaddrinfo failed - invalid hostname or IP address\n"); ++ printf("getaddrinfo failed (%s) - invalid hostname or IP address\n", gai_strerror(ret)); + return ret; + } + +diff --git a/examples/rcopy.c b/examples/rcopy.c +index 152acef..085b017 100644 +--- a/examples/rcopy.c ++++ b/examples/rcopy.c +@@ -186,7 +186,7 @@ static int server_listen(void) + hints.ai_flags = RAI_PASSIVE; + ret = getaddrinfo(NULL, port, &hints, &res); + if (ret) { +- perror("getaddrinfo failed\n"); ++ printf("getaddrinfo failed: %s\n", gai_strerror(ret)); + return ret; + } + +@@ -396,7 +396,7 @@ static int client_connect(void) + + ret = getaddrinfo(dst_addr, port, NULL, &res); + if (ret) { +- perror("getaddrinfo failed\n"); ++ printf("getaddrinfo failed: %s\n", gai_strerror(ret)); + return ret; + } + +diff --git a/examples/rdma_client.c b/examples/rdma_client.c +index f676b70..d7f65f5 100644 +--- a/examples/rdma_client.c ++++ b/examples/rdma_client.c +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -55,7 +56,7 @@ static int run(void) + hints.ai_port_space = RDMA_PS_TCP; + ret = rdma_getaddrinfo(server, port, &hints, &res); + if (ret) { +- perror("rdma_getaddrinfo"); ++ printf("rdma_getaddrinfo: %s\n", gai_strerror(ret)); + goto out; + } + +diff --git a/examples/rdma_server.c b/examples/rdma_server.c +index 129cf42..d98d11a 100644 +--- a/examples/rdma_server.c ++++ b/examples/rdma_server.c +@@ -57,7 +57,7 @@ static int run(void) + hints.ai_port_space = RDMA_PS_TCP; + ret = rdma_getaddrinfo(NULL, port, &hints, &res); + if (ret) { +- perror("rdma_getaddrinfo"); ++ printf("rdma_getaddrinfo: %s\n", gai_strerror(ret)); + return ret; + } + +diff --git a/examples/rdma_xclient.c b/examples/rdma_xclient.c +index 6510408..8dba266 100644 +--- a/examples/rdma_xclient.c ++++ b/examples/rdma_xclient.c +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -80,7 +81,7 @@ static int test(void) + + ret = rdma_getaddrinfo(server, port, &hints, &res); + if (ret) { +- perror("rdma_getaddrinfo"); ++ printf("rdma_getaddrinfo: %s\n", gai_strerror(ret)); + return ret; + } + +diff --git a/examples/rdma_xserver.c b/examples/rdma_xserver.c +index d30c88e..69f170b 100644 +--- a/examples/rdma_xserver.c ++++ b/examples/rdma_xserver.c +@@ -78,7 +78,7 @@ static int test(void) + + ret = rdma_getaddrinfo(NULL, port, &hints, &res); + if (ret) { +- perror("rdma_getaddrinfo"); ++ printf("rdma_getaddrinfo: %s\n", gai_strerror(ret)); + return ret; + } + +diff --git a/examples/riostream.c b/examples/riostream.c +index c12dd0d..82dcd59 100644 +--- a/examples/riostream.c ++++ b/examples/riostream.c +@@ -363,7 +363,7 @@ static int server_listen(void) + ret = getaddrinfo(src_addr, port, &ai_hints, &ai); + } + if (ret) { +- perror("getaddrinfo"); ++ printf("getaddrinfo: %s\n", gai_strerror(ret)); + return ret; + } + +@@ -444,7 +444,7 @@ static int client_connect(void) + ret = use_rgai ? rdma_getaddrinfo(dst_addr, port, &rai_hints, &rai) : + getaddrinfo(dst_addr, port, &ai_hints, &ai); + if (ret) { +- perror("getaddrinfo"); ++ printf("getaddrinfo: %s\n", gai_strerror(ret)); + return ret; + } + +diff --git a/examples/rping.c b/examples/rping.c +index 9486314..a5aa8c5 100644 +--- a/examples/rping.c ++++ b/examples/rping.c +@@ -1122,7 +1122,7 @@ static int get_addr(char *dst, struct sockaddr *addr) + + ret = getaddrinfo(dst, NULL, NULL, &res); + if (ret) { +- printf("getaddrinfo failed - invalid hostname or IP address\n"); ++ printf("getaddrinfo failed (%s) - invalid hostname or IP address\n", gai_strerror(ret)); + return ret; + } + +diff --git a/examples/rstream.c b/examples/rstream.c +index d93e9aa..c88b5b7 100644 +--- a/examples/rstream.c ++++ b/examples/rstream.c +@@ -327,7 +327,7 @@ static int server_listen(void) + ret = getaddrinfo(src_addr, port, &ai_hints, &ai); + } + if (ret) { +- perror("getaddrinfo"); ++ printf("getaddrinfo: %s\n", gai_strerror(ret)); + return ret; + } + +@@ -412,7 +412,7 @@ static int client_connect(void) + getaddrinfo(dst_addr, port, &ai_hints, &ai); + + if (ret) { +- perror("getaddrinfo"); ++ printf("getaddrinfo: %s\n", gai_strerror(ret)); + return ret; + } + +@@ -425,7 +425,7 @@ static int client_connect(void) + ret = getaddrinfo(src_addr, port, &ai_hints, &ai_src); + } + if (ret) { +- perror("getaddrinfo src_addr"); ++ printf("getaddrinfo src_addr: %s\n", gai_strerror(ret)); + return ret; + } + } +diff --git a/examples/udaddy.c b/examples/udaddy.c +index 6e68944..5e89ca1 100644 +--- a/examples/udaddy.c ++++ b/examples/udaddy.c +@@ -516,7 +516,7 @@ static int run_server(void) + + ret = get_rdma_addr(src_addr, dst_addr, port, &hints, &test.rai); + if (ret) { +- perror("cmatose: getrdmaaddr error"); ++ printf("udaddy: getrdmaaddr error: %s\n", gai_strerror(ret)); + goto out; + } + +@@ -565,7 +565,7 @@ static int run_client(void) + + ret = get_rdma_addr(src_addr, dst_addr, port, &hints, &test.rai); + if (ret) { +- perror("udaddy: getaddrinfo error"); ++ printf("udaddy: getaddrinfo error: %s\n", gai_strerror(ret)); + return ret; + } + +diff --git a/examples/udpong.c b/examples/udpong.c +index 7ec11e8..97713a2 100644 +--- a/examples/udpong.c ++++ b/examples/udpong.c +@@ -266,7 +266,7 @@ static int svr_bind(void) + hints.ai_socktype = SOCK_DGRAM; + ret = getaddrinfo(src_addr, port, &hints, &res); + if (ret) { +- perror("getaddrinfo"); ++ printf("getaddrinfo: %s\n", gai_strerror(ret)); + return ret; + } + +@@ -411,7 +411,7 @@ static int client_connect(void) + hints.ai_socktype = SOCK_DGRAM; + ret = getaddrinfo(dst_addr, port, &hints, &res); + if (ret) { +- perror("getaddrinfo"); ++ printf("getaddrinfo: %s\n", gai_strerror(ret)); + return ret; + } diff --git a/patches/librdmacm-rstream-c-use-proper b/patches/librdmacm-rstream-c-use-proper new file mode 100644 index 00000000..8a8a0558 --- /dev/null +++ b/patches/librdmacm-rstream-c-use-proper @@ -0,0 +1,27 @@ +Bottom: bf944a14b33ae10dba3d15c130307c7f22369866 +Top: 00f44f686c92b3acfcdfe35b25d054cbebb5586b +Author: Hal Rosenstock +Date: 2015-09-30 09:03:08 -0400 + +[librdmacm] rstream.c: Use proper define for ai_flags before getaddrinfo call in client_connect + +even though both have same value + +Signed-off-by: Hal Rosenstock + + +--- + +diff --git a/examples/rstream.c b/examples/rstream.c +index c88b5b7..34144b2 100644 +--- a/examples/rstream.c ++++ b/examples/rstream.c +@@ -421,7 +421,7 @@ static int client_connect(void) + rai_hints.ai_flags |= RAI_PASSIVE; + ret = rdma_getaddrinfo(src_addr, port, &rai_hints, &rai_src); + } else { +- ai_hints.ai_flags |= RAI_PASSIVE; ++ ai_hints.ai_flags |= AI_PASSIVE; + ret = getaddrinfo(src_addr, port, &ai_hints, &ai_src); + } + if (ret) { -- 2.41.0