• Joe Eykholt's avatar
    [SCSI] libfc: add hook for FC-4 provider registration · 96ad8464
    Joe Eykholt authored
    Allow FC-4 provider modules to hook into libfc, mostly for targets.
    This should allow any FC-4 module to handle PRLI requests and maintain
    process-association states.
    Each provider registers its ops with libfc and then will be called for
    any incoming PRLI for that FC-4 type on any instance.   The provider
    can decide whether to handle that particular instance using any method
    it likes, such as ACLs or other configuration information.
    A count is kept of the number of successful PRLIs from the remote port.
    Providers are called back with an implicit PRLO when the remote port
    is about to be deleted or has been reset.
    fc_lport_recv_req() now sends incoming FC-4 requests to FC-4 providers,
    and there is a built-in provider always registered for handling
    incoming ELS requests.
    The call to provider recv() routines uses rcu_read_lock()
    so that providers aren't removed during the call.  That lock is very
    cheap and shouldn't affect any performance on ELS requests.
    Providers can rely on the RCU lock to protect a session lookup as well.
    Signed-off-by: default avatarJoe Eykholt <jeykholt@cisco.com>
    Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
    Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
libfc.h 32.2 KB