Modified the handling of the remote TCP RST code so the chip can now
flush the tx pipe accordingly upon a remote TCP RST reception.

Signed-off-by: Eddie Wai <eddie....@broadcom.com>
---
 drivers/scsi/bnx2i/bnx2i_hwi.c   |   11 ++++++++---
 drivers/scsi/bnx2i/bnx2i_iscsi.c |    8 +++-----
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/drivers/scsi/bnx2i/bnx2i_hwi.c b/drivers/scsi/bnx2i/bnx2i_hwi.c
index 7eeb673..4609ef5 100644
--- a/drivers/scsi/bnx2i/bnx2i_hwi.c
+++ b/drivers/scsi/bnx2i/bnx2i_hwi.c
@@ -2380,12 +2380,17 @@ static void bnx2i_cm_abort_cmpl(struct cnic_sock *cm_sk)
 static void bnx2i_cm_remote_close(struct cnic_sock *cm_sk)
 {
        struct bnx2i_endpoint *ep = (struct bnx2i_endpoint *) cm_sk->context;
+       u32 old_state = ep->state;
 
-       ep->state = EP_STATE_TCP_FIN_RCVD;
-       if (ep->conn)
-               bnx2i_recovery_que_add_conn(ep->hba, ep->conn);
+       ep->state = EP_STATE_TCP_RST_RCVD;
+       if (old_state == EP_STATE_DISCONN_START)
+               wake_up_interruptible(&ep->ofld_wait);
+       else
+               if (ep->conn)
+                       bnx2i_recovery_que_add_conn(ep->hba, ep->conn);
 }
 
+
 /**
  * bnx2i_cm_remote_abort - process TCP RST and start conn cleanup
  * @hba:               adapter structure pointer
diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b/drivers/scsi/bnx2i/bnx2i_iscsi.c
index 3b65c64..6a87a83 100644
--- a/drivers/scsi/bnx2i/bnx2i_iscsi.c
+++ b/drivers/scsi/bnx2i/bnx2i_iscsi.c
@@ -1911,6 +1911,7 @@ static int bnx2i_ep_tcp_conn_active(struct bnx2i_endpoint 
*bnx2i_ep)
 
        switch (bnx2i_ep->state) {
        case EP_STATE_CONNECT_START:
+       case EP_STATE_CONNECT_FAILED:
        case EP_STATE_CLEANUP_FAILED:
        case EP_STATE_OFLD_FAILED:
        case EP_STATE_DISCONN_TIMEDOUT:
@@ -1926,13 +1927,10 @@ static int bnx2i_ep_tcp_conn_active(struct 
bnx2i_endpoint *bnx2i_ep)
                ret = 1;
                break;
        case EP_STATE_TCP_RST_RCVD:
-               ret = 0;
-               break;
-       case EP_STATE_CONNECT_FAILED:
                if (cnic_dev_10g)
-                       ret = 1;
-               else
                        ret = 0;
+               else
+                       ret = 1;
                break;
        default:
                ret = 0;
-- 
1.7.0.5


-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-is...@googlegroups.com.
To unsubscribe from this group, send email to 
open-iscsi+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=en.

Reply via email to