aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/fcoe/fcoe_sw.c
diff options
context:
space:
mode:
authorRobert Love <robert.w.love@intel.com>2009-03-31 18:51:50 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2009-04-03 10:22:58 -0400
commit582b45bc577f78b5bfff3db874594ce2d962b846 (patch)
treeb0cfe95b235aeca9b967cba8446db58b8a102533 /drivers/scsi/fcoe/fcoe_sw.c
parent5e5e92df49d4dfbef9ba981297c7f76d189376ac (diff)
[SCSI] fcoe: Use per-CPU kernel function for dev_stats instead of an array
Remove the hotplug creation of dev_stats, we allocate for all possible CPUs now when we allocate the lport. v2: Durring the 2.6.30 merge window, before these patches were comitted, 'percpu_ptr' was renamed 'per_cpu_ptr'. This latest update updates this patch for the name change. Signed-off-by: Yi Zou <yi.zou@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/fcoe/fcoe_sw.c')
-rw-r--r--drivers/scsi/fcoe/fcoe_sw.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/scsi/fcoe/fcoe_sw.c b/drivers/scsi/fcoe/fcoe_sw.c
index 2bbbe3c0cc7b..a6753903fd40 100644
--- a/drivers/scsi/fcoe/fcoe_sw.c
+++ b/drivers/scsi/fcoe/fcoe_sw.c
@@ -113,8 +113,6 @@ static struct scsi_host_template fcoe_sw_shost_template = {
113 */ 113 */
114static int fcoe_sw_lport_config(struct fc_lport *lp) 114static int fcoe_sw_lport_config(struct fc_lport *lp)
115{ 115{
116 int i = 0;
117
118 lp->link_up = 0; 116 lp->link_up = 0;
119 lp->qfull = 0; 117 lp->qfull = 0;
120 lp->max_retry_count = 3; 118 lp->max_retry_count = 3;
@@ -123,12 +121,7 @@ static int fcoe_sw_lport_config(struct fc_lport *lp)
123 lp->service_params = (FCP_SPPF_INIT_FCN | FCP_SPPF_RD_XRDY_DIS | 121 lp->service_params = (FCP_SPPF_INIT_FCN | FCP_SPPF_RD_XRDY_DIS |
124 FCP_SPPF_RETRY | FCP_SPPF_CONF_COMPL); 122 FCP_SPPF_RETRY | FCP_SPPF_CONF_COMPL);
125 123
126 /* 124 fc_lport_init_stats(lp);
127 * allocate per cpu stats block
128 */
129 for_each_online_cpu(i)
130 lp->dev_stats[i] = kzalloc(sizeof(struct fcoe_dev_stats),
131 GFP_KERNEL);
132 125
133 /* lport fc_lport related configuration */ 126 /* lport fc_lport related configuration */
134 fc_lport_config(lp); 127 fc_lport_config(lp);
@@ -311,7 +304,6 @@ static inline int fcoe_sw_em_config(struct fc_lport *lp)
311 */ 304 */
312static int fcoe_sw_destroy(struct net_device *netdev) 305static int fcoe_sw_destroy(struct net_device *netdev)
313{ 306{
314 int cpu;
315 struct fc_lport *lp = NULL; 307 struct fc_lport *lp = NULL;
316 struct fcoe_softc *fc; 308 struct fcoe_softc *fc;
317 u8 flogi_maddr[ETH_ALEN]; 309 u8 flogi_maddr[ETH_ALEN];
@@ -363,8 +355,7 @@ static int fcoe_sw_destroy(struct net_device *netdev)
363 fcoe_clean_pending_queue(lp); 355 fcoe_clean_pending_queue(lp);
364 356
365 /* Free memory used by statistical counters */ 357 /* Free memory used by statistical counters */
366 for_each_online_cpu(cpu) 358 fc_lport_free_stats(lp);
367 kfree(lp->dev_stats[cpu]);
368 359
369 /* Release the net_device and Scsi_Host */ 360 /* Release the net_device and Scsi_Host */
370 dev_put(fc->real_dev); 361 dev_put(fc->real_dev);