From 08df75cf6406d6d07c680b0cc2e6845917e6dd93 Mon Sep 17 00:00:00 2001 From: Sean Hefty Date: Wed, 10 Apr 2013 16:38:13 -0700 Subject: [PATCH] refresh --- meta | 7 +- patches/clisvr | 197 ++++++++++++++++++++++++++++++++++++++++- patches/refresh-temp | 203 ------------------------------------------- 3 files changed, 198 insertions(+), 209 deletions(-) delete mode 100644 patches/refresh-temp diff --git a/meta b/meta index 4d05407b..3519db9e 100644 --- a/meta +++ b/meta @@ -1,9 +1,8 @@ Version: 1 -Previous: 632de832dd85b2be3e3f787f5f64d8db6400c63b -Head: 03a2738e8a2be6af0cd5f3b77c91bc5735685097 +Previous: 0beb93d3d4ee1cc52c1daff6bd3c89e68903001b +Head: 0db572abcf3d78374a5ea0f91b709136948809cc Applied: - clisvr: 2b326c67cf99ca626aff1b485f752641df0bd8fe - refresh-temp: 03a2738e8a2be6af0cd5f3b77c91bc5735685097 + clisvr: 0db572abcf3d78374a5ea0f91b709136948809cc Unapplied: af_ib: e755d041f218772a8323936176c8f10e2024ae0f ib-init: 47c8914009e8854b89d015de99eca7b102b9ea69 diff --git a/patches/clisvr b/patches/clisvr index 1025e2f8..39f1ae18 100644 --- a/patches/clisvr +++ b/patches/clisvr @@ -1,5 +1,5 @@ Bottom: 03e0d857be2abeca4aaf50a1c372dc983b1332dc -Top: 03e0d857be2abeca4aaf50a1c372dc983b1332dc +Top: 1ec039b0a7bf31e7ffc12c218c78585edb590194 Author: Sean Hefty Date: 2013-04-10 16:33:39 -0700 @@ -8,4 +8,197 @@ add cli/svr test apps from Susan --- - +diff --git a/Makefile.am b/Makefile.am +index 3198165..a908008 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -29,7 +29,7 @@ src_librspreload_la_LIBADD = $(top_builddir)/src/librdmacm.la + bin_PROGRAMS = examples/ucmatose examples/rping examples/udaddy examples/mckey \ + examples/rdma_client examples/rdma_server examples/rdma_xclient \ + examples/rdma_xserver examples/rstream examples/rcopy \ +- examples/riostream examples/udpong ++ examples/riostream examples/udpong examples/rcli examples/rsvr + examples_ucmatose_SOURCES = examples/cmatose.c examples/common.c + examples_ucmatose_LDADD = $(top_builddir)/src/librdmacm.la + examples_rping_SOURCES = examples/rping.c +@@ -54,6 +54,10 @@ examples_rcopy_SOURCES = examples/rcopy.c + examples_rcopy_LDADD = $(top_builddir)/src/librdmacm.la + examples_udpong_SOURCES = examples/udpong.c examples/common.c + examples_udpong_LDADD = $(top_builddir)/src/librdmacm.la ++examples_rcli_SOURCES = examples/rcli.c ++examples_rcli_LDADD = $(top_builddir)/src/librdmacm.la ++examples_rsvr_SOURCES = examples/rsvr.c ++examples_rsvr_LDADD = $(top_builddir)/src/librdmacm.la + + librdmacmincludedir = $(includedir)/rdma + infinibandincludedir = $(includedir)/infiniband +diff --git a/examples/rcli.c b/examples/rcli.c +new file mode 100755 +index 0000000..ed3c474 +--- /dev/null ++++ b/examples/rcli.c +@@ -0,0 +1,88 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++ ++int main(int argc, char *argv[]) ++{ ++ char rbuf[80]; ++ int n, s; ++ int optval; ++ socklen_t optlen = sizeof(optval); ++ struct sockaddr_in srvaddr; ++ ++ if (argc != 2) { ++ printf("Usage: %s ipaddr\n", argv[0]); ++ exit(EXIT_FAILURE); ++ } ++ ++ /* Create the socket */ ++ if ((s = rsocket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) { ++ perror("rsocket()"); ++ exit(EXIT_FAILURE); ++ } ++ ++ /* Check the status for the keepalive option */ ++ if (rgetsockopt(s, SOL_SOCKET, SO_KEEPALIVE, &optval, &optlen) < 0) { ++ perror("rgetsockopt()"); ++ close(s); ++ exit(EXIT_FAILURE); ++ } ++ printf("SO_KEEPALIVE is %s\n", (optval ? "ON" : "OFF")); ++ ++ memset(&srvaddr, '0', sizeof(srvaddr)); ++ ++ if (inet_pton(AF_INET, argv[1], &srvaddr.sin_addr) < 0) { ++ printf("IP Conversion failed\n"); ++ exit(EXIT_FAILURE); ++ } ++ ++ srvaddr.sin_family = AF_INET; ++ srvaddr.sin_port = htons(7777); ++ ++ /* Connect */ ++ if (rconnect(s,(struct sockaddr*)&srvaddr,sizeof(srvaddr)) < 0) { ++ perror("rconnect()"); ++ close(s); ++ exit(EXIT_FAILURE); ++ ++ } ++ ++ /* Set the option active */ ++ optval = 1; ++ optlen = sizeof(optval); ++ if (rsetsockopt(s, SOL_SOCKET, SO_KEEPALIVE, &optval, optlen) < 0) { ++ perror("rsetsockopt()"); ++ close(s); ++ exit(EXIT_FAILURE); ++ } ++ printf("SO_KEEPALIVE set on socket\n"); ++ ++ /* Check the status again */ ++ if (rgetsockopt(s, SOL_SOCKET, SO_KEEPALIVE, &optval, &optlen) < 0) { ++ perror("rgetsockopt()"); ++ close(s); ++ exit(EXIT_FAILURE); ++ } ++ printf("SO_KEEPALIVE is %s\n", (optval ? "ON" : "OFF")); ++ ++ memset(rbuf, '0', sizeof(rbuf)); ++ ++ while ((n=rread(s,rbuf,sizeof(rbuf)-1)) > 0) { ++ rbuf[n] = 0; ++ if (fputs(rbuf, stdout) == EOF) ++ printf("Error writing receive buffer stdout\n"); ++ } ++ ++ if (n<0) printf("No data\n"); ++ ++ return 0; ++ ++ exit(EXIT_SUCCESS); ++} ++ +diff --git a/examples/rsvr.c b/examples/rsvr.c +new file mode 100755 +index 0000000..a630048 +--- /dev/null ++++ b/examples/rsvr.c +@@ -0,0 +1,70 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define MAX_CLIENTS 2 ++ ++int main() ++{ ++ char sbuf[80]; ++ int limit, num_clients, s, sc; ++ int clients[MAX_CLIENTS]; ++ struct sockaddr_in srvaddr; ++ time_t t; ++ ++ /* Create the socket */ ++ if ((s = rsocket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) { ++ perror("rsocket()"); ++ exit(EXIT_FAILURE); ++ } ++ ++ /* Bind */ ++ memset(&srvaddr, '0', sizeof(srvaddr)); ++ srvaddr.sin_family = AF_INET; ++ srvaddr.sin_addr.s_addr = htonl(INADDR_ANY); ++ srvaddr.sin_port = htons(7777); ++ ++ if (rbind(s,(struct sockaddr*)&srvaddr,sizeof(srvaddr)) < 0) { ++ perror("rbind()"); ++ close(s); ++ exit(EXIT_FAILURE); ++ } ++ ++ if (rlisten(s,MAX_CLIENTS) < 0) { ++ perror("listen()"); ++ exit(EXIT_FAILURE); ++ } ++ ++ num_clients=0; ++ while(1) { ++ ++ limit=1; ++ while(limit) { ++ if (num_clients < MAX_CLIENTS) { ++ sc = raccept(s, (struct sockaddr*)NULL, NULL); ++ clients[num_clients] = sc; ++ num_clients++; ++ t = time(NULL); ++ snprintf(sbuf, sizeof(sbuf), "%.24s\r\n", ctime(&t)); ++ rwrite(sc, sbuf, strlen(sbuf)); ++ } else { ++ limit=0; ++ } ++ ++ sleep(1); ++ } ++ ++ if (limit == 0 && num_clients == MAX_CLIENTS) { ++ printf("Max number of clients, %i, has been reached\n", MAX_CLIENTS); ++ num_clients = 9999; ++ } ++ sleep(1); ++ } ++ ++} ++ diff --git a/patches/refresh-temp b/patches/refresh-temp deleted file mode 100644 index 5a9537ab..00000000 --- a/patches/refresh-temp +++ /dev/null @@ -1,203 +0,0 @@ -Bottom: 03e0d857be2abeca4aaf50a1c372dc983b1332dc -Top: 1ec039b0a7bf31e7ffc12c218c78585edb590194 -Author: Sean Hefty -Date: 2013-04-10 16:38:13 -0700 - -Refresh of clisvr - ---- - -diff --git a/Makefile.am b/Makefile.am -index 3198165..a908008 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -29,7 +29,7 @@ src_librspreload_la_LIBADD = $(top_builddir)/src/librdmacm.la - bin_PROGRAMS = examples/ucmatose examples/rping examples/udaddy examples/mckey \ - examples/rdma_client examples/rdma_server examples/rdma_xclient \ - examples/rdma_xserver examples/rstream examples/rcopy \ -- examples/riostream examples/udpong -+ examples/riostream examples/udpong examples/rcli examples/rsvr - examples_ucmatose_SOURCES = examples/cmatose.c examples/common.c - examples_ucmatose_LDADD = $(top_builddir)/src/librdmacm.la - examples_rping_SOURCES = examples/rping.c -@@ -54,6 +54,10 @@ examples_rcopy_SOURCES = examples/rcopy.c - examples_rcopy_LDADD = $(top_builddir)/src/librdmacm.la - examples_udpong_SOURCES = examples/udpong.c examples/common.c - examples_udpong_LDADD = $(top_builddir)/src/librdmacm.la -+examples_rcli_SOURCES = examples/rcli.c -+examples_rcli_LDADD = $(top_builddir)/src/librdmacm.la -+examples_rsvr_SOURCES = examples/rsvr.c -+examples_rsvr_LDADD = $(top_builddir)/src/librdmacm.la - - librdmacmincludedir = $(includedir)/rdma - infinibandincludedir = $(includedir)/infiniband -diff --git a/examples/rcli.c b/examples/rcli.c -new file mode 100755 -index 0000000..ed3c474 ---- /dev/null -+++ b/examples/rcli.c -@@ -0,0 +1,88 @@ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+ -+int main(int argc, char *argv[]) -+{ -+ char rbuf[80]; -+ int n, s; -+ int optval; -+ socklen_t optlen = sizeof(optval); -+ struct sockaddr_in srvaddr; -+ -+ if (argc != 2) { -+ printf("Usage: %s ipaddr\n", argv[0]); -+ exit(EXIT_FAILURE); -+ } -+ -+ /* Create the socket */ -+ if ((s = rsocket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) { -+ perror("rsocket()"); -+ exit(EXIT_FAILURE); -+ } -+ -+ /* Check the status for the keepalive option */ -+ if (rgetsockopt(s, SOL_SOCKET, SO_KEEPALIVE, &optval, &optlen) < 0) { -+ perror("rgetsockopt()"); -+ close(s); -+ exit(EXIT_FAILURE); -+ } -+ printf("SO_KEEPALIVE is %s\n", (optval ? "ON" : "OFF")); -+ -+ memset(&srvaddr, '0', sizeof(srvaddr)); -+ -+ if (inet_pton(AF_INET, argv[1], &srvaddr.sin_addr) < 0) { -+ printf("IP Conversion failed\n"); -+ exit(EXIT_FAILURE); -+ } -+ -+ srvaddr.sin_family = AF_INET; -+ srvaddr.sin_port = htons(7777); -+ -+ /* Connect */ -+ if (rconnect(s,(struct sockaddr*)&srvaddr,sizeof(srvaddr)) < 0) { -+ perror("rconnect()"); -+ close(s); -+ exit(EXIT_FAILURE); -+ -+ } -+ -+ /* Set the option active */ -+ optval = 1; -+ optlen = sizeof(optval); -+ if (rsetsockopt(s, SOL_SOCKET, SO_KEEPALIVE, &optval, optlen) < 0) { -+ perror("rsetsockopt()"); -+ close(s); -+ exit(EXIT_FAILURE); -+ } -+ printf("SO_KEEPALIVE set on socket\n"); -+ -+ /* Check the status again */ -+ if (rgetsockopt(s, SOL_SOCKET, SO_KEEPALIVE, &optval, &optlen) < 0) { -+ perror("rgetsockopt()"); -+ close(s); -+ exit(EXIT_FAILURE); -+ } -+ printf("SO_KEEPALIVE is %s\n", (optval ? "ON" : "OFF")); -+ -+ memset(rbuf, '0', sizeof(rbuf)); -+ -+ while ((n=rread(s,rbuf,sizeof(rbuf)-1)) > 0) { -+ rbuf[n] = 0; -+ if (fputs(rbuf, stdout) == EOF) -+ printf("Error writing receive buffer stdout\n"); -+ } -+ -+ if (n<0) printf("No data\n"); -+ -+ return 0; -+ -+ exit(EXIT_SUCCESS); -+} -+ -diff --git a/examples/rsvr.c b/examples/rsvr.c -new file mode 100755 -index 0000000..a630048 ---- /dev/null -+++ b/examples/rsvr.c -@@ -0,0 +1,70 @@ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#define MAX_CLIENTS 2 -+ -+int main() -+{ -+ char sbuf[80]; -+ int limit, num_clients, s, sc; -+ int clients[MAX_CLIENTS]; -+ struct sockaddr_in srvaddr; -+ time_t t; -+ -+ /* Create the socket */ -+ if ((s = rsocket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) { -+ perror("rsocket()"); -+ exit(EXIT_FAILURE); -+ } -+ -+ /* Bind */ -+ memset(&srvaddr, '0', sizeof(srvaddr)); -+ srvaddr.sin_family = AF_INET; -+ srvaddr.sin_addr.s_addr = htonl(INADDR_ANY); -+ srvaddr.sin_port = htons(7777); -+ -+ if (rbind(s,(struct sockaddr*)&srvaddr,sizeof(srvaddr)) < 0) { -+ perror("rbind()"); -+ close(s); -+ exit(EXIT_FAILURE); -+ } -+ -+ if (rlisten(s,MAX_CLIENTS) < 0) { -+ perror("listen()"); -+ exit(EXIT_FAILURE); -+ } -+ -+ num_clients=0; -+ while(1) { -+ -+ limit=1; -+ while(limit) { -+ if (num_clients < MAX_CLIENTS) { -+ sc = raccept(s, (struct sockaddr*)NULL, NULL); -+ clients[num_clients] = sc; -+ num_clients++; -+ t = time(NULL); -+ snprintf(sbuf, sizeof(sbuf), "%.24s\r\n", ctime(&t)); -+ rwrite(sc, sbuf, strlen(sbuf)); -+ } else { -+ limit=0; -+ } -+ -+ sleep(1); -+ } -+ -+ if (limit == 0 && num_clients == MAX_CLIENTS) { -+ printf("Max number of clients, %i, has been reached\n", MAX_CLIENTS); -+ num_clients = 9999; -+ } -+ sleep(1); -+ } -+ -+} -+ -- 2.46.0