Version: 1
-Previous: 3d9a15b3720d3f360064b33b64e9b295d6a1281c
-Head: f914f6853511dd5c0aa87bbd41433d795bb7748c
+Previous: 19c86e6b4e0389dab1619da9e31b236f9adb1faa
+Head: 73a673f1bcdab2cee96fde1274b1ac742924b1a7
Applied:
- dbg-fork: e7cc6a067af8aac26c77b33a791368896e3f5660
- refresh-temp: f914f6853511dd5c0aa87bbd41433d795bb7748c
+ dbg-fork: 73a673f1bcdab2cee96fde1274b1ac742924b1a7
Unapplied:
af_ib: 2e4bfa467343c57c68616c1922c01765df3ed1db
dbg-out: 4b4c0572eab77856d8fbb919b1feb8f3502a101a
Bottom: 30191aa638f3f574e67a71c82fa7771bcc620c52
-Top: 30191aa638f3f574e67a71c82fa7771bcc620c52
+Top: 36fe9752394406c04c3d8f13fe21a0a3fdade499
Author: Sean Hefty <sean.hefty@intel.com>
Date: 2012-08-21 13:49:59 -0700
---
-
+diff --git a/src/rsocket.c b/src/rsocket.c
+index 4c4821b..52476a2 100644
+--- a/src/rsocket.c
++++ b/src/rsocket.c
+@@ -156,6 +156,10 @@ struct rsocket {
+ fastlock_t cq_lock;
+ fastlock_t cq_wait_lock;
+
++ struct rs_msg last_ctrl;
++ uint64_t bytes_sent;
++ uint64_t bytes_received;
++
+ int opts;
+ long fd_flags;
+ uint64_t so_opts;
+@@ -816,6 +820,7 @@ static void rs_send_credits(struct rsocket *rs)
+
+ rs->ctrl_avail--;
+ rs->rseq_comp = rs->rseq_no + (rs->rq_size >> 1);
++ rs->last_ctrl.op = rs->rseq_no + rs->rq_size;
+ if (rs->rbuf_bytes_avail >= (rs->rbuf_size >> 1)) {
+ if (!(rs->opts & RS_OPT_SWAP_SGL)) {
+ sge.addr = (uintptr_t) &rs->rbuf[rs->rbuf_free_offset];
+@@ -830,6 +835,7 @@ static void rs_send_credits(struct rsocket *rs)
+ ibsge.addr = (uintptr_t) &sge;
+ ibsge.lkey = 0;
+ ibsge.length = sizeof(sge);
++ rs->last_ctrl.data = sge.length;
+
+ rs_post_write(rs, &ibsge, 1,
+ rs_msg_set(RS_OP_SGL, rs->rseq_no + rs->rq_size),
+@@ -845,6 +851,7 @@ static void rs_send_credits(struct rsocket *rs)
+ if (++rs->remote_sge == rs->remote_sgl.length)
+ rs->remote_sge = 0;
+ } else {
++ rs->last_ctrl.data = 0;
+ rs_post_write(rs, NULL, 0,
+ rs_msg_set(RS_OP_SGL, rs->rseq_no + rs->rq_size), 0, 0, 0);
+ }
+@@ -1173,6 +1180,7 @@ ssize_t rrecv(int socket, void *buf, size_t len, int flags)
+
+ } while (left && (flags & MSG_WAITALL) && (rs->state & rs_connect_rd));
+
++ rs->bytes_received += (len - left);
+ fastlock_release(&rs->rlock);
+ return ret ? ret : len - left;
+ }
+@@ -1289,6 +1297,7 @@ ssize_t rsend(int socket, const void *buf, size_t len, int flags)
+ if (ret)
+ break;
+ }
++ rs->bytes_sent += (len - left);
+ fastlock_release(&rs->slock);
+
+ return (ret && left == len) ? ret : len - left;
+++ /dev/null
-Bottom: 30191aa638f3f574e67a71c82fa7771bcc620c52
-Top: 36fe9752394406c04c3d8f13fe21a0a3fdade499
-Author: Sean Hefty <sean.hefty@intel.com>
-Date: 2012-08-21 14:02:04 -0700
-
-Refresh of dbg-fork
-
----
-
-diff --git a/src/rsocket.c b/src/rsocket.c
-index 4c4821b..52476a2 100644
---- a/src/rsocket.c
-+++ b/src/rsocket.c
-@@ -156,6 +156,10 @@ struct rsocket {
- fastlock_t cq_lock;
- fastlock_t cq_wait_lock;
-
-+ struct rs_msg last_ctrl;
-+ uint64_t bytes_sent;
-+ uint64_t bytes_received;
-+
- int opts;
- long fd_flags;
- uint64_t so_opts;
-@@ -816,6 +820,7 @@ static void rs_send_credits(struct rsocket *rs)
-
- rs->ctrl_avail--;
- rs->rseq_comp = rs->rseq_no + (rs->rq_size >> 1);
-+ rs->last_ctrl.op = rs->rseq_no + rs->rq_size;
- if (rs->rbuf_bytes_avail >= (rs->rbuf_size >> 1)) {
- if (!(rs->opts & RS_OPT_SWAP_SGL)) {
- sge.addr = (uintptr_t) &rs->rbuf[rs->rbuf_free_offset];
-@@ -830,6 +835,7 @@ static void rs_send_credits(struct rsocket *rs)
- ibsge.addr = (uintptr_t) &sge;
- ibsge.lkey = 0;
- ibsge.length = sizeof(sge);
-+ rs->last_ctrl.data = sge.length;
-
- rs_post_write(rs, &ibsge, 1,
- rs_msg_set(RS_OP_SGL, rs->rseq_no + rs->rq_size),
-@@ -845,6 +851,7 @@ static void rs_send_credits(struct rsocket *rs)
- if (++rs->remote_sge == rs->remote_sgl.length)
- rs->remote_sge = 0;
- } else {
-+ rs->last_ctrl.data = 0;
- rs_post_write(rs, NULL, 0,
- rs_msg_set(RS_OP_SGL, rs->rseq_no + rs->rq_size), 0, 0, 0);
- }
-@@ -1173,6 +1180,7 @@ ssize_t rrecv(int socket, void *buf, size_t len, int flags)
-
- } while (left && (flags & MSG_WAITALL) && (rs->state & rs_connect_rd));
-
-+ rs->bytes_received += (len - left);
- fastlock_release(&rs->rlock);
- return ret ? ret : len - left;
- }
-@@ -1289,6 +1297,7 @@ ssize_t rsend(int socket, const void *buf, size_t len, int flags)
- if (ret)
- break;
- }
-+ rs->bytes_sent += (len - left);
- fastlock_release(&rs->slock);
-
- return (ret && left == len) ? ret : len - left;