Commit 0d650ec7 authored by Eddie Wai's avatar Eddie Wai Committed by David S. Miller

cnic: Fix rare race condition during iSCSI disconnect.

If the initiator and target try to close the connection at about the same
time, there is a race condition in the termination sequence for bnx2x.
Fix the problem by waiting for the remote termination to complete before
deleting the Connection ID.  This will prevent the firmware assert.

Update version to 2.5.15.
Signed-off-by: default avatarEddie Wai <eddie.wai@broadcom.com>
Signed-off-by: default avatarMichael Chan <mchan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent caa9e931
...@@ -3853,12 +3853,17 @@ static int cnic_cm_abort(struct cnic_sock *csk) ...@@ -3853,12 +3853,17 @@ static int cnic_cm_abort(struct cnic_sock *csk)
return cnic_cm_abort_req(csk); return cnic_cm_abort_req(csk);
/* Getting here means that we haven't started connect, or /* Getting here means that we haven't started connect, or
* connect was not successful. * connect was not successful, or it has been reset by the target.
*/ */
cp->close_conn(csk, opcode); cp->close_conn(csk, opcode);
if (csk->state != opcode) if (csk->state != opcode) {
/* Wait for remote reset sequence to complete */
while (test_bit(SK_F_PG_OFFLD_COMPLETE, &csk->flags))
msleep(1);
return -EALREADY; return -EALREADY;
}
return 0; return 0;
} }
...@@ -3872,6 +3877,10 @@ static int cnic_cm_close(struct cnic_sock *csk) ...@@ -3872,6 +3877,10 @@ static int cnic_cm_close(struct cnic_sock *csk)
csk->state = L4_KCQE_OPCODE_VALUE_CLOSE_COMP; csk->state = L4_KCQE_OPCODE_VALUE_CLOSE_COMP;
return cnic_cm_close_req(csk); return cnic_cm_close_req(csk);
} else { } else {
/* Wait for remote reset sequence to complete */
while (test_bit(SK_F_PG_OFFLD_COMPLETE, &csk->flags))
msleep(1);
return -EALREADY; return -EALREADY;
} }
return 0; return 0;
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
#include "bnx2x/bnx2x_mfw_req.h" #include "bnx2x/bnx2x_mfw_req.h"
#define CNIC_MODULE_VERSION "2.5.14" #define CNIC_MODULE_VERSION "2.5.15"
#define CNIC_MODULE_RELDATE "Sep 30, 2012" #define CNIC_MODULE_RELDATE "Dec 04, 2012"
#define CNIC_ULP_RDMA 0 #define CNIC_ULP_RDMA 0
#define CNIC_ULP_ISCSI 1 #define CNIC_ULP_ISCSI 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment