[ofw][patch][WinVerbs tests] fix IPv6 related connection problem

Leonid Keller leonid at mellanox.co.il
Wed Feb 18 03:24:22 PST 2009


All WinVerbs test (client part) require host IP address as a parameter.
We used to use IPv4 address as it is more comfortable.
But if IPv6 protocol is installed, which is default for Win2008, the
connection code in the tests doesn't work right.
This patch suggest a fix, that limiting the usage of host addresses to
IPv4 only.
The same limitation exists today also in tools\perftests.
 
Index: tests/perftest/rdma_bw/rdma_bw.c
===================================================================
--- tests/perftest/rdma_bw/rdma_bw.c (revision 1976)
+++ tests/perftest/rdma_bw/rdma_bw.c (working copy)
@@ -215,6 +215,8 @@
   rdma_ack_cm_event(event);
  } else {
   for (t = res; t; t = t->ai_next) {
+   if (t->ai_family != AF_INET)
+    continue;
    sockfd = socket(t->ai_family, t->ai_socktype,
        t->ai_protocol);
    if (sockfd != INVALID_SOCKET) {
@@ -382,6 +384,8 @@
   rdma_ack_cm_event(event); 
  } else {
   for (t = res; t; t = t->ai_next) {
+   if (t->ai_family != AF_INET)
+    continue;
    sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
    if (sockfd != INVALID_SOCKET) {
     n = 1;
Index: tests/perftest/rdma_lat/rdma_lat.c
===================================================================
--- tests/perftest/rdma_lat/rdma_lat.c (revision 1976)
+++ tests/perftest/rdma_lat/rdma_lat.c (working copy)
@@ -294,6 +294,8 @@
   rdma_ack_cm_event(event);
  } else {
   for (t = res; t; t = t->ai_next) {
+   if (t->ai_family != AF_INET)
+    continue;
    sockfd = socket(t->ai_family, t->ai_socktype,
        t->ai_protocol);
    if (sockfd != INVALID_SOCKET) {
@@ -437,6 +439,8 @@
   rdma_ack_cm_event(event); 
  } else {
   for (t = res; t; t = t->ai_next) {
+   if (t->ai_family != AF_INET)
+    continue;
    sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
    if (sockfd != INVALID_SOCKET) {
     n = 1;
Index: tests/perftest/read_bw/read_bw.c
===================================================================
--- tests/perftest/read_bw/read_bw.c (revision 1976)
+++ tests/perftest/read_bw/read_bw.c (working copy)
@@ -126,6 +126,8 @@
  }
 
  for (t = res; t; t = t->ai_next) {
+  if (t->ai_family != AF_INET)
+   continue;
   sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
   if (sockfd != INVALID_SOCKET) {
    if (!connect(sockfd, t->ai_addr, t->ai_addrlen))
@@ -206,6 +208,8 @@
  }
 
  for (t = res; t; t = t->ai_next) {
+  if (t->ai_family != AF_INET)
+   continue;
   sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
   if (sockfd != INVALID_SOCKET) {
    n = 1;
Index: tests/perftest/read_lat/read_lat.c
===================================================================
--- tests/perftest/read_lat/read_lat.c (revision 1976)
+++ tests/perftest/read_lat/read_lat.c (working copy)
@@ -201,6 +201,8 @@
  }
 
  for (t = res; t; t = t->ai_next) {
+  if (t->ai_family != AF_INET)
+   continue;
   sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
   if (sockfd != INVALID_SOCKET) {
    if (!connect(sockfd, t->ai_addr, t->ai_addrlen))
@@ -250,6 +252,8 @@
  }
 
  for (t = res; t; t = t->ai_next) {
+  if (t->ai_family != AF_INET)
+   continue;
   sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
   if (sockfd != INVALID_SOCKET) {
    n = 1;
Index: tests/perftest/send_bw/send_bw.c
===================================================================
--- tests/perftest/send_bw/send_bw.c (revision 1976)
+++ tests/perftest/send_bw/send_bw.c (working copy)
@@ -142,6 +142,8 @@
 
  for (t = res; t; t = t->ai_next) {
   sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
+  if (t->ai_family != AF_INET)
+   continue;
   if (sockfd != INVALID_SOCKET) {
    if (!connect(sockfd, t->ai_addr, t->ai_addrlen))
     break;
@@ -221,6 +223,8 @@
  }
 
  for (t = res; t; t = t->ai_next) {
+  if (t->ai_family != AF_INET)
+   continue;
   sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
   if (sockfd != INVALID_SOCKET) {
    n = 1;
Index: tests/perftest/send_lat/send_lat.c
===================================================================
--- tests/perftest/send_lat/send_lat.c (revision 1976)
+++ tests/perftest/send_lat/send_lat.c (working copy)
@@ -212,6 +212,8 @@
  }
 
  for (t = res; t; t = t->ai_next) {
+  if (t->ai_family != AF_INET)
+   continue;
   sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
   if (sockfd != INVALID_SOCKET) {
    if (!connect(sockfd, t->ai_addr, t->ai_addrlen))
@@ -261,6 +263,8 @@
  }
 
  for (t = res; t; t = t->ai_next) {
+  if (t->ai_family != AF_INET)
+   continue;
   sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
   if (sockfd != INVALID_SOCKET) {
    n = 1;
Index: tests/perftest/write_bw/write_bw.c
===================================================================
--- tests/perftest/write_bw/write_bw.c (revision 1976)
+++ tests/perftest/write_bw/write_bw.c (working copy)
@@ -135,6 +135,8 @@
  }
 
  for (t = res; t; t = t->ai_next) {
+  if (t->ai_family != AF_INET)
+   continue;
   sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
   if (sockfd != INVALID_SOCKET) {
    if (!connect(sockfd, t->ai_addr, t->ai_addrlen))
@@ -215,6 +217,8 @@
  }
 
  for (t = res; t; t = t->ai_next) {
+  if (t->ai_family != AF_INET)
+   continue;
   sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
   if (sockfd != INVALID_SOCKET) {
    n = 1;
Index: tests/perftest/write_bw_postlist/write_bw_postlist.c
===================================================================
--- tests/perftest/write_bw_postlist/write_bw_postlist.c (revision 1976)
+++ tests/perftest/write_bw_postlist/write_bw_postlist.c (working copy)
@@ -138,6 +138,8 @@
  }
 
  for (t = res; t; t = t->ai_next) {
+  if (t->ai_family != AF_INET)
+   continue;
   sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
   if (sockfd >= 0) {
    if (!connect(sockfd, t->ai_addr, t->ai_addrlen))
@@ -218,6 +220,8 @@
  }
 
  for (t = res; t; t = t->ai_next) {
+  if (t->ai_family != AF_INET)
+   continue;
   sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
   if (sockfd >= 0) {
    n = 1;
Index: tests/perftest/write_lat/write_lat.c
===================================================================
--- tests/perftest/write_lat/write_lat.c (revision 1976)
+++ tests/perftest/write_lat/write_lat.c (working copy)
@@ -198,6 +198,8 @@
  }
 
  for (t = res; t; t = t->ai_next) {
+  if (t->ai_family != AF_INET)
+   continue;
   sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
   if (sockfd != INVALID_SOCKET) {
    if (!connect(sockfd, t->ai_addr, t->ai_addrlen))
@@ -247,6 +249,8 @@
  }
 
  for (t = res; t; t = t->ai_next) {
+  if (t->ai_family != AF_INET)
+   continue;
   sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
   if (sockfd != INVALID_SOCKET) {
    n = 1;
Index: ulp/libibverbs/examples/rc_pingpong/rc_pingpong.c
===================================================================
--- ulp/libibverbs/examples/rc_pingpong/rc_pingpong.c (revision 1976)
+++ ulp/libibverbs/examples/rc_pingpong/rc_pingpong.c (working copy)
@@ -137,6 +137,8 @@
  }
 
  for (t = res; t; t = t->ai_next) {
+  if (t->ai_family != AF_INET)
+   continue;
   sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
   if (sockfd != INVALID_SOCKET) {
    if (!connect(sockfd, t->ai_addr, t->ai_addrlen))
@@ -205,6 +207,8 @@
  }
 
  for (t = res; t; t = t->ai_next) {
+  if (t->ai_family != AF_INET)
+   continue;
   sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
   if (sockfd != INVALID_SOCKET) {
    n = 1;
Index: ulp/libibverbs/examples/srq_pingpong/srq_pingpong.c
===================================================================
--- ulp/libibverbs/examples/srq_pingpong/srq_pingpong.c (revision 1976)
+++ ulp/libibverbs/examples/srq_pingpong/srq_pingpong.c (working copy)
@@ -162,6 +162,8 @@
  }
 
  for (t = res; t; t = t->ai_next) {
+  if (t->ai_family != AF_INET)
+   continue;
   sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
   if (sockfd >= 0) {
    if (!connect(sockfd, t->ai_addr, t->ai_addrlen))
@@ -246,6 +248,8 @@
  }
 
  for (t = res; t; t = t->ai_next) {
+  if (t->ai_family != AF_INET)
+   continue;
   sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
   if (sockfd >= 0) {
    n = 1;
Index: ulp/libibverbs/examples/uc_pingpong/uc_pingpong.c
===================================================================
--- ulp/libibverbs/examples/uc_pingpong/uc_pingpong.c (revision 1976)
+++ ulp/libibverbs/examples/uc_pingpong/uc_pingpong.c (working copy)
@@ -124,6 +124,8 @@
  }
 
  for (t = res; t; t = t->ai_next) {
+  if (t->ai_family != AF_INET)
+   continue;
   sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
   if (sockfd != INVALID_SOCKET) {
    if (!connect(sockfd, t->ai_addr, t->ai_addrlen))
@@ -192,6 +194,8 @@
  }
 
  for (t = res; t; t = t->ai_next) {
+  if (t->ai_family != AF_INET)
+   continue;
   sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
   if (sockfd != INVALID_SOCKET) {
    n = 1;
Index: ulp/libibverbs/examples/ud_pingpong/ud_pingpong.c
===================================================================
--- ulp/libibverbs/examples/ud_pingpong/ud_pingpong.c (revision 1976)
+++ ulp/libibverbs/examples/ud_pingpong/ud_pingpong.c (working copy)
@@ -126,6 +126,8 @@
  }
 
  for (t = res; t; t = t->ai_next) {
+  if (t->ai_family != AF_INET)
+   continue;
   sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
   if (sockfd != INVALID_SOCKET) {
    if (!connect(sockfd, t->ai_addr, t->ai_addrlen))
@@ -193,6 +195,8 @@
  }
 
  for (t = res; t; t = t->ai_next) {
+  if (t->ai_family != AF_INET)
+   continue;
   sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
   if (sockfd != INVALID_SOCKET) {
    n = 1;

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20090218/9685a493/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wv_tests.patch
Type: application/octet-stream
Size: 9663 bytes
Desc: wv_tests.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20090218/9685a493/attachment.obj>


More information about the ofw mailing list