• Robert Love's avatar
    [SCSI] fcoe: create/destroy fcoe Rx threads on CPU hotplug events · 8976f424
    Robert Love authored
    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: default avatarYi Zou <yi.zou@intel.com>
    Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
    Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
    8976f424
libfcoe.c 37 KB