From: "Michael Chan" <mchan@broadcom.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: [PATCH net-next 7/9] cnic: Call cm_connect_complete() immediately on error
Date: Thu, 23 Dec 2010 09:43:02 -0800 [thread overview]
Message-ID: <1293126184-13097-8-git-send-email-mchan@broadcom.com> (raw)
In-Reply-To: <1293126184-13097-7-git-send-email-mchan@broadcom.com>
From: Eddie Wai <waie@broadcom.com>
If we get a path_resp error from userspace, call cm_connect_complete()
immediately with error so that bnx2i can react to the error faster.
Signed-off-by: Eddie Wai <waie@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/cnic.c | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c
index 1240dea..36c1578 100644
--- a/drivers/net/cnic.c
+++ b/drivers/net/cnic.c
@@ -322,6 +322,8 @@ static int cnic_send_nlmsg(struct cnic_local *cp, u32 type,
return 0;
}
+static void cnic_cm_upcall(struct cnic_local *, struct cnic_sock *, u8);
+
static int cnic_iscsi_nl_msg_recv(struct cnic_dev *dev, u32 msg_type,
char *buf, u16 len)
{
@@ -351,7 +353,9 @@ static int cnic_iscsi_nl_msg_recv(struct cnic_dev *dev, u32 msg_type,
}
csk = &cp->csk_tbl[l5_cid];
csk_hold(csk);
- if (cnic_in_use(csk)) {
+ if (cnic_in_use(csk) &&
+ test_bit(SK_F_CONNECT_START, &csk->flags)) {
+
memcpy(csk->ha, path_resp->mac_addr, 6);
if (test_bit(SK_F_IPV6, &csk->flags))
memcpy(&csk->src_ip[0], &path_resp->src.v6_addr,
@@ -359,8 +363,16 @@ static int cnic_iscsi_nl_msg_recv(struct cnic_dev *dev, u32 msg_type,
else
memcpy(&csk->src_ip[0], &path_resp->src.v4_addr,
sizeof(struct in_addr));
- if (is_valid_ether_addr(csk->ha))
+
+ if (is_valid_ether_addr(csk->ha)) {
cnic_cm_set_pg(csk);
+ } else if (!test_bit(SK_F_OFFLD_SCHED, &csk->flags) &&
+ !test_bit(SK_F_OFFLD_COMPLETE, &csk->flags)) {
+
+ cnic_cm_upcall(cp, csk,
+ L4_KCQE_OPCODE_VALUE_CONNECT_COMPLETE);
+ clear_bit(SK_F_CONNECT_START, &csk->flags);
+ }
}
csk_put(csk);
rcu_read_unlock();
--
1.6.4.GIT
next prev parent reply other threads:[~2010-12-23 18:40 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-23 17:42 [PATCH net-next 0/9] cnic: Bug fixes and FCoE support Michael Chan
2010-12-23 17:42 ` [PATCH net-next 1/9] cnic: Fix iSCSI TCP port endian order Michael Chan
2010-12-23 17:42 ` [PATCH net-next 2/9] cnic: Prevent "scheduling while atomic" when calling ->cnic_init() Michael Chan
2010-12-23 17:42 ` [PATCH net-next 3/9] cnic: Improve ->iscsi_nl_msg_send() Michael Chan
2010-12-23 17:42 ` [PATCH net-next 4/9] cnic: Use proper client and connection IDs on iSCSI ring Michael Chan
2010-12-23 17:43 ` [PATCH net-next 5/9] cnic: Support NIC Partition mode Michael Chan
2010-12-23 17:43 ` Michael Chan
2010-12-23 17:43 ` Michael Chan [this message]
2010-12-23 17:43 ` [PATCH net-next 8/9] cnic: Add kcq2 support on 57712 Michael Chan
2010-12-23 17:43 ` [PATCH net-next 9/9] cnic: Add FCoE " Michael Chan
2010-12-23 19:27 ` [PATCH net-next 0/9] cnic: Bug fixes and FCoE support David Miller
2010-12-23 19:29 ` Michael Chan
2010-12-23 20:01 ` 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=1293126184-13097-8-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).