[SCSI] fcoe: create/destroy fcoe Rx threads on CPU hotplug events
authorRobert Love <robert.w.love@intel.com>
Tue, 17 Mar 2009 18:41:46 +0000 (11:41 -0700)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Fri, 3 Apr 2009 14:22:59 +0000 (09:22 -0500)
commit8976f424d43c80ea32b6e847226e1a8ccdb6e748
tree361d16be95cac84197e52411ed63ccfebfb88aff
parent582b45bc577f78b5bfff3db874594ce2d962b846
[SCSI] fcoe: create/destroy fcoe Rx threads on CPU hotplug events

This patch adds support for dynamically created Rx threads
upon CPU hotplug events.

There were existing synchronization problems that this patch
attempts to resolve. The main problem had to do with fcoe_rcv()
running in a different context than the hotplug notifications.
This opened the possiblity that fcoe_rcv() would target a Rx
thread for a skb. However, that thread could become NULL if
the CPU was made offline.

This patch uses the Rx queue's (a skb_queue) lock to protect
the thread it's associated with and we use the 'thread' member
of the fcoe_percpu_s to determine if the thread is ready to
accept new skbs.

The patch also attempts to do a better job of cleaning up, both
if hotplug registration fails as well as when the module is
removed.

Contribution provided by Joe Eykholt <jeykholt@cisco.com> to
fix incorrect use of __cpuinitdata.

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>
drivers/scsi/fcoe/libfcoe.c