aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/cnic.c
diff options
context:
space:
mode:
authorEddie Wai <waie@broadcom.com>2010-02-24 09:42:05 -0500
committerDavid S. Miller <davem@davemloft.net>2010-02-26 05:10:12 -0500
commit66883e90eaa0dd55d395c0f9a0c6da5d50809804 (patch)
tree1ff24317dba49de4e3566b9a58313a8ee04257fa /drivers/net/cnic.c
parenta9736c086cc6221659e498f0855152c32dbc1396 (diff)
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: Eddie Wai <waie@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/cnic.c')
-rw-r--r--drivers/net/cnic.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c
index 0fe83717967a..40865aac2afa 100644
--- a/drivers/net/cnic.c
+++ b/drivers/net/cnic.c
@@ -3108,7 +3108,10 @@ static void cnic_cm_process_kcqe(struct cnic_dev *dev, struct kcqe *kcqe)
3108 break; 3108 break;
3109 3109
3110 case L4_KCQE_OPCODE_VALUE_RESET_RECEIVED: 3110 case L4_KCQE_OPCODE_VALUE_RESET_RECEIVED:
3111 if (test_and_clear_bit(SK_F_OFFLD_COMPLETE, &csk->flags)) 3111 if (test_bit(CNIC_F_BNX2_CLASS, &dev->flags)) {
3112 cnic_cm_upcall(cp, csk, opcode);
3113 break;
3114 } else if (test_and_clear_bit(SK_F_OFFLD_COMPLETE, &csk->flags))
3112 csk->state = opcode; 3115 csk->state = opcode;
3113 /* fall through */ 3116 /* fall through */
3114 case L4_KCQE_OPCODE_VALUE_CLOSE_COMP: 3117 case L4_KCQE_OPCODE_VALUE_CLOSE_COMP:
@@ -3172,6 +3175,16 @@ static int cnic_ready_to_close(struct cnic_sock *csk, u32 opcode)
3172 if (!test_and_set_bit(SK_F_CLOSING, &csk->flags)) 3175 if (!test_and_set_bit(SK_F_CLOSING, &csk->flags))
3173 return 1; 3176 return 1;
3174 } 3177 }
3178 /* 57710+ only workaround to handle unsolicited RESET_COMP
3179 * which will be treated like a RESET RCVD notification
3180 * which triggers the clean up procedure
3181 */
3182 else if (opcode == L4_KCQE_OPCODE_VALUE_RESET_COMP) {
3183 if (!test_and_set_bit(SK_F_CLOSING, &csk->flags)) {
3184 csk->state = L4_KCQE_OPCODE_VALUE_RESET_RECEIVED;
3185 return 1;
3186 }
3187 }
3175 return 0; 3188 return 0;
3176} 3189}
3177 3190
@@ -3181,10 +3194,8 @@ static void cnic_close_bnx2_conn(struct cnic_sock *csk, u32 opcode)
3181 struct cnic_local *cp = dev->cnic_priv; 3194 struct cnic_local *cp = dev->cnic_priv;
3182 3195
3183 clear_bit(SK_F_CONNECT_START, &csk->flags); 3196 clear_bit(SK_F_CONNECT_START, &csk->flags);
3184 if (cnic_ready_to_close(csk, opcode)) { 3197 cnic_close_conn(csk);
3185 cnic_close_conn(csk); 3198 cnic_cm_upcall(cp, csk, opcode);
3186 cnic_cm_upcall(cp, csk, opcode);
3187 }
3188} 3199}
3189 3200
3190static void cnic_cm_stop_bnx2_hw(struct cnic_dev *dev) 3201static void cnic_cm_stop_bnx2_hw(struct cnic_dev *dev)