From 582b45bc577f78b5bfff3db874594ce2d962b846 Mon Sep 17 00:00:00 2001 From: Robert Love Date: Tue, 31 Mar 2009 15:51:50 -0700 Subject: [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 Signed-off-by: Robert Love Signed-off-by: James Bottomley --- drivers/scsi/libfc/fc_fcp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'drivers/scsi/libfc/fc_fcp.c') diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c index a5725f3b7ce..0997e8b1dce 100644 --- a/drivers/scsi/libfc/fc_fcp.c +++ b/drivers/scsi/libfc/fc_fcp.c @@ -407,10 +407,12 @@ static void fc_fcp_recv_data(struct fc_fcp_pkt *fsp, struct fc_frame *fp) if (~crc != le32_to_cpu(fr_crc(fp))) { crc_err: - stats = lp->dev_stats[smp_processor_id()]; + stats = fc_lport_get_stats(lp); stats->ErrorFrames++; + /* FIXME - per cpu count, not total count! */ if (stats->InvalidCRCCount++ < 5) - FC_DBG("CRC error on data frame\n"); + printk(KERN_WARNING "CRC error on data frame for port (%6x)\n", + fc_host_port_id(lp->host)); /* * Assume the frame is total garbage. * We may have copied it over the good part @@ -1752,7 +1754,7 @@ int fc_queuecommand(struct scsi_cmnd *sc_cmd, void (*done)(struct scsi_cmnd *)) /* * setup the data direction */ - stats = lp->dev_stats[smp_processor_id()]; + stats = fc_lport_get_stats(lp); if (sc_cmd->sc_data_direction == DMA_FROM_DEVICE) { fsp->req_flags = FC_SRB_READ; stats->InputRequests++; -- cgit v1.2.3