[Stgt-devel] [PATCH 19/20] iser flush before disconn

Pete Wyckoff pw
Tue Oct 16 17:21:26 CEST 2007


It sometimes happens that the CQ will have a flushed work request
before we have gotten around to picking up the CM disconnect event.
Don't exit if this happens, just complain a bit.

Signed-off-by: Pete Wyckoff <pw at osc.edu>
---
 usr/iscsi/iscsi_rdma.c |   35 +++++++++++++++++------------------
 1 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/usr/iscsi/iscsi_rdma.c b/usr/iscsi/iscsi_rdma.c
index 9e6bac6..f4c6c23 100644
--- a/usr/iscsi/iscsi_rdma.c
+++ b/usr/iscsi/iscsi_rdma.c
@@ -1045,27 +1045,26 @@ static void iser_rx_progress_one(struct iser_device *dev)
 		}
 
 		VALGRIND_MAKE_MEM_DEFINED(&wc, sizeof(wc));
-		if (wc.status != IBV_WC_SUCCESS) {
-			if (wc.status == IBV_WC_WR_FLUSH_ERR) {
-				recvl = ptr_from_int64(wc.wr_id);
-				ci = recvl->conn;
-				if (ci->draining) {
-					--ci->recvl_posted;
-					if (ci->freed && ci->recvl_posted == 0)
-						iscsi_rdma_conn_free(
-							ci->iscsi_conn);
-					continue;
-				}
+		if (wc.status == IBV_WC_SUCCESS) {
+			handle_wc(&wc);
+			if (++numwc == MAX_RX_PROGRESS) {
+				num_rx_ready = 1;
+				break;
+			}
+		} else if (wc.status == IBV_WC_WR_FLUSH_ERR) {
+			recvl = ptr_from_int64(wc.wr_id);
+			ci = recvl->conn;
+			if (ci->draining) {
+				--ci->recvl_posted;
+				if (ci->freed && ci->recvl_posted == 0)
+					iscsi_rdma_conn_free(ci->iscsi_conn);
+			} else {
+				eprintf("conn %p flush recv\n", ci);
+				/* call disconnect now? */
 			}
+		} else {
 			eprintf("bad WC status %d for wr_id 0x%llx\n",
 				wc.status, (unsigned long long) wc.wr_id);
-			exit(1);
-		}
-
-		handle_wc(&wc);
-		if (++numwc == MAX_RX_PROGRESS) {
-			num_rx_ready = 1;
-			break;
 		}
 	}
 }
-- 
1.5.3.4




More information about the stgt mailing list