linux/drivers/scsi/libfc
Joe Eykholt f018b73af6 [SCSI] libfc, libfcoe, fcoe: use smp_processor_id() only when preempt disabled
When the kernel is configured for preemption, using smp_processor_id()
when preemption is enabled causes a warning backtrace and is wrong
since we could move off of that CPU as soon as we get the ID,
and we would be referencing the wrong CPU, and possibly an invalid one
if it could be hotswapped out.

Remove the fc_lport_get_stats() function and explicitly use per_cpu_ptr()
to get the statistics.  Where preemption has been disabled by holding
a _bh lock continue to use smp_processor_id(), but otherwise use
get_cpu()/put_cpu().

In fcoe_recv_frame() also changed the cases where we return in the
middle to do a goto to the code which bumps ErrorFrames and does
a put_cpu().  Two of these cases didn't bump ErrorFrames before, but
doing so is harmless because they "can't happen", due to prior length
checks.

Also rearranged code in fcoe_recv_frame() to have only one call to
fc_exch_recv().  It's just as efficient and saves a call to put_cpu().

In fc_fcp.c, adjusted a FIXME comment for code which doesn't need fixing.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:44 -05:00
..
Makefile [SCSI] libfc: add some generic NPIV support routines to libfc 2009-12-04 12:00:56 -06:00
fc_disc.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
fc_elsct.c [SCSI] libfc: fix fc_els_resp_type to correct display of CT responses 2009-12-04 12:01:17 -06:00
fc_exch.c [SCSI] libfc, libfcoe, fcoe: use smp_processor_id() only when preempt disabled 2010-04-11 09:23:44 -05:00
fc_fcp.c [SCSI] libfc, libfcoe, fcoe: use smp_processor_id() only when preempt disabled 2010-04-11 09:23:44 -05:00
fc_frame.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
fc_libfc.c [SCSI] libfc: Formatting cleanups across libfc 2009-12-04 12:01:07 -06:00
fc_libfc.h [SCSI] libfc: Formatting cleanups across libfc 2009-12-04 12:01:07 -06:00
fc_lport.c [SCSI] libfc: send point-to-poin FLOGI LS_ACC to assigned D_DID 2010-04-11 09:23:37 -05:00
fc_npiv.c [SCSI] libfc: recognize incoming FLOGI for point-to-point mode 2010-04-11 09:23:37 -05:00
fc_rport.c [SCSI] libfc: recode incoming PRLI handling 2010-04-11 09:23:33 -05:00