13 Feb, 2011

32 commits

  • Problem:

    From initaitor machine, when queried role of target (other end of connection),
    it is "initiator", hence SCSI-ml doesn't send any LUN Inquiry commands.

    Fix:

    If there is a registered target for FC_TYPE_FCP, extend lport's params
    (capability) to be target as well, By default lport params are
    INITIATOR only. Having this fix, caused initiator to send SCSI LUN
    inquiry command to target.

    Signed-off-by: Kiran Patil
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Kiran Patil
     
  • Remove the existing sysfs entry points of the fcoe.ko module parameters that
    are used to create/destroy/enable/disable an FCoE instance, rather, use the
    newly added fcoe transport code to attach itself as an FCoE transport provider
    when fcoe.ko gets loaded. There is no functionality change on the logic of
    fcoe interacts with upper libfc and lower netdev. The fcoe transport only acts
    as thin layer to provide a unified interface for all fcoe transport providers
    so all FCoE instances on any network interfaces from all vendors can be
    managed through the same Open-FCoE.org's user space tool package, which also
    has full DCB support.

    Signed-off-by: Yi Zou
    Signed-off-by: Bhanu Prakash Gollapudi
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Yi Zou
     
  • Prepare the fcoe to convert it to use the newly added fcoe transport, making
    it as the default fcoe transport provider for libfcoe. This patch is to rename
    some of the variables to avoid any confusing names later as now there are
    several transports in the same file.

    Signed-off-by: Yi Zou
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Yi Zou
     
  • Now we can include the fcoe_transport.c to the build of the kernel libfcoe
    module. Move the module information to fcoe_transport, and it will have
    all the module parameters later for the create/destroy/enable/disable of an
    FCoE instance.

    Signed-off-by: Yi Zou
    Signed-off-by: Bhanu Prakash Gollapudi
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Yi Zou
     
  • The existing libfcoe.c is mostly for FIP support, rename it to reflect that
    fact and so we can add fcoe_transport.c to the make file to include both
    into the libfcoe kernel module.

    [ Minor modifications by Robert Love converting a few
    "__attribute__((packed))" modifiers to "__packed" to remove new
    checkpatch.pl WARNINGS ]

    Signed-off-by: Yi Zou
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Yi Zou
     
  • Add the new fcoe_transport.c file that implements basic fcoe transport
    interface. Eventually, the sysfs entries to create/destroy/enable/disable
    an FCoE instance will be coming to the fcoe transport layer, who does a
    look-up to find the corresponding transport provide and pass the corresponding
    action over to the identified provider.

    The fcoe.ko will become the default fcoe transport provider that can support
    FCoE on any given netdev interfaces, as the Open-FCoE.org's default software
    FCoE HBA solution. Any vendor specific FCoE HBA driver that is built on top
    of Open-FCoE's kernel stack of libfc & libfcoe as well as the user land tool
    of fcoe-utils can easily plug-in and start running FCoE on their network
    interfaces. The fcoe.ko will be converted to act as the default provider if
    no vendor specific transport provider is found, as it is always added to the
    very end of the list of attached transports.

    Signed-off-by: Yi Zou
    Signed-off-by: Bhanu Prakash Gollapudi
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Yi Zou
     
  • add the fcoe_transport struct to the common libfcoe.h header so all fcoe
    transport provides can use it to attach itself as an fcoe transport. This
    is the header part, and the next patch will be the transport code itself.

    Signed-off-by: Yi Zou
    Signed-off-by: Bhanu Prakash Gollapudi
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Yi Zou
     
  • libfcoe kernel module debug macros will used by the fcoe transport code
    as well when later it gets added.

    Signed-off-by: Yi Zou
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Yi Zou
     
  • Problem:

    In case of exchange responder case, EMA selection was defaulted to the
    last EMA from EMA list (lport.ema_list). If exchange ID is selected
    from offload pool and not setup DDP, resulting into incorrect
    selection of EMA, and eventually dropping the packet because unable to
    find exchange.

    Fix:

    Enhanced the exchange ID selection (depending upon request type and
    exchange responder) Made necessary enhancement in EMA selection
    algorithm.

    Signed-off-by: Kiran Patil
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Kiran Patil
     
  • Target modules using lport->tt.seq_assign() get a hold on the
    exchange but have no way of releasing it. Add that.

    Signed-off-by: Joe Eykholt
    Signed-off-by: James Bottomley

    Joe Eykholt
     
  • This patch removes the use of the Scsi_Host's host_lock
    within fc_queuecommand. It also removes the DEF_SCSI_QCMD
    usage so that libfc has fully moved on to the new
    queuecommand interface.

    Signed-off-by: Robert Love
    Tested-by: Ross Brattain
    Reviewed-by: Nicholas A. Bellinger
    Signed-off-by: James Bottomley

    Robert Love
     
  • When sending an outgoing PRLI as an initiator, get the parameters
    from registered providers so that they all get a chance to decide
    on roles.

    The passive provider is called last, and could override the
    initiator role.

    Signed-off-by: Joe Eykholt
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Joe Eykholt
     
  • When an SCST provider is registered, it needs to know what
    local ports are available for configuration as targets.

    Add a notifier chain that is invoked when any local port
    that is added or deleted.

    Maintain a global list of local ports and add an
    interator function that calls a given function for
    every existing local port. This is used when first
    loading a provider.

    Signed-off-by: Joe Eykholt
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Joe Eykholt
     
  • The target provider needs a per-instance lookup table
    or other way to lookup sessions quickly without going through
    a linear list or serializing too much.

    Add a simple void * array indexed by FC-4 type to the fc_lport.

    Signed-off-by: Joe Eykholt
    Committed-by: Nicholas A. Bellinger
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Joe Eykholt
     
  • Add a method for setting handler for incoming exchange.
    For multi-sequence exchanges, this allows the target driver
    to add a response handler for handling subsequent sequences,
    and exchange manager resets.

    The new function is called fc_seq_set_resp().

    Signed-off-by: Joe Eykholt
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Joe Eykholt
     
  • 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: Joe Eykholt
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Joe Eykholt
     
  • Fix sparse warning for non-ANSI function declaration.
    Declare workqueue structs as static.

    Signed-off-by: Randy Dunlap
    Cc: Robert Love
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Randy Dunlap
     
  • Allowing FCoE LOGO followed by CVL in this case prevents
    FIP login back to the FCF and then keeps lport offline,
    only FIP LOGO and CLV needs to be processed while in
    FIP mode, therefore this patch drops FCoE LOGO in FIP mode.

    Added fcoe_filter_frames() to filter out above mentioned LOGO
    in fcoe rx path along with other existing filtering in code
    for bad CRC frames. Adding separate fcoe_filter_frames function
    helped with better code indentations and if needed then same
    will allow adding more filters at one place in future.

    This LOGO drop is added after FCP frames passed up to avoid
    any additional checks on fast path for this.

    Signed-off-by: Vasu Dev
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Vasu Dev
     
  • vports are not grabbing module references but are
    releasing them. This causes the module reference count
    to decrement too many times and it wraps around past 0.

    The solution is to do a module_put() in
    fcoe_interface_release() so that the reference is only
    released when the fcoe_interface is released. There is a
    one-to-one relationship between the N_Port and the
    fcoe_interface, so the module reference will only be
    dropped when the N_Port is destroyed

    To create symetry in the code this patch moves the
    try_module_get() call into fcoe_interface_create(). This
    means that only the N_Port will grab a reference to the
    module when its corresponding fcoe_interface is created.

    This patch also makes it so that the fcoe_interface_create()
    routine encodes any error codes in the fcoe_interface
    pointer returned. This way its caller, fcoe_create(), can
    return an accurate error code.

    Signed-off-by: Robert Love
    Tested-by: Ross Brattain
    Signed-off-by: James Bottomley

    Robert Love
     
  • Signed-off-by: Venkata Siva Vijayendra Bhamidipati
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Venkata Siva Vijayendra Bhamidipati
     
  • Fix memory leak arising due to incorrect freeing of allocated memory
    for vnic stats when unregistering a vnic.

    Signed-off-by: Abhijeet Joglekar
    Signed-off-by: Venkata Siva Vijayendra Bhamidipati
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Venkata Siva Vijayendra Bhamidipati
     
  • If we goto out, then it tries to call kfree_skb() on an ERR_PTR which
    will oops. Just return directly.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Dan Carpenter
     
  • This patch makes it so that we only have one call to
    fc_rport_error. This patch does not completely
    consolidate return statements, there is still one return
    used when not calling fc_rport_error, but alternative
    solutions made the code more confusing.

    [ Patch modified by Robert Love ]
    [ Patch title and commit message edited by Robert Love
    to make it more relevant ]

    Signed-off-by: Hillf Danton
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Hillf Danton
     
  • Here ticks_left is added to record the result of
    wait_for_completion_timeout().

    [ Patch title and description edited by Robert Love
    to make it more descriptive ]

    Signed-off-by: Hillf Danton
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Hillf Danton
     
  • The fsp's xfer_ddp is used as indication of the exchange id for the DDPed
    I/O. We should always initialize it as FC_XID_UNKNOWN for a newly allocated
    fsp, otherwise the fsp allocated in fc_fcp, i.e., not from queuecommand like
    LUN RESET that is not doing DDP may still think DDP is setup for it since xid
    0 is valid and goes on to call fc_fcp_ddp_done() in fc_fcp_resp() from
    fc_tm_done(). So, set xfer_ddp as FC_XID_UNKNOWN in fc_fcp_pkt_alloc() now.

    Also removes the setting of fsp->lp as it's already done when fsp is allocated.

    Signed-off-by: Yi Zou
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Yi Zou
     
  • Classify severity of I/O errors for target, nexus, and
    transport errors.

    Signed-off-by: Mike Snitzer
    Signed-off-by: Hannes Reinecke
    Acked-by: Jens Axboe
    Signed-off-by: James Bottomley

    Hannes Reinecke
     
  • DM now has more information about the nature of the underlying storage
    failure. Path failure is avoided if a request failed due to a target
    error. Instead the target error is immediately passed up the stack.

    Discard requests that fail due to non-target errors may now be retried.

    Errors restricted to the path will be retried or returned if no
    paths are available, irregarding the no_path_retry setting.

    Signed-off-by: Mike Snitzer
    Signed-off-by: Hannes Reinecke
    Acked-by: Alasdair G Kergon
    Signed-off-by: James Bottomley

    Hannes Reinecke
     
  • Instead of just passing 'EIO' for any I/O error we should be
    notifying the upper layers with more details about the cause
    of this error.

    Update the possible I/O errors to:

    - ENOLINK: Link failure between host and target
    - EIO: Retryable I/O error
    - EREMOTEIO: Non-retryable I/O error
    - EBADE: I/O error restricted to the I_T_L nexus

    'Retryable' in this context means that an I/O error _might_ be
    restricted to the I_T_L nexus (vulgo: path), so retrying on another
    nexus / path might succeed.

    'Non-retryable' in general refers to a target failure, so this
    error will always be generated regardless of the I_T_L nexus
    it was send on.

    I/O errors restricted to the I_T_L nexus might be retried
    on another nexus / path, but they should _not_ be queued
    if no paths are available.

    Signed-off-by: Hannes Reinecke
    Signed-off-by: Mike Snitzer
    Signed-off-by: James Bottomley

    Hannes Reinecke
     
  • The use of blk_execute_rq_nowait() implies __blk_put_request() is needed
    in start_stop_endio() rather than blk_put_request() --
    blk_finish_request() is called with queue lock already held.

    Signed-off-by: Mike Snitzer
    Signed-off-by: James Bottomley

    Mike Snitzer
     
  • The ioc->sgl[i].iov_len value is supplied by the ioctl caller, and can be
    zero in some cases. Assume that's valid and continue without error.

    Fixes (multiple individual reports of the same problem for quite a while):

    http://marc.info/?l=linux-ide&m=128941801715301
    http://bugs.debian.org/604627
    http://www.mail-archive.com/linux-poweredge@dell.com/msg02575.html

    megasas: Failed to alloc kernel SGL buffer for IOCTL

    and

    [ 69.162538] ------------[ cut here ]------------
    [ 69.162806] kernel BUG at /build/buildd/linux-2.6.32/lib/swiotlb.c:368!
    [ 69.163134] invalid opcode: 0000 [#1] SMP
    [ 69.163570] last sysfs file: /sys/devices/system/cpu/cpu3/cache/index2/shared_cpu_map
    [ 69.163975] CPU 0
    [ 69.164227] Modules linked in: fbcon tileblit font bitblit softcursor vga16fb vgastate ioatdma radeon ttm drm_kms_helper shpchp drm i2c_algo_bit lp parport floppy pata_jmicron megaraid_sas igb dca
    [ 69.167419] Pid: 1206, comm: smartctl Tainted: G W 2.6.32-25-server #45-Ubuntu X8DTN
    [ 69.167843] RIP: 0010:[] [] map_single+0x255/0x260
    [ 69.168370] RSP: 0018:ffff88081c0ebc58 EFLAGS: 00010246
    [ 69.168655] RAX: 000000000003bffc RBX: 00000000ffffffff RCX: 0000000000000002
    [ 69.169000] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff88001dffe000
    [ 69.169346] RBP: ffff88081c0ebcb8 R08: 0000000000000000 R09: ffff880000030840
    [ 69.169691] R10: 0000000000100000 R11: 0000000000000000 R12: 0000000000000000
    [ 69.170036] R13: 00000000ffffffff R14: 0000000000000001 R15: 0000000000200000
    [ 69.170382] FS: 00007fb8de189720(0000) GS:ffff88001de00000(0000) knlGS:0000000000000000
    [ 69.170794] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [ 69.171094] CR2: 00007fb8dd59237c CR3: 000000081a790000 CR4: 00000000000006f0
    [ 69.171439] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    [ 69.171784] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    [ 69.172130] Process smartctl (pid: 1206, threadinfo ffff88081c0ea000, task ffff88081a760000)
    [ 69.194513] Stack:
    [ 69.205788] 0000000000000034 00000002817e3390 0000000000000000 ffff88081c0ebe00
    [ 69.217739] 0000000000000000 000000000003bffc 0000000000000000 0000000000000000
    [ 69.241250] 0000000000000000 00000000ffffffff ffff88081c5b4080 ffff88081c0ebe00
    [ 69.277310] Call Trace:
    [ 69.289278] [] swiotlb_alloc_coherent+0xec/0x130
    [ 69.301118] [] x86_swiotlb_alloc_coherent+0x61/0x70
    [ 69.313045] [] megasas_mgmt_fw_ioctl+0x1ae/0x690 [megaraid_sas]
    [ 69.336399] [] megasas_mgmt_ioctl_fw+0x198/0x240 [megaraid_sas]
    [ 69.359346] [] megasas_mgmt_ioctl+0x35/0x50 [megaraid_sas]
    [ 69.370902] [] vfs_ioctl+0x22/0xa0
    [ 69.382322] [] ? alloc_fd+0x10a/0x150
    [ 69.393622] [] do_vfs_ioctl+0x81/0x410
    [ 69.404696] [] ? do_page_fault+0x153/0x3b0
    [ 69.415761] [] sys_ioctl+0x81/0xa0
    [ 69.426640] [] system_call_fastpath+0x16/0x1b
    [ 69.437491] Code: fe ff ff 48 8b 3d 74 38 76 00 41 bf 00 00 20 00 e8 51 f5 d7 ff 83 e0 ff 48 05 ff 07 00 00 48 c1 e8 0b 48 89 45 c8 e9 13 fe ff ff 0b eb fe 0f 1f 80 00 00 00 00 55 48 89 e5 48 83 ec 20 4c 89
    [ 69.478216] RIP [] map_single+0x255/0x260
    [ 69.489668] RSP
    [ 69.500975] ---[ end trace 6a2181b634e2abc7 ]---

    Reported-by: Bokhan Artem
    Reported by: Marc-Christian Petersen
    Signed-off-by: Bjørn Mork
    Cc: "Benz, Michael"
    Signed-off-by: James Bottomley

    Bjørn Mork
     
  • pm8001 manages its own list of pending works and cancel them on device
    free. It is unnecessarily complex and has a race condition - the
    works are canceled but not synced, so the work could still be running
    during and after the data structures are freed.

    This patch simplifies workqueue usage.

    * A driver specific workqueue pm8001_wq is created to serve these
    work items.

    * To avoid confusion, the "queue" suffixes are dropped from work items
    and functions.

    * Delayed queueing was never used. pm8001_work now uses work_struct
    instead.

    * The driver no longer keeps track of pending works. All pm8001_works
    are queued to pm8001_wq and the workqueue is flushed as necessary.

    flush_scheduled_work() usage is removed during conversion.

    Signed-off-by: Tejun Heo
    Acked-by: Jack Wang
    Signed-off-by: James Bottomley

    Tejun Heo
     
  • Simple conversions to drop flush_scheduled_work() usages in
    drivers/scsi. More involved ones will be done in separate patches.

    * NCR5380, megaraid_sas: cancel_delayed_work() +
    flush_scheduled_work() -> cancel_delayed_work_sync().

    * mpt2sas_scsih: drop unnecessary flush_scheduled_work().

    * arcmsr_hba, ipr, pmcraid: flush the used work explicitly instead of
    using flush_scheduled_work().

    Signed-off-by: Tejun Heo
    Signed-off-by: James Bottomley

    Tejun Heo
     

25 Jan, 2011

8 commits