]> git.openfabrics.org - ~shefty/librdmacm.git/commitdiff
refresh (create temporary patch)
authorSean Hefty <sean.hefty@intel.com>
Wed, 16 May 2012 18:56:27 +0000 (11:56 -0700)
committerSean Hefty <sean.hefty@intel.com>
Wed, 16 May 2012 18:56:27 +0000 (11:56 -0700)
meta
patches/refresh-temp [new file with mode: 0644]

diff --git a/meta b/meta
index d6044c9496065d93de644189bef835e6d7a72316..f1fd629e33099758f8dbe46274ca4321eabd6823 100644 (file)
--- a/meta
+++ b/meta
@@ -1,12 +1,13 @@
 Version: 1
-Previous: fc9064aab65c84f5c7f6f7f4a0117197b9613295
-Head: 1c469eecaadfb6365366dcce29ef2a2d76197cd7
+Previous: f77778a3c9588e59833243dab4cce61b227d8b2a
+Head: 391de150082d1c7bcd36e24484258b51b2462504
 Applied:
   rs-locking: ec6a8efe211b0dc98548443c2e0d67e2c355351f
   reuseaddr: 5ce7d9c48d082fd1959918e9134f4bdd85c402d9
   rstream-delay: 8f0437ec677c4752126de8667e093667dd681d56
   rstream-async-opt: 0ee1dfc9ad50f07fd3708ebb04cb92e0fb2f41d5
   rstream-spinpoll: 1c469eecaadfb6365366dcce29ef2a2d76197cd7
+  refresh-temp: 391de150082d1c7bcd36e24484258b51b2462504
 Unapplied:
   comp_locks: b89aab130b4619806557e11e6b9c10964f00743f
   preload: 5dfe7abc07064485c5100e04e5412279244c2bc3
diff --git a/patches/refresh-temp b/patches/refresh-temp
new file mode 100644 (file)
index 0000000..7224398
--- /dev/null
@@ -0,0 +1,125 @@
+Bottom: fb3f150e6146757e6bdb884182c4b19457bd6b6b
+Top:    ed3c9123d122743be28892d7fce45407ab240329
+Author: Sean Hefty <sean.hefty@intel.com>
+Date:   2012-05-16 11:56:27 -0700
+
+Refresh of rstream-spinpoll
+
+---
+
+diff --git a/examples/rstream.c b/examples/rstream.c
+index decb204..b7c33f6 100644
+--- a/examples/rstream.c
++++ b/examples/rstream.c
+@@ -55,6 +55,7 @@ static int test_size[] = {
+ static int use_rs = 1;
+ static int use_async;
++static int poll_timeout = -1;
+ static int verify;
+ static int flags = MSG_DONTWAIT;
+ static int no_delay = 1;
+@@ -191,6 +192,17 @@ static int verify_buf(void *buf, int size)
+       return 0;
+ }
++static int do_poll(struct pollfd *fds)
++{
++      int ret;
++
++      do {
++              ret = rs_poll(&fds, 1, poll_timeout);
++      } while (ret < 0 && (errno == EAGAIN || errno == EWOULDBLOCK));
++
++      return ret;
++}
++
+ static int send_xfer(int rs, int size)
+ {
+       struct pollfd fds;
+@@ -206,7 +218,7 @@ static int send_xfer(int rs, int size)
+       for (offset = 0; offset < size; ) {
+               if (use_async) {
+-                      ret = rs_poll(&fds, 1, -1);
++                      ret = do_poll(&fds);
+                       if (ret != 1)
+                               return ret;
+               }
+@@ -235,7 +247,7 @@ static int recv_xfer(int rs, int size)
+       for (offset = 0; offset < size; ) {
+               if (use_async) {
+-                      ret = rs_poll(&fds, 1, -1);
++                      ret = do_poll(&fds);
+                       if (ret != 1)
+                               return ret;
+               }
+@@ -380,7 +392,7 @@ static int server_connect(void)
+                       fds.fd = lrs;
+                       fds.events = POLLIN;
+-                      ret = rs_poll(&fds, 1, -1);
++                      ret = do_poll(&fds);
+                       if (ret != 1) {
+                               perror("rpoll");
+                               goto close;
+@@ -424,21 +436,26 @@ static int client_connect(void)
+       ret = rs_connect(rs, res->ai_addr, res->ai_addrlen);
+       if (ret && (errno != EINPROGRESS)) {
+               perror("rconnect");
+-              rs_close(rs);
+-              rs = ret;
++              goto err;
+       }
+       if (errno == EINPROGRESS) {
+               fds.fd = rs;
+               fds.events = POLLOUT;
+-              do {
+-                      ret = rs_poll(&fds, 1, -1);
+-              } while (!ret);
++              ret = do_poll(&fds);
++              if (ret != 1) {
++                      perror("rpoll");
++                      goto err;
++              }
+       }
+ free:
+       freeaddrinfo(res);
+       return rs;
++err:
++      freeaddrinfo(res);
++      rs_close(rs);
++      return -1;
+ }
+ static int run(void)
+@@ -494,6 +511,9 @@ static int set_test_opt(char *optarg)
+                       flags |= MSG_DONTWAIT;
+                       no_delay = 1;
+                       break;
++              case 'p':
++                      poll_timeout = 0;
++                      break;
+               case 'v':
+                       verify = 1;
+                       break;
+@@ -511,6 +531,8 @@ static int set_test_opt(char *optarg)
+               } else if (!strncasecmp("nonblock", optarg, 8)) {
+                       flags |= MSG_DONTWAIT;
+                       no_delay = 1;
++              } else if (!strncasecmp("poll", optarg, 4)) {
++                      poll_timeout = 0;
+               } else if (!strncasecmp("verify", optarg, 6)) {
+                       verify = 1;
+               } else {
+@@ -564,6 +586,7 @@ int main(int argc, char **argv)
+                       printf("\t    a|async - asynchronous operation (use poll)\n");
+                       printf("\t    b|blocking - use blocking calls\n");
+                       printf("\t    n|nonblocking - use nonblocking calls\n");
++                      printf("\t    p|poll - poll on asynchronous operations\n")
+                       printf("\t    v|verify - verify data\n");
+                       exit(1);
+               }