From: "Michael Chan" <mchan@broadcom.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: [PATCH 2/5 net-next] cnic: Fix race conditions with firmware
Date: Wed, 8 Jun 2011 22:29:33 -0700 [thread overview]
Message-ID: <1307597376-5379-2-git-send-email-mchan@broadcom.com> (raw)
In-Reply-To: <1307597376-5379-1-git-send-email-mchan@broadcom.com>
During iSCSI connection terminations, if the target is also terminating
at about the same time, the firmware may not complete the driver's
request to close or reset the connection. This is fixed by handling
other events (instead of the expected completion event) as an indication
that the driver's request has been rejected.
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/cnic.c | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c
index 5c0a669..ea7245c 100644
--- a/drivers/net/cnic.c
+++ b/drivers/net/cnic.c
@@ -3767,7 +3767,13 @@ static void cnic_cm_process_kcqe(struct cnic_dev *dev, struct kcqe *kcqe)
break;
case L4_KCQE_OPCODE_VALUE_CLOSE_RECEIVED:
- cnic_cm_upcall(cp, csk, opcode);
+ /* after we already sent CLOSE_REQ */
+ if (test_bit(CNIC_F_BNX2X_CLASS, &dev->flags) &&
+ !test_bit(SK_F_OFFLD_COMPLETE, &csk->flags) &&
+ csk->state == L4_KCQE_OPCODE_VALUE_CLOSE_COMP)
+ cp->close_conn(csk, L4_KCQE_OPCODE_VALUE_RESET_COMP);
+ else
+ cnic_cm_upcall(cp, csk, opcode);
break;
}
csk_put(csk);
@@ -3821,12 +3827,14 @@ static int cnic_ready_to_close(struct cnic_sock *csk, u32 opcode)
}
/* 1. If event opcode matches the expected event in csk->state
- * 2. If the expected event is CLOSE_COMP, we accept any event
+ * 2. If the expected event is CLOSE_COMP or RESET_COMP, we accept any
+ * event
* 3. If the expected event is 0, meaning the connection was never
* never established, we accept the opcode from cm_abort.
*/
if (opcode == csk->state || csk->state == 0 ||
- csk->state == L4_KCQE_OPCODE_VALUE_CLOSE_COMP) {
+ csk->state == L4_KCQE_OPCODE_VALUE_CLOSE_COMP ||
+ csk->state == L4_KCQE_OPCODE_VALUE_RESET_COMP) {
if (!test_and_set_bit(SK_F_CLOSING, &csk->flags)) {
if (csk->state == 0)
csk->state = opcode;
--
1.6.4.GIT
next prev parent reply other threads:[~2011-06-09 6:21 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-09 5:29 [PATCH 1/5 net-next] cnic: Fix interrupt logic Michael Chan
2011-06-09 5:29 ` Michael Chan [this message]
2011-06-09 5:29 ` [PATCH 3/5 net-next] cnic: Randomize initial TCP port for iSCSI connections Michael Chan
2011-06-09 5:29 ` [PATCH 4/5 net-next] cnic: Improve NETDEV_UP event handling Michael Chan
2011-06-09 5:29 ` [PATCH 5/5 net-next] cnic, bnx2: Check iSCSI support early in bnx2_init_one() Michael Chan
2011-06-09 6:53 ` David Miller
2011-06-09 10:42 ` Neil Horman
2011-06-10 0:37 ` Michael Chan
2011-06-09 6:53 ` [PATCH 4/5 net-next] cnic: Improve NETDEV_UP event handling David Miller
2011-06-09 6:53 ` [PATCH 3/5 net-next] cnic: Randomize initial TCP port for iSCSI connections David Miller
2011-06-09 15:27 ` Stephen Hemminger
2011-06-10 1:08 ` Michael Chan
2011-06-10 4:01 ` Stephen Hemminger
2011-06-10 4:39 ` Eric Dumazet
2011-06-10 6:25 ` Michael Chan
2011-06-09 6:53 ` [PATCH 2/5 net-next] cnic: Fix race conditions with firmware David Miller
2011-06-09 6:52 ` [PATCH 1/5 net-next] cnic: Fix interrupt logic 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=1307597376-5379-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).