Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 270954
b: refs/heads/master
c: 9be17fc
h: refs/heads/master
v: v3
  • Loading branch information
Bhanu Prakash Gollapudi authored and James Bottomley committed Aug 27, 2011
1 parent 8e301d0 commit af193eb
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 25 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: 776cebcac6fad2f638c0ab16e2111a84c1c85d84
refs/heads/master: 9be17fc43e0121e966049a323ad38a35626525c1
47 changes: 23 additions & 24 deletions trunk/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1384,23 +1384,35 @@ static struct fc_lport *bnx2fc_if_create(struct bnx2fc_interface *interface,

static void bnx2fc_interface_cleanup(struct bnx2fc_interface *interface)
{
/* Dont listen for Ethernet packets anymore */
__dev_remove_pack(&interface->fcoe_packet_type);
__dev_remove_pack(&interface->fip_packet_type);
synchronize_net();
}

static void bnx2fc_if_destroy(struct fc_lport *lport, struct bnx2fc_hba *hba)
{
struct fc_lport *lport = interface->ctlr.lp;
struct fcoe_port *port = lport_priv(lport);
struct bnx2fc_lport *blport, *tmp;
struct bnx2fc_hba *hba = interface->hba;

/* Stop the transmit retry timer */
del_timer_sync(&port->timer);

/* Free existing transmit skbs */
fcoe_clean_pending_queue(lport);

/* Dont listen for Ethernet packets anymore */
__dev_remove_pack(&interface->fcoe_packet_type);
__dev_remove_pack(&interface->fip_packet_type);
synchronize_net();

spin_lock_bh(&hba->hba_lock);
list_for_each_entry_safe(blport, tmp, &hba->vports, list) {
if (blport->lport == lport) {
list_del(&blport->list);
kfree(blport);
}
}
spin_unlock_bh(&hba->hba_lock);
}

static void bnx2fc_if_destroy(struct fc_lport *lport)
{

/* Free queued packets for the receive thread */
bnx2fc_clean_rx_queue(lport);

Expand All @@ -1417,15 +1429,6 @@ static void bnx2fc_if_destroy(struct fc_lport *lport, struct bnx2fc_hba *hba)
/* Free memory used by statistical counters */
fc_lport_free_stats(lport);

spin_lock_bh(&hba->hba_lock);
list_for_each_entry_safe(blport, tmp, &hba->vports, list) {
if (blport->lport == lport) {
list_del(&blport->list);
kfree(blport);
}
}
spin_unlock_bh(&hba->hba_lock);

/* Release Scsi_Host */
scsi_host_put(lport->host);
}
Expand All @@ -1443,7 +1446,6 @@ static void bnx2fc_if_destroy(struct fc_lport *lport, struct bnx2fc_hba *hba)
static int bnx2fc_destroy(struct net_device *netdev)
{
struct bnx2fc_interface *interface = NULL;
struct bnx2fc_hba *hba;
struct fc_lport *lport;
int rc = 0;

Expand All @@ -1457,15 +1459,14 @@ static int bnx2fc_destroy(struct net_device *netdev)
goto netdev_err;
}

hba = interface->hba;

bnx2fc_interface_cleanup(interface);
lport = interface->ctlr.lp;
bnx2fc_stop(interface);
list_del(&interface->list);
destroy_workqueue(interface->timer_work_queue);
bnx2fc_interface_put(interface);
bnx2fc_if_destroy(lport, hba);
bnx2fc_if_destroy(lport);

netdev_err:
mutex_unlock(&bnx2fc_dev_lock);
Expand All @@ -1478,19 +1479,17 @@ static void bnx2fc_destroy_work(struct work_struct *work)
struct fcoe_port *port;
struct fc_lport *lport;
struct bnx2fc_interface *interface;
struct bnx2fc_hba *hba;

port = container_of(work, struct fcoe_port, destroy_work);
lport = port->lport;
interface = port->priv;
hba = interface->hba;

BNX2FC_HBA_DBG(lport, "Entered bnx2fc_destroy_work\n");

bnx2fc_port_shutdown(lport);
rtnl_lock();
mutex_lock(&bnx2fc_dev_lock);
bnx2fc_if_destroy(lport, hba);
bnx2fc_if_destroy(lport);
mutex_unlock(&bnx2fc_dev_lock);
rtnl_unlock();
}
Expand Down Expand Up @@ -2063,7 +2062,7 @@ static void bnx2fc_ulp_exit(struct cnic_dev *dev)
list_del(&interface->list);
lport = interface->ctlr.lp;
bnx2fc_interface_put(interface);
bnx2fc_if_destroy(lport, hba);
bnx2fc_if_destroy(lport);
}
}
mutex_unlock(&bnx2fc_dev_lock);
Expand Down

0 comments on commit af193eb

Please sign in to comment.