Version: 1
-Previous: 4086f9f5596c23fa3a64fa4a240d833d49a9040c
-Head: 9114ca5460dd3bad7bca8ae54926c92712dff5c5
+Previous: a0741c3018b2e18fc3e12a3d2c28021b95391071
+Head: e10514f9b616fc09b0ed7b8028a9138b29351025
Applied:
sync: 452ce3b051e10e10363baa77834962a89267e052
pre-af-ib: 73504ef1f812bea6d1fd59f194f90e5194ca2efa
gai: 3a732c7b1faeb0bb06b7f6ae9cf1cfca2f100353
getreq: 4c50d78bc73685574548b3a781e914472b34a2cf
ep: 1d456022a217a651dce3bd33963ce7e60328cb0f
- samples: 49c12ca304a986314ed1b291a1650231968d59ff
- refresh-temp: 9114ca5460dd3bad7bca8ae54926c92712dff5c5
+ samples: e10514f9b616fc09b0ed7b8028a9138b29351025
Unapplied:
cq-status: d4535a68c8d41302c9ee9d44b98a75ea19b4f172
wv-rm-ioctl: 2c4f8b27f89993bc9c1215e8c358046b2934f755
+++ /dev/null
-Bottom: 8ceb4c5b9887748eee59a5dca46e3485ed6d699d
-Top: 747f9d55fcaa16d267ce11304460c1e5a67c08bc
-Author: Sean Hefty <sean.hefty@intel.com>
-Date: 2010-08-16 12:07:29 -0700
-
-Refresh of samples
-
----
-
-diff --git a/trunk/ulp/librdmacm/examples/dirs b/trunk/ulp/librdmacm/examples/dirs
-index 2bdf906..498dd65 100644
---- a/trunk/ulp/librdmacm/examples/dirs
-+++ b/trunk/ulp/librdmacm/examples/dirs
-@@ -1,2 +1,4 @@
- DIRS = \\r
-- cmatose\r
-+ cmatose \\r
-+ rdma_server \\r
-+ rdma_client\r
-diff --git a/trunk/ulp/librdmacm/examples/rdma_client/SOURCES b/trunk/ulp/librdmacm/examples/rdma_client/SOURCES
-new file mode 100644
-index 0000000..2072676
---- /dev/null
-+++ b/trunk/ulp/librdmacm/examples/rdma_client/SOURCES
-@@ -0,0 +1,31 @@
-+TARGETNAME = rdma_client\r
-+TARGETPATH = ..\..\..\..\bin\user\obj$(BUILD_ALT_DIR)\r
-+TARGETTYPE = PROGRAM\r
-+\r
-+UMTYPE = console\r
-+UMENTRY = main\r
-+\r
-+USE_MSVCRT = 1\r
-+USE_STL = 1\r
-+USE_NATIVE_EH = 1\r
-+USE_IOSTREAM = 1\r
-+\r
-+SOURCES = rdma_client.c\r
-+ \r
-+INCLUDES = ..;..\..\include;..\..\..\..\inc;..\..\..\..\inc\user;\\r
-+ ..\..\..\libibverbs\include;..\..\..\..\inc\user\linux;\r
-+\r
-+TARGETLIBS = \\r
-+ $(SDK_LIB_PATH)\kernel32.lib \\r
-+ $(SDK_LIB_PATH)\advapi32.lib \\r
-+ $(SDK_LIB_PATH)\user32.lib \\r
-+ $(SDK_LIB_PATH)\ole32.lib \\r
-+ $(SDK_LIB_PATH)\ws2_32.lib \\r
-+!if $(FREEBUILD)\r
-+ $(TARGETPATH)\*\libibverbs.lib \\r
-+ $(TARGETPATH)\*\librdmacm.lib\r
-+!else\r
-+ $(TARGETPATH)\*\libibverbsd.lib \\r
-+ $(TARGETPATH)\*\librdmacmd.lib\r
-+!endif\r
-+\r
-diff --git a/trunk/ulp/librdmacm/examples/rdma_client/makefile b/trunk/ulp/librdmacm/examples/rdma_client/makefile
-new file mode 100644
-index 0000000..a0c0627
---- /dev/null
-+++ b/trunk/ulp/librdmacm/examples/rdma_client/makefile
-@@ -0,0 +1,7 @@
-+#\r
-+# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source\r
-+# file to this component. This file merely indirects to the real make file\r
-+# that is shared by all the driver components of the OpenIB Windows project.\r
-+#\r
-+\r
-+!INCLUDE ..\..\..\..\inc\openib.def\r
-diff --git a/trunk/ulp/librdmacm/examples/rdma_client/rdma_client.c b/trunk/ulp/librdmacm/examples/rdma_client/rdma_client.c
-new file mode 100644
-index 0000000..7a59d97
---- /dev/null
-+++ b/trunk/ulp/librdmacm/examples/rdma_client/rdma_client.c
-@@ -0,0 +1,134 @@
-+/*
-+ * Copyright (c) 2010 Intel Corporation. All rights reserved.
-+ *
-+ * This software is available to you under the OpenIB.org BSD license
-+ * below:
-+ *
-+ * Redistribution and use in source and binary forms, with or
-+ * without modification, are permitted provided that the following
-+ * conditions are met:
-+ *
-+ * - Redistributions of source code must retain the above
-+ * copyright notice, this list of conditions and the following
-+ * disclaimer.
-+ *
-+ * - 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 AWV
-+ * 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.
-+ */
-+
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <errno.h>
-+#include <getopt.h>
-+#include <rdma/rdma_cma.h>
-+#include <rdma/rdma_verbs.h>
-+
-+static char *server = "127.0.0.1";
-+static char *port = "7471";
-+
-+struct rdma_cm_id *id;
-+struct ibv_mr *mr;
-+uint8_t send_msg[16];
-+uint8_t recv_msg[16];
-+
-+static int run(void)
-+{
-+ struct rdma_addrinfo hints, *res;
-+ struct ibv_qp_init_attr attr;
-+ struct ibv_wc wc;
-+ int ret;
-+
-+ memset(&hints, 0, sizeof hints);
-+ hints.ai_port_space = RDMA_PS_TCP;
-+ ret = rdma_getaddrinfo(server, port, &hints, &res);
-+ if (ret) {
-+ printf("rdma_getaddrinfo %d\n", errno);
-+ return ret;
-+ }
-+
-+ memset(&attr, 0, sizeof attr);
-+ attr.cap.max_send_wr = attr.cap.max_recv_wr = 1;
-+ attr.cap.max_send_sge = attr.cap.max_recv_sge = 1;
-+ attr.cap.max_inline_data = 16;
-+ attr.qp_context = id;
-+ attr.sq_sig_all = 1;
-+ ret = rdma_create_ep(&id, res, NULL, &attr);
-+ rdma_freeaddrinfo(res);
-+ if (ret) {
-+ printf("rdma_create_ep %d\n", errno);
-+ return ret;
-+ }
-+
-+ mr = rdma_reg_msgs(id, recv_msg, 16);
-+ if (!mr) {
-+ printf("rdma_reg_msgs %d\n", errno);
-+ return ret;
-+ }
-+
-+ ret = rdma_post_recv(id, NULL, recv_msg, 16, mr);
-+ if (ret) {
-+ printf("rdma_post_recv %d\n", errno);
-+ return ret;
-+ }
-+
-+ ret = rdma_connect(id, NULL);
-+ if (ret) {
-+ printf("rdma_connect %d\n", errno);
-+ return ret;
-+ }
-+
-+ ret = rdma_post_send(id, NULL, send_msg, 16, NULL, IBV_SEND_INLINE);
-+ if (ret) {
-+ printf("rdma_post_send %d\n", errno);
-+ return ret;
-+ }
-+
-+ ret = rdma_get_recv_comp(id, &wc);
-+ if (ret <= 0) {
-+ printf("rdma_get_recv_comp %d\n", ret);
-+ return ret;
-+ }
-+
-+ rdma_disconnect(id);
-+ rdma_dereg_mr(mr);
-+ rdma_destroy_ep(id);
-+ return 0;
-+}
-+
-+int main(int argc, char **argv)
-+{
-+ int op, ret;
-+
-+ while ((op = getopt(argc, argv, "s:p:")) != -1) {
-+ switch (op) {
-+ case 's':
-+ server = optarg;
-+ break;
-+ case 'p':
-+ port = optarg;
-+ break;
-+ default:
-+ printf("usage: %s\n", argv[0]);
-+ printf("\t[-s server_address]\n");
-+ printf("\t[-p port_number]\n");
-+ exit(1);
-+ }
-+ }
-+
-+ printf("rdma_client: start\n");
-+ ret = run();
-+ printf("rdma_client: end %d\n", ret);
-+ return ret;
-+}
-diff --git a/trunk/ulp/librdmacm/examples/rdma_server/SOURCES b/trunk/ulp/librdmacm/examples/rdma_server/SOURCES
-new file mode 100644
-index 0000000..d658889
---- /dev/null
-+++ b/trunk/ulp/librdmacm/examples/rdma_server/SOURCES
-@@ -0,0 +1,31 @@
-+TARGETNAME = rdma_server\r
-+TARGETPATH = ..\..\..\..\bin\user\obj$(BUILD_ALT_DIR)\r
-+TARGETTYPE = PROGRAM\r
-+\r
-+UMTYPE = console\r
-+UMENTRY = main\r
-+\r
-+USE_MSVCRT = 1\r
-+USE_STL = 1\r
-+USE_NATIVE_EH = 1\r
-+USE_IOSTREAM = 1\r
-+\r
-+SOURCES = rdma_server.c\r
-+ \r
-+INCLUDES = ..;..\..\include;..\..\..\..\inc;..\..\..\..\inc\user;\\r
-+ ..\..\..\libibverbs\include;..\..\..\..\inc\user\linux;\r
-+\r
-+TARGETLIBS = \\r
-+ $(SDK_LIB_PATH)\kernel32.lib \\r
-+ $(SDK_LIB_PATH)\advapi32.lib \\r
-+ $(SDK_LIB_PATH)\user32.lib \\r
-+ $(SDK_LIB_PATH)\ole32.lib \\r
-+ $(SDK_LIB_PATH)\ws2_32.lib \\r
-+!if $(FREEBUILD)\r
-+ $(TARGETPATH)\*\libibverbs.lib \\r
-+ $(TARGETPATH)\*\librdmacm.lib\r
-+!else\r
-+ $(TARGETPATH)\*\libibverbsd.lib \\r
-+ $(TARGETPATH)\*\librdmacmd.lib\r
-+!endif\r
-+\r
-diff --git a/trunk/ulp/librdmacm/examples/rdma_server/makefile b/trunk/ulp/librdmacm/examples/rdma_server/makefile
-new file mode 100644
-index 0000000..a0c0627
---- /dev/null
-+++ b/trunk/ulp/librdmacm/examples/rdma_server/makefile
-@@ -0,0 +1,7 @@
-+#\r
-+# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source\r
-+# file to this component. This file merely indirects to the real make file\r
-+# that is shared by all the driver components of the OpenIB Windows project.\r
-+#\r
-+\r
-+!INCLUDE ..\..\..\..\inc\openib.def\r
-diff --git a/trunk/ulp/librdmacm/examples/rdma_server/rdma_server.c b/trunk/ulp/librdmacm/examples/rdma_server/rdma_server.c
-new file mode 100644
-index 0000000..2831d0c
---- /dev/null
-+++ b/trunk/ulp/librdmacm/examples/rdma_server/rdma_server.c
-@@ -0,0 +1,149 @@
-+/*
-+ * Copyright (c) 2005-2009 Intel Corporation. All rights reserved.
-+ *
-+ * This software is available to you under the OpenIB.org BSD license
-+ * below:
-+ *
-+ * Redistribution and use in source and binary forms, with or
-+ * without modification, are permitted provided that the following
-+ * conditions are met:
-+ *
-+ * - Redistributions of source code must retain the above
-+ * copyright notice, this list of conditions and the following
-+ * disclaimer.
-+ *
-+ * - 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 AWV
-+ * 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.
-+ */
-+
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <errno.h>
-+#include <getopt.h>
-+#include <netdb.h>
-+#include <rdma/rdma_cma.h>
-+#include <rdma/rdma_verbs.h>
-+
-+static char *port = "7471";
-+
-+struct rdma_cm_id *listen_id, *id;
-+struct ibv_mr *mr;
-+uint8_t send_msg[16];
-+uint8_t recv_msg[16];
-+
-+static int run(void)
-+{
-+ struct rdma_addrinfo hints, *res;
-+ struct ibv_qp_init_attr attr;
-+ struct ibv_wc wc;
-+ int ret;
-+
-+ memset(&hints, 0, sizeof hints);
-+ hints.ai_flags = RAI_PASSIVE;
-+ hints.ai_port_space = RDMA_PS_TCP;
-+ ret = rdma_getaddrinfo(NULL, port, &hints, &res);
-+ if (ret) {
-+ printf("rdma_getaddrinfo %d\n", errno);
-+ return ret;
-+ }
-+
-+ memset(&attr, 0, sizeof attr);
-+ attr.cap.max_send_wr = attr.cap.max_recv_wr = 1;
-+ attr.cap.max_send_sge = attr.cap.max_recv_sge = 1;
-+ attr.cap.max_inline_data = 16;
-+ attr.sq_sig_all = 1;
-+ ret = rdma_create_ep(&listen_id, res, NULL, &attr);
-+ rdma_freeaddrinfo(res);
-+ if (ret) {
-+ printf("rdma_create_ep %d\n", errno);
-+ return ret;
-+ }
-+
-+ ret = rdma_listen(listen_id, 0);
-+ if (ret) {
-+ printf("rdma_listen %d\n", errno);
-+ return ret;
-+ }
-+
-+ ret = rdma_get_request(listen_id, &id);
-+ if (ret) {
-+ printf("rdma_get_request %d\n", errno);
-+ return ret;
-+ }
-+
-+ mr = rdma_reg_msgs(id, recv_msg, 16);
-+ if (!mr) {
-+ printf("rdma_reg_msgs %d\n", errno);
-+ return ret;
-+ }
-+
-+ ret = rdma_post_recv(id, NULL, recv_msg, 16, mr);
-+ if (ret) {
-+ printf("rdma_post_recv %d\n", errno);
-+ return ret;
-+ }
-+
-+ ret = rdma_accept(id, NULL);
-+ if (ret) {
-+ printf("rdma_connect %d\n", errno);
-+ return ret;
-+ }
-+
-+ ret = rdma_get_recv_comp(id, &wc);
-+ if (ret <= 0) {
-+ printf("rdma_get_recv_comp %d\n", ret);
-+ return ret;
-+ }
-+
-+ ret = rdma_post_send(id, NULL, send_msg, 16, NULL, IBV_SEND_INLINE);
-+ if (ret) {
-+ printf("rdma_post_send %d\n", errno);
-+ return ret;
-+ }
-+
-+ ret = rdma_get_send_comp(id, &wc);
-+ if (ret <= 0) {
-+ printf("rdma_get_send_comp %d\n", ret);
-+ return ret;
-+ }
-+
-+ rdma_disconnect(id);
-+ rdma_dereg_mr(mr);
-+ rdma_destroy_ep(id);
-+ rdma_destroy_ep(listen_id);
-+ return 0;
-+}
-+
-+int main(int argc, char **argv)
-+{
-+ int op, ret;
-+
-+ while ((op = getopt(argc, argv, "p:")) != -1) {
-+ switch (op) {
-+ case 'p':
-+ port = optarg;
-+ break;
-+ default:
-+ printf("usage: %s\n", argv[0]);
-+ printf("\t[-p port_number]\n");
-+ exit(1);
-+ }
-+ }
-+
-+ printf("rdma_server: start\n");
-+ ret = run();
-+ printf("rdma_server: end %d\n", ret);
-+ return ret;
-+}
Bottom: 8ceb4c5b9887748eee59a5dca46e3485ed6d699d
-Top: 8ceb4c5b9887748eee59a5dca46e3485ed6d699d
+Top: 747f9d55fcaa16d267ce11304460c1e5a67c08bc
Author: Sean Hefty <sean.hefty@intel.com>
Date: 2010-08-16 12:05:39 -0700
---
-
+diff --git a/trunk/ulp/librdmacm/examples/dirs b/trunk/ulp/librdmacm/examples/dirs
+index 2bdf906..498dd65 100644
+--- a/trunk/ulp/librdmacm/examples/dirs
++++ b/trunk/ulp/librdmacm/examples/dirs
+@@ -1,2 +1,4 @@
+ DIRS = \\r
+- cmatose\r
++ cmatose \\r
++ rdma_server \\r
++ rdma_client\r
+diff --git a/trunk/ulp/librdmacm/examples/rdma_client/SOURCES b/trunk/ulp/librdmacm/examples/rdma_client/SOURCES
+new file mode 100644
+index 0000000..2072676
+--- /dev/null
++++ b/trunk/ulp/librdmacm/examples/rdma_client/SOURCES
+@@ -0,0 +1,31 @@
++TARGETNAME = rdma_client\r
++TARGETPATH = ..\..\..\..\bin\user\obj$(BUILD_ALT_DIR)\r
++TARGETTYPE = PROGRAM\r
++\r
++UMTYPE = console\r
++UMENTRY = main\r
++\r
++USE_MSVCRT = 1\r
++USE_STL = 1\r
++USE_NATIVE_EH = 1\r
++USE_IOSTREAM = 1\r
++\r
++SOURCES = rdma_client.c\r
++ \r
++INCLUDES = ..;..\..\include;..\..\..\..\inc;..\..\..\..\inc\user;\\r
++ ..\..\..\libibverbs\include;..\..\..\..\inc\user\linux;\r
++\r
++TARGETLIBS = \\r
++ $(SDK_LIB_PATH)\kernel32.lib \\r
++ $(SDK_LIB_PATH)\advapi32.lib \\r
++ $(SDK_LIB_PATH)\user32.lib \\r
++ $(SDK_LIB_PATH)\ole32.lib \\r
++ $(SDK_LIB_PATH)\ws2_32.lib \\r
++!if $(FREEBUILD)\r
++ $(TARGETPATH)\*\libibverbs.lib \\r
++ $(TARGETPATH)\*\librdmacm.lib\r
++!else\r
++ $(TARGETPATH)\*\libibverbsd.lib \\r
++ $(TARGETPATH)\*\librdmacmd.lib\r
++!endif\r
++\r
+diff --git a/trunk/ulp/librdmacm/examples/rdma_client/makefile b/trunk/ulp/librdmacm/examples/rdma_client/makefile
+new file mode 100644
+index 0000000..a0c0627
+--- /dev/null
++++ b/trunk/ulp/librdmacm/examples/rdma_client/makefile
+@@ -0,0 +1,7 @@
++#\r
++# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source\r
++# file to this component. This file merely indirects to the real make file\r
++# that is shared by all the driver components of the OpenIB Windows project.\r
++#\r
++\r
++!INCLUDE ..\..\..\..\inc\openib.def\r
+diff --git a/trunk/ulp/librdmacm/examples/rdma_client/rdma_client.c b/trunk/ulp/librdmacm/examples/rdma_client/rdma_client.c
+new file mode 100644
+index 0000000..7a59d97
+--- /dev/null
++++ b/trunk/ulp/librdmacm/examples/rdma_client/rdma_client.c
+@@ -0,0 +1,134 @@
++/*
++ * Copyright (c) 2010 Intel Corporation. All rights reserved.
++ *
++ * This software is available to you under the OpenIB.org BSD license
++ * below:
++ *
++ * Redistribution and use in source and binary forms, with or
++ * without modification, are permitted provided that the following
++ * conditions are met:
++ *
++ * - Redistributions of source code must retain the above
++ * copyright notice, this list of conditions and the following
++ * disclaimer.
++ *
++ * - 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 AWV
++ * 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.
++ */
++
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <errno.h>
++#include <getopt.h>
++#include <rdma/rdma_cma.h>
++#include <rdma/rdma_verbs.h>
++
++static char *server = "127.0.0.1";
++static char *port = "7471";
++
++struct rdma_cm_id *id;
++struct ibv_mr *mr;
++uint8_t send_msg[16];
++uint8_t recv_msg[16];
++
++static int run(void)
++{
++ struct rdma_addrinfo hints, *res;
++ struct ibv_qp_init_attr attr;
++ struct ibv_wc wc;
++ int ret;
++
++ memset(&hints, 0, sizeof hints);
++ hints.ai_port_space = RDMA_PS_TCP;
++ ret = rdma_getaddrinfo(server, port, &hints, &res);
++ if (ret) {
++ printf("rdma_getaddrinfo %d\n", errno);
++ return ret;
++ }
++
++ memset(&attr, 0, sizeof attr);
++ attr.cap.max_send_wr = attr.cap.max_recv_wr = 1;
++ attr.cap.max_send_sge = attr.cap.max_recv_sge = 1;
++ attr.cap.max_inline_data = 16;
++ attr.qp_context = id;
++ attr.sq_sig_all = 1;
++ ret = rdma_create_ep(&id, res, NULL, &attr);
++ rdma_freeaddrinfo(res);
++ if (ret) {
++ printf("rdma_create_ep %d\n", errno);
++ return ret;
++ }
++
++ mr = rdma_reg_msgs(id, recv_msg, 16);
++ if (!mr) {
++ printf("rdma_reg_msgs %d\n", errno);
++ return ret;
++ }
++
++ ret = rdma_post_recv(id, NULL, recv_msg, 16, mr);
++ if (ret) {
++ printf("rdma_post_recv %d\n", errno);
++ return ret;
++ }
++
++ ret = rdma_connect(id, NULL);
++ if (ret) {
++ printf("rdma_connect %d\n", errno);
++ return ret;
++ }
++
++ ret = rdma_post_send(id, NULL, send_msg, 16, NULL, IBV_SEND_INLINE);
++ if (ret) {
++ printf("rdma_post_send %d\n", errno);
++ return ret;
++ }
++
++ ret = rdma_get_recv_comp(id, &wc);
++ if (ret <= 0) {
++ printf("rdma_get_recv_comp %d\n", ret);
++ return ret;
++ }
++
++ rdma_disconnect(id);
++ rdma_dereg_mr(mr);
++ rdma_destroy_ep(id);
++ return 0;
++}
++
++int main(int argc, char **argv)
++{
++ int op, ret;
++
++ while ((op = getopt(argc, argv, "s:p:")) != -1) {
++ switch (op) {
++ case 's':
++ server = optarg;
++ break;
++ case 'p':
++ port = optarg;
++ break;
++ default:
++ printf("usage: %s\n", argv[0]);
++ printf("\t[-s server_address]\n");
++ printf("\t[-p port_number]\n");
++ exit(1);
++ }
++ }
++
++ printf("rdma_client: start\n");
++ ret = run();
++ printf("rdma_client: end %d\n", ret);
++ return ret;
++}
+diff --git a/trunk/ulp/librdmacm/examples/rdma_server/SOURCES b/trunk/ulp/librdmacm/examples/rdma_server/SOURCES
+new file mode 100644
+index 0000000..d658889
+--- /dev/null
++++ b/trunk/ulp/librdmacm/examples/rdma_server/SOURCES
+@@ -0,0 +1,31 @@
++TARGETNAME = rdma_server\r
++TARGETPATH = ..\..\..\..\bin\user\obj$(BUILD_ALT_DIR)\r
++TARGETTYPE = PROGRAM\r
++\r
++UMTYPE = console\r
++UMENTRY = main\r
++\r
++USE_MSVCRT = 1\r
++USE_STL = 1\r
++USE_NATIVE_EH = 1\r
++USE_IOSTREAM = 1\r
++\r
++SOURCES = rdma_server.c\r
++ \r
++INCLUDES = ..;..\..\include;..\..\..\..\inc;..\..\..\..\inc\user;\\r
++ ..\..\..\libibverbs\include;..\..\..\..\inc\user\linux;\r
++\r
++TARGETLIBS = \\r
++ $(SDK_LIB_PATH)\kernel32.lib \\r
++ $(SDK_LIB_PATH)\advapi32.lib \\r
++ $(SDK_LIB_PATH)\user32.lib \\r
++ $(SDK_LIB_PATH)\ole32.lib \\r
++ $(SDK_LIB_PATH)\ws2_32.lib \\r
++!if $(FREEBUILD)\r
++ $(TARGETPATH)\*\libibverbs.lib \\r
++ $(TARGETPATH)\*\librdmacm.lib\r
++!else\r
++ $(TARGETPATH)\*\libibverbsd.lib \\r
++ $(TARGETPATH)\*\librdmacmd.lib\r
++!endif\r
++\r
+diff --git a/trunk/ulp/librdmacm/examples/rdma_server/makefile b/trunk/ulp/librdmacm/examples/rdma_server/makefile
+new file mode 100644
+index 0000000..a0c0627
+--- /dev/null
++++ b/trunk/ulp/librdmacm/examples/rdma_server/makefile
+@@ -0,0 +1,7 @@
++#\r
++# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source\r
++# file to this component. This file merely indirects to the real make file\r
++# that is shared by all the driver components of the OpenIB Windows project.\r
++#\r
++\r
++!INCLUDE ..\..\..\..\inc\openib.def\r
+diff --git a/trunk/ulp/librdmacm/examples/rdma_server/rdma_server.c b/trunk/ulp/librdmacm/examples/rdma_server/rdma_server.c
+new file mode 100644
+index 0000000..2831d0c
+--- /dev/null
++++ b/trunk/ulp/librdmacm/examples/rdma_server/rdma_server.c
+@@ -0,0 +1,149 @@
++/*
++ * Copyright (c) 2005-2009 Intel Corporation. All rights reserved.
++ *
++ * This software is available to you under the OpenIB.org BSD license
++ * below:
++ *
++ * Redistribution and use in source and binary forms, with or
++ * without modification, are permitted provided that the following
++ * conditions are met:
++ *
++ * - Redistributions of source code must retain the above
++ * copyright notice, this list of conditions and the following
++ * disclaimer.
++ *
++ * - 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 AWV
++ * 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.
++ */
++
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <errno.h>
++#include <getopt.h>
++#include <netdb.h>
++#include <rdma/rdma_cma.h>
++#include <rdma/rdma_verbs.h>
++
++static char *port = "7471";
++
++struct rdma_cm_id *listen_id, *id;
++struct ibv_mr *mr;
++uint8_t send_msg[16];
++uint8_t recv_msg[16];
++
++static int run(void)
++{
++ struct rdma_addrinfo hints, *res;
++ struct ibv_qp_init_attr attr;
++ struct ibv_wc wc;
++ int ret;
++
++ memset(&hints, 0, sizeof hints);
++ hints.ai_flags = RAI_PASSIVE;
++ hints.ai_port_space = RDMA_PS_TCP;
++ ret = rdma_getaddrinfo(NULL, port, &hints, &res);
++ if (ret) {
++ printf("rdma_getaddrinfo %d\n", errno);
++ return ret;
++ }
++
++ memset(&attr, 0, sizeof attr);
++ attr.cap.max_send_wr = attr.cap.max_recv_wr = 1;
++ attr.cap.max_send_sge = attr.cap.max_recv_sge = 1;
++ attr.cap.max_inline_data = 16;
++ attr.sq_sig_all = 1;
++ ret = rdma_create_ep(&listen_id, res, NULL, &attr);
++ rdma_freeaddrinfo(res);
++ if (ret) {
++ printf("rdma_create_ep %d\n", errno);
++ return ret;
++ }
++
++ ret = rdma_listen(listen_id, 0);
++ if (ret) {
++ printf("rdma_listen %d\n", errno);
++ return ret;
++ }
++
++ ret = rdma_get_request(listen_id, &id);
++ if (ret) {
++ printf("rdma_get_request %d\n", errno);
++ return ret;
++ }
++
++ mr = rdma_reg_msgs(id, recv_msg, 16);
++ if (!mr) {
++ printf("rdma_reg_msgs %d\n", errno);
++ return ret;
++ }
++
++ ret = rdma_post_recv(id, NULL, recv_msg, 16, mr);
++ if (ret) {
++ printf("rdma_post_recv %d\n", errno);
++ return ret;
++ }
++
++ ret = rdma_accept(id, NULL);
++ if (ret) {
++ printf("rdma_connect %d\n", errno);
++ return ret;
++ }
++
++ ret = rdma_get_recv_comp(id, &wc);
++ if (ret <= 0) {
++ printf("rdma_get_recv_comp %d\n", ret);
++ return ret;
++ }
++
++ ret = rdma_post_send(id, NULL, send_msg, 16, NULL, IBV_SEND_INLINE);
++ if (ret) {
++ printf("rdma_post_send %d\n", errno);
++ return ret;
++ }
++
++ ret = rdma_get_send_comp(id, &wc);
++ if (ret <= 0) {
++ printf("rdma_get_send_comp %d\n", ret);
++ return ret;
++ }
++
++ rdma_disconnect(id);
++ rdma_dereg_mr(mr);
++ rdma_destroy_ep(id);
++ rdma_destroy_ep(listen_id);
++ return 0;
++}
++
++int main(int argc, char **argv)
++{
++ int op, ret;
++
++ while ((op = getopt(argc, argv, "p:")) != -1) {
++ switch (op) {
++ case 'p':
++ port = optarg;
++ break;
++ default:
++ printf("usage: %s\n", argv[0]);
++ printf("\t[-p port_number]\n");
++ exit(1);
++ }
++ }
++
++ printf("rdma_server: start\n");
++ ret = run();
++ printf("rdma_server: end %d\n", ret);
++ return ret;
++}