From: Vasu Dev <vasu.dev@intel.com>
To: linux-scsi@vger.kernel.org
Subject: [PATCH 3/5] fcoe: libfcoe: fix FIP link logic
Date: Wed, 04 Mar 2009 10:53:52 -0800 [thread overview]
Message-ID: <20090304185352.22010.73565.stgit@vi2.jf.intel.com> (raw)
In-Reply-To: <20090304185025.22010.45242.stgit@vi2.jf.intel.com>
From: Joe Eykholt <jeykholt@cisco.com>
FIP now controls whether the lport sees the link as up or not,
since the fabric connectivity not may exist even if the link is up.
So, the LLD (fcoe) should not depend on the lport->link_up info
to decide whether to report a link change to FIP.
The logic to control the link change has been moved into FIP and
under the fcoe_ctlr lock. So that only true link changes cause
statistics increments, fcoe_ctlr_stop() returns non-zero if it
is a "true" link drop so that the LLD can increment statistics
appropriately.
Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
---
drivers/scsi/fcoe/libfcoe.c | 26 ++++++++++----------------
1 files changed, 10 insertions(+), 16 deletions(-)
diff --git a/drivers/scsi/fcoe/libfcoe.c b/drivers/scsi/fcoe/libfcoe.c
index 42aa7d5..90d0136 100644
--- a/drivers/scsi/fcoe/libfcoe.c
+++ b/drivers/scsi/fcoe/libfcoe.c
@@ -793,7 +793,7 @@ static int fcoe_device_notification(struct notifier_block *notifier,
struct net_device *real_dev = ptr;
struct fcoe_softc *fc;
struct fcoe_dev_stats *stats;
- u32 new_link_up;
+ u32 link_possible = 1;
u32 mfs;
int rc = NOTIFY_OK;
@@ -810,15 +810,13 @@ static int fcoe_device_notification(struct notifier_block *notifier,
goto out;
}
- new_link_up = lp->link_up;
switch (event) {
case NETDEV_DOWN:
case NETDEV_GOING_DOWN:
- new_link_up = 0;
+ link_possible = 0;
break;
case NETDEV_UP:
case NETDEV_CHANGE:
- new_link_up = !fcoe_link_ok(lp);
break;
case NETDEV_CHANGEMTU:
mfs = fc->real_dev->mtu -
@@ -826,23 +824,19 @@ static int fcoe_device_notification(struct notifier_block *notifier,
sizeof(struct fcoe_crc_eof));
if (mfs >= FC_MIN_MAX_FRAME)
fc_set_mfs(lp, mfs);
- new_link_up = !fcoe_link_ok(lp);
break;
case NETDEV_REGISTER:
break;
default:
- FC_DBG("unknown event %ld call", event);
+ FC_DBG("Unknown event %ld from netdev netlink\n", event);
}
- if (lp->link_up != new_link_up) {
- if (new_link_up)
- fcoe_ctlr_start(&fc->ctlr);
- else {
- stats = lp->dev_stats[smp_processor_id()];
- if (stats)
- stats->LinkFailureCount++;
- fcoe_ctlr_stop(&fc->ctlr);
- fcoe_clean_pending_queue(lp);
- }
+ if (link_possible && !fcoe_link_ok(lp))
+ fcoe_ctlr_start(&fc->ctlr);
+ else if (fcoe_ctlr_stop(&fc->ctlr)) {
+ stats = lp->dev_stats[smp_processor_id()];
+ if (stats)
+ stats->LinkFailureCount++;
+ fcoe_clean_pending_queue(lp);
}
out:
return rc;
next prev parent reply other threads:[~2009-03-04 18:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-04 18:53 [PATCH 0/5] FIP feature for 2.6.30 merge window Vasu Dev
2009-03-04 18:53 ` [PATCH 1/5] fcoe: Add a header file defining the FIP protocol for FCoE Vasu Dev
2009-03-04 18:53 ` [PATCH 2/5] fcoe: Add support for the FIP discovery and keep-alive protocol Vasu Dev
2009-03-04 18:53 ` Vasu Dev [this message]
2009-03-04 18:53 ` [PATCH 4/5] fcoe: removed kzalloc from fcoe_ctlr_parse_adv (v3) Vasu Dev
2009-03-04 18:54 ` [PATCH 5/5] fcoe: removes sharing of fcoe_rx_list for both FCoE and FIP frames Vasu Dev
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=20090304185352.22010.73565.stgit@vi2.jf.intel.com \
--to=vasu.dev@intel.com \
--cc=linux-scsi@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