Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 360293
b: refs/heads/master
c: f9184df
h: refs/heads/master
i:
  360291: fe37f3f
v: v3
  • Loading branch information
Neil Horman authored and Robert Love committed Jan 28, 2013
1 parent b682416 commit 336dc27
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cf02820041668b14cbfa0fbd2bab45ac79bd6174
refs/heads/master: f9184df3b99375964340c1a78e33f304bbf15f06
31 changes: 27 additions & 4 deletions trunk/drivers/scsi/fcoe/fcoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ static int fcoe_link_ok(struct fc_lport *);

static struct fc_lport *fcoe_hostlist_lookup(const struct net_device *);
static int fcoe_hostlist_add(const struct fc_lport *);
static void fcoe_hostlist_del(const struct fc_lport *);

static int fcoe_device_notification(struct notifier_block *, ulong, void *);
static void fcoe_dev_setup(void);
Expand Down Expand Up @@ -1119,6 +1120,12 @@ static struct fc_lport *fcoe_if_create(struct fcoe_interface *fcoe,
port->min_queue_depth = FCOE_MIN_QUEUE_DEPTH;
INIT_WORK(&port->destroy_work, fcoe_destroy_work);

/*
* Need to add the lport to the hostlist
* so we catch NETDEV_CHANGE events.
*/
fcoe_hostlist_add(lport);

/* configure a fc_lport including the exchange manager */
rc = fcoe_lport_config(lport);
if (rc) {
Expand Down Expand Up @@ -1190,6 +1197,7 @@ static struct fc_lport *fcoe_if_create(struct fcoe_interface *fcoe,
out_lp_destroy:
fc_exch_mgr_free(lport);
out_host_put:
fcoe_hostlist_del(lport);
scsi_host_put(lport->host);
out:
return ERR_PTR(rc);
Expand Down Expand Up @@ -2313,9 +2321,6 @@ static int _fcoe_create(struct net_device *netdev, enum fip_state fip_mode,
/* setup DCB priority attributes. */
fcoe_dcb_create(fcoe);

/* add to lports list */
fcoe_hostlist_add(lport);

/* start FIP Discovery and FLOGI */
lport->boot_time = jiffies;
fc_fabric_login(lport);
Expand Down Expand Up @@ -2523,6 +2528,24 @@ static int fcoe_hostlist_add(const struct fc_lport *lport)
return 0;
}

/**
* fcoe_hostlist_del() - Remove the FCoE interface identified by a local
* port to the hostlist
* @lport: The local port that identifies the FCoE interface to be added
*
* Locking: must be called with the RTNL mutex held
*
*/
static void fcoe_hostlist_del(const struct fc_lport *lport)
{
struct fcoe_interface *fcoe;
struct fcoe_port *port;

port = lport_priv(lport);
fcoe = port->priv;
list_del(&fcoe->list);
return;
}

static struct fcoe_transport fcoe_sw_transport = {
.name = {FCOE_TRANSPORT_DEFAULT},
Expand Down Expand Up @@ -2613,9 +2636,9 @@ static void __exit fcoe_exit(void)
/* releases the associated fcoe hosts */
rtnl_lock();
list_for_each_entry_safe(fcoe, tmp, &fcoe_hostlist, list) {
list_del(&fcoe->list);
ctlr = fcoe_to_ctlr(fcoe);
port = lport_priv(ctlr->lp);
fcoe_hostlist_del(port->lport);
queue_work(fcoe_wq, &port->destroy_work);
}
rtnl_unlock();
Expand Down

0 comments on commit 336dc27

Please sign in to comment.