aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEddie Wai <eddie.wai@broadcom.com>2012-12-05 05:10:15 -0500
committerDavid S. Miller <davem@davemloft.net>2012-12-05 16:01:28 -0500
commit0d650ec75a0d2525dbc98f1a04ed0b2a4bf5d3ac (patch)
tree8568b55f2f3a26e610dc97cec622c1996d5c3c39
parentcaa9e931fe40c9ffad4d951555675417ab074ea5 (diff)
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: Eddie Wai <eddie.wai@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/broadcom/cnic.c13
-rw-r--r--drivers/net/ethernet/broadcom/cnic_if.h4
2 files changed, 13 insertions, 4 deletions
diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c
index 5437e2aa97b5..091c60a9897c 100644
--- a/drivers/net/ethernet/broadcom/cnic.c
+++ b/drivers/net/ethernet/broadcom/cnic.c
@@ -3853,12 +3853,17 @@ static int cnic_cm_abort(struct cnic_sock *csk)
3853 return cnic_cm_abort_req(csk); 3853 return cnic_cm_abort_req(csk);
3854 3854
3855 /* Getting here means that we haven't started connect, or 3855 /* Getting here means that we haven't started connect, or
3856 * connect was not successful. 3856 * connect was not successful, or it has been reset by the target.
3857 */ 3857 */
3858 3858
3859 cp->close_conn(csk, opcode); 3859 cp->close_conn(csk, opcode);
3860 if (csk->state != opcode) 3860 if (csk->state != opcode) {
3861 /* Wait for remote reset sequence to complete */
3862 while (test_bit(SK_F_PG_OFFLD_COMPLETE, &csk->flags))
3863 msleep(1);
3864
3861 return -EALREADY; 3865 return -EALREADY;
3866 }
3862 3867
3863 return 0; 3868 return 0;
3864} 3869}
@@ -3872,6 +3877,10 @@ static int cnic_cm_close(struct cnic_sock *csk)
3872 csk->state = L4_KCQE_OPCODE_VALUE_CLOSE_COMP; 3877 csk->state = L4_KCQE_OPCODE_VALUE_CLOSE_COMP;
3873 return cnic_cm_close_req(csk); 3878 return cnic_cm_close_req(csk);
3874 } else { 3879 } else {
3880 /* Wait for remote reset sequence to complete */
3881 while (test_bit(SK_F_PG_OFFLD_COMPLETE, &csk->flags))
3882 msleep(1);
3883
3875 return -EALREADY; 3884 return -EALREADY;
3876 } 3885 }
3877 return 0; 3886 return 0;
diff --git a/drivers/net/ethernet/broadcom/cnic_if.h b/drivers/net/ethernet/broadcom/cnic_if.h
index 865095aad1f6..502e11ef6373 100644
--- a/drivers/net/ethernet/broadcom/cnic_if.h
+++ b/drivers/net/ethernet/broadcom/cnic_if.h
@@ -14,8 +14,8 @@
14 14
15#include "bnx2x/bnx2x_mfw_req.h" 15#include "bnx2x/bnx2x_mfw_req.h"
16 16
17#define CNIC_MODULE_VERSION "2.5.14" 17#define CNIC_MODULE_VERSION "2.5.15"
18#define CNIC_MODULE_RELDATE "Sep 30, 2012" 18#define CNIC_MODULE_RELDATE "Dec 04, 2012"
19 19
20#define CNIC_ULP_RDMA 0 20#define CNIC_ULP_RDMA 0
21#define CNIC_ULP_ISCSI 1 21#define CNIC_ULP_ISCSI 1