On 6/16/10 4:37 PM, Vasu Dev wrote:
> 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;
This conflicts with my VN2VN mode patches. The mode should only be
set at initialization time and only by fcoe_ctlr_init().
> 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;
No, it should reflect the link change up to libfc.
> spin_lock_bh(&fip->lock);
> if (fip->state == FIP_ST_NON_FIP || fip->state == FIP_ST_AUTO) {
> spin_unlock_bh(&fip->lock);
>
> _______________________________________________
The purpose of fc_fabric_logoff/login() are to reflect the enable/disable
mode up to libfc, so if there's something wrong where a linkup while disabled
via fc_fabric_logoff() causes us to login, it should be fixed in libfc.
I think we need a enable/disable interface to libfcoe so that it
can take care of putting itself in disabled state. So maybe there should
be a fcoe_ctlr_login/logoff interface that takes care of starting/stopping FIP
and also calls fc_fabric_login/logoff.
We still want to reflect link-down differently than offlined in HBA-API,
so libfc should see the link up but even if it remains in disabled state.
I'm willing to take a whack at this after my VN2VN mode patches are resubmitted.
Joe
_______________________________________________
devel mailing list
[email protected]
http://www.open-fcoe.org/mailman/listinfo/devel