The fcoe_ctlr_link_down() called from fcoe_disable puts
lport into reset state and in that state following link up
event starts lport again though fcoemon had it disabled
until it is re-enabled again from fcoe_enable.

This patch disables fip controller along with fcoe_ctlr_link_down
and then don't start lport on link up events while controller
is disabled. Instead start lport on fcoe_enable followed
by fcoe_disable to get controller out of disable and start
lport again.

The fc_fabric_logoff and fc_fabric_login is redundant
after added fcoe_ctlr_link_down/up, therefore removed
them and with that lport gets into reset state as soon
as fcoe_disable issued to allow re-queuing timed out IOs
while lport blocks rports using lport state in
fc_io_compl.

Signed-off-by: Vasu Dev <[email protected]>
---

 drivers/scsi/fcoe/fcoe.c    |    6 +++---
 drivers/scsi/fcoe/libfcoe.c |    2 ++
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index cf66e3c..dfffac2 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -1938,7 +1938,7 @@ static int fcoe_disable(const char *buffer, struct 
kernel_param *kp)
        rtnl_unlock();
 
        if (fcoe) {
-               fc_fabric_logoff(fcoe->ctlr.lp);
+               fcoe->ctlr.mode = FIP_ST_DISABLED;
                fcoe_ctlr_link_down(&fcoe->ctlr);
        } else
                rc = -ENODEV;
@@ -1993,9 +1993,9 @@ static int fcoe_enable(const char *buffer, struct 
kernel_param *kp)
        rtnl_unlock();
 
        if (fcoe) {
-               if (!fcoe_link_ok(fcoe->ctlr.lp))
+               fcoe->ctlr.mode = FIP_ST_AUTO;
+                if (!fcoe_link_ok(fcoe->ctlr.lp))
                        fcoe_ctlr_link_up(&fcoe->ctlr);
-               rc = fc_fabric_login(fcoe->ctlr.lp);
        } else
                rc = -ENODEV;
 
diff --git a/drivers/scsi/fcoe/libfcoe.c b/drivers/scsi/fcoe/libfcoe.c
index f009191..6fd9dbb 100644
--- a/drivers/scsi/fcoe/libfcoe.c
+++ b/drivers/scsi/fcoe/libfcoe.c
@@ -255,6 +255,8 @@ static void fcoe_ctlr_solicit(struct fcoe_ctlr *fip, struct 
fcoe_fcf *fcf)
  */
 void fcoe_ctlr_link_up(struct fcoe_ctlr *fip)
 {
+       if (fip->mode == FIP_ST_DISABLED)
+               return;
        spin_lock_bh(&fip->lock);
        if (fip->state == FIP_ST_NON_FIP || fip->state == FIP_ST_AUTO) {
                spin_unlock_bh(&fip->lock);

_______________________________________________
devel mailing list
[email protected]
http://www.open-fcoe.org/mailman/listinfo/devel

Reply via email to