From 9491b774fc569ff26188d826540ebb1dd7f3db1a Mon Sep 17 00:00:00 2001 From: Bhanu Prakash Gollapudi Date: Tue, 30 Aug 2011 15:54:48 -0700 Subject: [PATCH] --- yaml --- r: 271039 b: refs/heads/master c: 8a5badf1ea10c726b9cc04e52f91395b1248e034 h: refs/heads/master i: 271037: 17b1c5d6e8d350787b27cf83ea0c6188b32594fb 271035: 1ce13506da6e4c04e8279be83192ff4846107ae1 271031: 4f686b4f315bd28f45b8e1479b81109ae25de308 271023: c28d65011d8cd65f71b4eae69c046894f3c9cb40 271007: 32c9f49b163fcaa349a7974d13d58ef728e75ff4 270975: 3f8631d46de0cc95676087c82055c5643e3ce085 v: v3 --- [refs] | 2 +- trunk/drivers/scsi/bnx2fc/bnx2fc.h | 1 + trunk/drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 21 +++++++++++++++++---- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index c42c3f08f16d..253f03be5aa4 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c780673cfb1e3d16d23f9808738539625d3b9363 +refs/heads/master: 8a5badf1ea10c726b9cc04e52f91395b1248e034 diff --git a/trunk/drivers/scsi/bnx2fc/bnx2fc.h b/trunk/drivers/scsi/bnx2fc/bnx2fc.h index 903e8f64980e..02535e8d9e00 100644 --- a/trunk/drivers/scsi/bnx2fc/bnx2fc.h +++ b/trunk/drivers/scsi/bnx2fc/bnx2fc.h @@ -224,6 +224,7 @@ struct bnx2fc_interface { struct fcoe_ctlr ctlr; u8 vlan_enabled; int vlan_id; + bool enabled; }; #define bnx2fc_from_ctlr(fip) container_of(fip, struct bnx2fc_interface, ctlr) diff --git a/trunk/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/trunk/drivers/scsi/bnx2fc/bnx2fc_fcoe.c index 6387067b91a6..ba88ddb4580b 100644 --- a/trunk/drivers/scsi/bnx2fc/bnx2fc_fcoe.c +++ b/trunk/drivers/scsi/bnx2fc/bnx2fc_fcoe.c @@ -865,8 +865,11 @@ static void bnx2fc_indicate_netevent(void *context, unsigned long event, if (link_possible && !bnx2fc_link_ok(lport)) { /* Reset max recv frame size to default */ fc_set_mfs(lport, BNX2FC_MFS); - printk(KERN_ERR "indicate_netevent: ctlr_link_up\n"); - fcoe_ctlr_link_up(&interface->ctlr); + /* + * ctlr link up will only be handled during + * enable to avoid sending discovery solicitation + * on a stale vlan + */ } else if (fcoe_ctlr_link_down(&interface->ctlr)) { mutex_lock(&lport->lp_mutex); list_for_each_entry(vport, &lport->vports, list) @@ -1784,7 +1787,7 @@ static void bnx2fc_start_disc(struct bnx2fc_interface *interface) lport = interface->ctlr.lp; BNX2FC_HBA_DBG(lport, "calling fc_fabric_login\n"); - if (!bnx2fc_link_ok(lport)) { + if (!bnx2fc_link_ok(lport) && interface->enabled) { BNX2FC_HBA_DBG(lport, "ctlr_link_up\n"); fcoe_ctlr_link_up(&interface->ctlr); fc_host_port_type(lport->host) = FC_PORTTYPE_NPORT; @@ -1866,6 +1869,7 @@ static int bnx2fc_disable(struct net_device *netdev) rc = -ENODEV; printk(KERN_ERR PFX "bnx2fc_disable: interface or lport not found\n"); } else { + interface->enabled = false; fcoe_ctlr_link_down(&interface->ctlr); fcoe_clean_pending_queue(interface->ctlr.lp); } @@ -1888,8 +1892,10 @@ static int bnx2fc_enable(struct net_device *netdev) if (!interface || !interface->ctlr.lp) { rc = -ENODEV; printk(KERN_ERR PFX "bnx2fc_enable: interface or lport not found\n"); - } else if (!bnx2fc_link_ok(interface->ctlr.lp)) + } else if (!bnx2fc_link_ok(interface->ctlr.lp)) { fcoe_ctlr_link_up(&interface->ctlr); + interface->enabled = true; + } mutex_unlock(&bnx2fc_dev_lock); rtnl_unlock(); @@ -2002,8 +2008,15 @@ static int bnx2fc_create(struct net_device *netdev, enum fip_state fip_mode) /* Make this master N_port */ interface->ctlr.lp = lport; + if (!bnx2fc_link_ok(lport)) { + fcoe_ctlr_link_up(&interface->ctlr); + fc_host_port_type(lport->host) = FC_PORTTYPE_NPORT; + set_bit(ADAPTER_STATE_READY, &interface->hba->adapter_state); + } + BNX2FC_HBA_DBG(lport, "create: START DISC\n"); bnx2fc_start_disc(interface); + interface->enabled = true; /* * Release from kref_init in bnx2fc_interface_setup, on success * lport should be holding a reference taken in bnx2fc_if_create