From: "Michael Chan" <mchan@broadcom.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: [PATCH net-next 2/6] cnic: Finetune iSCSI connection reset.
Date: Wed, 24 Feb 2010 16:42:05 -0800 [thread overview]
Message-ID: <1267058529-18454-2-git-send-email-mchan@broadcom.com> (raw)
In-Reply-To: <1267058529-18454-1-git-send-email-mchan@broadcom.com>
From: Eddie Wai <waie@broadcom.com>
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>
---
drivers/net/cnic.c | 21 ++++++++++++++++-----
1 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c
index 0fe8371..40865aa 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)
break;
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;
/* fall through */
case L4_KCQE_OPCODE_VALUE_CLOSE_COMP:
@@ -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))
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;
}
@@ -3181,10 +3194,8 @@ static void cnic_close_bnx2_conn(struct cnic_sock *csk, u32 opcode)
struct cnic_local *cp = dev->cnic_priv;
clear_bit(SK_F_CONNECT_START, &csk->flags);
- if (cnic_ready_to_close(csk, opcode)) {
- cnic_close_conn(csk);
- cnic_cm_upcall(cp, csk, opcode);
- }
+ cnic_close_conn(csk);
+ cnic_cm_upcall(cp, csk, opcode);
}
static void cnic_cm_stop_bnx2_hw(struct cnic_dev *dev)
--
1.6.4.GIT
next prev parent reply other threads:[~2010-02-25 0:32 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-25 0:42 [PATCH net-next 1/6] cnic: Finetune iSCSI connection set up Michael Chan
2010-02-25 0:42 ` Michael Chan [this message]
2010-02-25 0:42 ` [PATCH net-next 3/6] cnic: Fix panic in cnic_iscsi_nl_msg_recv() when device is down Michael Chan
2010-02-25 0:42 ` [PATCH net-next 4/6] cnic: Simplify route checking during iSCSI connection Michael Chan
2010-02-25 0:42 ` [PATCH net-next 5/6] cnic: Use union for the status blocks of different devices Michael Chan
2010-02-25 0:42 ` [PATCH net-next 6/6] cnic: Update version to 2.1.1 Michael Chan
2010-02-26 10:11 ` David Miller
2010-02-26 10:11 ` [PATCH net-next 5/6] cnic: Use union for the status blocks of different devices David Miller
2010-02-26 10:11 ` [PATCH net-next 4/6] cnic: Simplify route checking during iSCSI connection David Miller
2010-02-26 0:51 ` [PATCH net-next 3/6] cnic: Fix panic in cnic_iscsi_nl_msg_recv() when device is down Simon Horman
2010-02-26 7:01 ` Michael Chan
2010-02-26 18:40 ` Paul E. McKenney
2010-02-26 19:11 ` Michael Chan
2010-02-26 19:33 ` Paul E. McKenney
2010-02-26 10:11 ` David Miller
2010-02-26 10:11 ` [PATCH net-next 2/6] cnic: Finetune iSCSI connection reset David Miller
2010-02-26 10:11 ` [PATCH net-next 1/6] cnic: Finetune iSCSI connection set up David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1267058529-18454-2-git-send-email-mchan@broadcom.com \
--to=mchan@broadcom.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).