Commit 66883e90 authored by Eddie Wai's avatar Eddie Wai Committed by David S. Miller

cnic: Finetune iSCSI connection reset.

For bnx2 devices, always send notification to bnx2i to let it initiate
the cleanup when RST is received.

For bnx2x devices, add unsolicited RST_COMP handling to start the cleanup.
Signed-off-by: default avatarEddie Wai <waie@broadcom.com>
Signed-off-by: default avatarMichael Chan <mchan@broadcom.com>
Signed-off-by: default avatarBenjamin Li <benli@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a9736c08
...@@ -3108,7 +3108,10 @@ static void cnic_cm_process_kcqe(struct cnic_dev *dev, struct kcqe *kcqe) ...@@ -3108,7 +3108,10 @@ static void cnic_cm_process_kcqe(struct cnic_dev *dev, struct kcqe *kcqe)
break; break;
case L4_KCQE_OPCODE_VALUE_RESET_RECEIVED: case L4_KCQE_OPCODE_VALUE_RESET_RECEIVED:
if (test_and_clear_bit(SK_F_OFFLD_COMPLETE, &csk->flags)) if (test_bit(CNIC_F_BNX2_CLASS, &dev->flags)) {
cnic_cm_upcall(cp, csk, opcode);
break;
} else if (test_and_clear_bit(SK_F_OFFLD_COMPLETE, &csk->flags))
csk->state = opcode; csk->state = opcode;
/* fall through */ /* fall through */
case L4_KCQE_OPCODE_VALUE_CLOSE_COMP: case L4_KCQE_OPCODE_VALUE_CLOSE_COMP:
...@@ -3172,6 +3175,16 @@ static int cnic_ready_to_close(struct cnic_sock *csk, u32 opcode) ...@@ -3172,6 +3175,16 @@ static int cnic_ready_to_close(struct cnic_sock *csk, u32 opcode)
if (!test_and_set_bit(SK_F_CLOSING, &csk->flags)) if (!test_and_set_bit(SK_F_CLOSING, &csk->flags))
return 1; return 1;
} }
/* 57710+ only workaround to handle unsolicited RESET_COMP
* which will be treated like a RESET RCVD notification
* which triggers the clean up procedure
*/
else if (opcode == L4_KCQE_OPCODE_VALUE_RESET_COMP) {
if (!test_and_set_bit(SK_F_CLOSING, &csk->flags)) {
csk->state = L4_KCQE_OPCODE_VALUE_RESET_RECEIVED;
return 1;
}
}
return 0; return 0;
} }
...@@ -3181,10 +3194,8 @@ static void cnic_close_bnx2_conn(struct cnic_sock *csk, u32 opcode) ...@@ -3181,10 +3194,8 @@ static void cnic_close_bnx2_conn(struct cnic_sock *csk, u32 opcode)
struct cnic_local *cp = dev->cnic_priv; struct cnic_local *cp = dev->cnic_priv;
clear_bit(SK_F_CONNECT_START, &csk->flags); clear_bit(SK_F_CONNECT_START, &csk->flags);
if (cnic_ready_to_close(csk, opcode)) {
cnic_close_conn(csk); cnic_close_conn(csk);
cnic_cm_upcall(cp, csk, opcode); cnic_cm_upcall(cp, csk, opcode);
}
} }
static void cnic_cm_stop_bnx2_hw(struct cnic_dev *dev) static void cnic_cm_stop_bnx2_hw(struct cnic_dev *dev)
......
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