14 Jan, 2009

1 commit

  • virt_to_page() call should not be used on kernel text and data
    addresses. virt_to_page() is used by sg_init_one(). So change padbuf
    to be allocated within iscsi_segment.

    Signed-off-by: Karen Xie
    Acked-by: Mike Christie
    Signed-off-by: James Bottomley

    Karen Xie
     

06 Jan, 2009

1 commit


30 Dec, 2008

11 commits

  • Encapsulation protocol for running Fibre Channel over Ethernet interfaces.
    Creates virtual Fibre Channel host adapters using libfc.

    This layer is the LLD to the scsi-ml. It allocates the Scsi_Host, utilizes
    libfc for Fibre Channel protocol processing and interacts with netdev to
    send/receive Ethernet packets.

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

    Robert Love
     
  • libFC is composed of 4 blocks supported by an exchange manager
    and a framing library. The upper 4 layers are fc_lport, fc_disc,
    fc_rport and fc_fcp. A LLD that uses libfc could choose to
    either use libfc's block, or using the transport template
    defined in libfc.h, override one or more blocks with its own
    implementation.

    The EM (Exchange Manager) manages exhcanges/sequences for all
    commands- ELS, CT and FCP.

    The framing library frames ELS and CT commands.

    The fc_lport block manages the library's representation of the
    host's FC enabled ports.

    The fc_disc block manages discovery of targets as well as
    handling changes that occur in the FC fabric (via. RSCN events).

    The fc_rport block manages the library's representation of other
    entities in the FC fabric. Currently the library uses this block
    for targets, its peer when in point-to-point mode and the
    directory server, but can be extended for other entities if
    needed.

    The fc_fcp block interacts with the scsi-ml and handles all
    I/O.

    Signed-off-by: Robert Love
    [jejb: added include of delay.h to fix ppc64 compile prob spotted by sfr]
    Signed-off-by: James Bottomley

    Robert Love
     
  • Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Robert Love
     
  • scsi_execute() and scsi_execute_req() discard the residual length
    information. Some callers need it. This adds residual argument
    (optional) to scsi_execute and scsi_execute_req.

    Signed-off-by: FUJITA Tomonori
    Signed-off-by: James Bottomley

    FUJITA Tomonori
     
  • cxgb3i does not offload the processing of the header,
    but it will always process the padding. This patch
    adds a padding offload flag to detect when the LLD
    supports this.

    The patch also modifies the header processing so that
    we do not try to read/bypass the header dugest in the
    skb. cxgb3i will not include it with the header like
    with other offload cards.

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

    Mike Christie
     
  • We do not need to allocate a itt for data_out, so this
    passes the opcode to the alloc_pdu callout.

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

    Mike Christie
     
  • bnx2i and cxgb3i need to encode LLD info in the itt so that
    the firmware/hardware can process the pdu. This patch allows
    the LLDs to encode info in the task->hdr->itt that they
    setup in the alloc_pdu callout (any resources that are allocated
    can be freed with the pdu in the cleanup_task callout). If
    the LLD encodes info in the itt they should implement a
    parse_pdu_itt callout. If parse_pdu_itt is not implemented
    libiscsi will do the right thing for the LLD.

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

    Mike Christie
     
  • As explained in the previous mails, cxgb3i needs iscsi_tcp's
    r2t/data_out and data_in procesing so this just moves functions
    that both drivers want to use to a new module libiscsi_tcp. The
    next patch will hook iscsi_tcp in.

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

    Mike Christie
     
  • cxgb3i offloads data transfers. It does not offload the entire scsi/iscsi
    procssing like qla4xxx and it does not offload the iscsi sequence
    processing like how bnx2i does. cxgb3i relies on iscsi_tcp for the
    seqeunce handling so this changes how we transfer unsolicitied data by
    adding a common r2t struct and helpers.

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

    Mike Christie
     
  • cxgb3i is unlike qla4xxx and bnx2i in that it does not offload entire
    scsi commands or iscsi sequences. Instead it only offloads the transfer
    of a ISCSI DATA_IN pdu's data, the digests and padding. This patch fixes up the
    iscsi tcp recv path so that it exports its skb recv processing so
    cxgb3i and other drivers can call them. All they have to do is pass
    the function the skb with the hdr or data pdu header and this function
    will do the rest.

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

    Mike Christie
     
  • by removing the unused timeout parameter we ensure a compile failure if
    anyone is accidentally still using it rather than the block timeout.

    Signed-off-by: James Bottomley

    James Bottomley
     

21 Nov, 2008

1 commit


28 Oct, 2008

1 commit


21 Oct, 2008

1 commit


13 Oct, 2008

8 commits

  • The segment->done functions return a iscsi error value which gives
    a lot more info than conn failed, so this patch has us return
    that value. I also add a new one for xmit failures.

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

    Mike Christie
     
  • I had this in my patchset to add target reset support, but
    it got dropped due to patching conflicts. This initial patch
    just renames the function and users. We are actually just
    dropping the session, and so this does not have anything to do
    with the host exactly. It does for software iscsi because
    we allocate a host per session, but for cxgb3i this makes no
    sense.

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

    Mike Christie
     
  • Some endpoint code was using unsigned int and some
    was using uint64_t. This converts it all to uint64_t.

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

    Mike Christie
     
  • If the driver knows when hardware is removed like with cxgb3i,
    bnx2i, qla4xxx and iser then we will want to remove the sessions/devices
    that are bound to that device before removing the host.

    cxgb3i and in the future bnx2i will remove the host and that will
    remove all the sessions on the hba. iser can call iscsi_kill_session
    when it gets an event that indicates that a hca is removed.
    And when qla4xxx is hooked in to the lib (it is only hooked into
    the class right now) it can call iscsi remove host like the
    partial offload card drivers.

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

    Mike Christie
     
  • If the target is blocked and fast io fail tmo has not fired
    then we requeue with DID_TRANSPORT_DISRUPTED. Once that
    tmo fires we fail with DID_TRANSPORT_FAILFAST.

    v2
    - seperate from
    "fc class: unblock target after calling terminate callback"
    to make it easier to review.
    - Add JamesS's ack from list.
    v2
    - initial patch

    Signed-off-by: Mike Christie
    Acked-by: James Smart
    Signed-off-by: James Bottomley

    Mike Christie
     
  • Currently, if there is a transport problem the iscsi drivers will return
    outstanding commands (commands being exeucted by the driver/fw/hw) with
    DID_BUS_BUSY and block the session so no new commands can be queued.
    Commands that are caught between the failure handling and blocking are
    failed with DID_IMM_RETRY or one of the scsi ml queuecommand return values.
    When the recovery_timeout fires, the iscsi drivers then fail IO with
    DID_NO_CONNECT.

    For fcp, some drivers will fail some outstanding IO (disk but possibly not
    tape) with DID_BUS_BUSY or DID_ERROR or some other value that causes a retry
    and hits the scsi_error.c failfast check, block the rport, and commands
    caught in the race are failed with DID_IMM_RETRY. Other drivers, may
    hold onto all IO and wait for the terminate_rport_io or dev_loss_tmo_callbk
    to be called.

    The following patches attempt to unify what upper layers will see drivers
    like multipath can make a good guess. This relies on drivers being
    hooked into their transport class.

    This first patch just defines two new host byte errors so drivers can
    return the same value for when a rport/session is blocked and for
    when the fast_io_fail_tmo fires.

    The idea is that if the LLD/class detects a problem and is going to block
    a rport/session, then if the LLD wants or must return the command to scsi-ml,
    then it can return it with DID_TRANSPORT_DISRUPTED. This will requeue
    the IO into the same scsi queue it came from, until the fast io fail timer
    fires and the class decides what to do.

    When using multipath and the fast_io_fail_tmo fires then the class
    can fail commands with DID_TRANSPORT_FAILFAST or drivers can use
    DID_TRANSPORT_FAILFAST in their terminate_rport_io callbacks or
    the equivlent in iscsi if we ever implement more advanced recovery methods.
    A LLD, like lpfc, could continue to return DID_ERROR and then it will hit
    the normal failfast path, so drivers do not have fully be ported to
    work better. The point of the patches is that upper layers will
    not see a failure that could be recovered from while the rport/session is
    blocked until fast_io_fail_tmo/recovery_timeout fires.

    V3
    Remove some comments.
    V2
    Fixed patch/diff errors and renamed DID_TRANSPORT_BLOCKED to
    DID_TRANSPORT_DISRUPTED.
    V1
    initial patch.

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

    Mike Christie
     
  • When we block a rport and the driver implements the terminate
    callback we will fail IO that was running quickly. However
    IO that was in the scsi_device/block queue sits there until
    the dev_loss_tmo fires, and this can make it look like IO is
    lost because new IO will get executed but that IO stuck in
    the blocked queue sits there for some time longer.

    With this patch when the fast io fail tmo fires, we will
    fail the blocked IO and any new IO. This patch also allows
    all drivers to partially support the fast io fail tmo. If the
    terminate io callback is not implemented, we will still fail blocked
    IO and any new IO, so multipath can handle that.

    This patch also allows the fc and iscsi classes to implement the
    same behavior. The timers are just unfornately named differently.

    This patch also fixes the problem where drivers were unblocking
    the target in their terminate callback, which was needed for
    rport removal, but for fast io fail timeout it would cause
    IO to bounce arround the scsi/block layer and the LLD queuecommand.
    And it for drivers that could have IO stuck but did not have
    a terminate callback the unblock calls in the class will fix
    them.

    v2.
    - fix up bit setting style to meet JamesS's pref.
    - Broke out new host byte error changes to make it easier to read.
    - added JamesS's ack from list.
    v1
    - initial patch

    Signed-off-by: Mike Christie
    Acked-by: James Smart
    Signed-off-by: James Bottomley

    Mike Christie
     
  • SCSI-ml manages the queueing limits for the device and host, but
    does not do so at the target level. However something something similar
    can come in userful when a driver is transitioning a transport object to
    the the blocked state, becuase at that time we do not want to queue
    io and we do not want the queuecommand to be called again.

    The patch adds code similar to the exisiting SCSI_ML_*BUSY handlers.
    You can now return SCSI_MLQUEUE_TARGET_BUSY when we hit
    a transport level queueing issue like the hw cannot allocate some
    resource at the iscsi session/connection level, or the target has temporarily
    closed or shrunk the queueing window, or if we are transitioning
    to the blocked state.

    bnx2i, when they rework their firmware according to netdev
    developers requests, will also need to be able to limit queueing at this
    level. bnx2i will hook into libiscsi, but will allocate a scsi host per
    netdevice/hba, so unlike pure software iscsi/iser which is allocating
    a host per session, it cannot set the scsi_host->can_queue and return
    SCSI_MLQUEUE_HOST_BUSY to reflect queueing limits on the transport.

    The iscsi class/driver can also set a scsi_target->can_queue value which
    reflects the max commands the driver/class can support. For iscsi this
    reflects the number of commands we can support for each session due to
    session/connection hw limits, driver limits, and to also reflect the
    session/targets's queueing window.

    Changes:
    v1 - initial patch.
    v2 - Fix scsi_run_queue handling of multiple blocked targets.
    Previously we would break from the main loop if a device was added back on
    the starved list. We now run over the list and check if any target is
    blocked.
    v3 - Rediff for scsi-misc.

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

    Mike Christie
     

11 Oct, 2008

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (37 commits)
    [SCSI] zfcp: fix double dbf id usage
    [SCSI] zfcp: wait on SCSI work to be finished before proceeding with init dev
    [SCSI] zfcp: fix erp list usage without using locks
    [SCSI] zfcp: prevent fc_remote_port_delete calls for unregistered rport
    [SCSI] zfcp: fix deadlock caused by shared work queue tasks
    [SCSI] zfcp: put threshold data in hba trace
    [SCSI] zfcp: Simplify zfcp data structures
    [SCSI] zfcp: Simplify get_adapter_by_busid
    [SCSI] zfcp: remove all typedefs and replace them with standards
    [SCSI] zfcp: attach and release SAN nameserver port on demand
    [SCSI] zfcp: remove unused references, declarations and flags
    [SCSI] zfcp: Update message with input from review
    [SCSI] zfcp: add queue_full sysfs attribute
    [SCSI] scsi_dh: suppress comparison warning
    [SCSI] scsi_dh: add Dell product information into rdac device handler
    [SCSI] qla2xxx: remove the unused SCSI_QLOGIC_FC_FIRMWARE option
    [SCSI] qla2xxx: fix printk format warnings
    [SCSI] qla2xxx: Update version number to 8.02.01-k8.
    [SCSI] qla2xxx: Ignore payload reserved-bits during RSCN processing.
    [SCSI] qla2xxx: Additional residual-count corrections during UNDERRUN handling.
    ...

    Linus Torvalds
     

09 Oct, 2008

1 commit

  • Right now SCSI and others do their own command timeout handling.
    Move those bits to the block layer.

    Instead of having a timer per command, we try to be a bit more clever
    and simply have one per-queue. This avoids the overhead of having to
    tear down and setup a timer for each command, so it will result in a lot
    less timer fiddling.

    Signed-off-by: Mike Anderson
    Signed-off-by: Jens Axboe

    Jens Axboe
     

04 Oct, 2008

4 commits

  • There's already a fc_vport_termintate() call exported by
    the transport. This patch adds a symmetric call to the API to allow
    an NPIV-capable LLD to instantiate vports sans user intervention.

    Additional comments/updates:

    Re: scsi_fc_transport.txt
    Add a function prototype for fc_vport_terminate similar to what's
    done for fc_vport_create

    Re: fc_vport_create
    I recommend we pass the channel number in fc_vport_create rather
    than fixing it at zero.

    Also, ids->vport_type should be set to FC_PORTTYPE_NPIV prior to
    calling fc_vport_create. The comment is also meaningless.

    Added-by and
    Signed-off-by: James Smart
    Signed-off-by: Andrew Vasquez
    Signed-off-by: James Bottomley

    Andrew Vasquez
     
  • Brian King reported that fibre channel
    devices can oops during scanning if their ports block (because the
    device goes from CREATED -> BLOCK -> RUNNING rather than CREATED ->
    BLOCK -> CREATED).

    Fix this by adding a new state: CREATED_BLOCK which can only transition
    back to CREATED and disallow the CREATED -> BLOCK transition. Now both
    the created and blocked states that the mid-layer recognises can include
    CREATED_BLOCK.

    Signed-off-by: James Bottomley

    James Bottomley
     
  • The created and blocked states are very shortly going to correspond to
    mixed sdev_state states.

    Signed-off-by: James Bottomley

    James Bottomley
     
  • This patch adds scsi netlink recieve and event support for transport
    and scsi LLDD's. It is a reimplementation of the patch posted last
    week by David Somayajulu.
    http://marc.info/?l=linux-scsi&m=121745486221819&w=2

    There are a few things done differently:

    - Transport support is included

    - Event delivery is included

    - The vendor message is now its own unique message type, considered
    part of the generic "SCSI Transport".

    - LLDD entry points are now registered rather than included in the
    scsi_host_template.

    Background: When I started to implement the event handler via template,
    I had to either: muck up scsi_add_host and scsi_remove_host; or have
    the event handler search all possible shosts. Neither was acceptable.
    Moving to a registration solves this, and also limits the scope of
    the changes to something that could be backported to a distro without
    breaking an already-released-distro kabi. However, I admit it isn't
    as elegant, as the passing of the LLDD host template in the
    registration and the complexity around dynamic add/remove shows.

    - The receive path was augmented to require a unique identifier for
    the LLDD before the message was allowed to be handed off to the
    driver. Given how quickly very fatal errors occur if there's msg
    mismatches (which I saw in testing my own tools :), I believe this
    to be a very good thing. The id plays off the vendor id scheme already
    introduced for the vendor unique event messages used by FC.
    Additionally, the id use as the basis of the registration/deregistration.

    - Send assist functions, for both the transport and LLDDs are included.

    [fujita.tomonori@lab.ntt.co.jp: fix missing cast]
    Signed-off-by: James Smart
    Signed-off-by: James Bottomley

    James Smart
     

29 Aug, 2008

1 commit

  • For IBM z series certain LUNs can no longer be accessed.

    This is because kernel version 2.6.19 a check was introduced not to
    create a generic SCSI device for devices that return PQ=1 and
    PDT=0x1f. For WLUNs (see SAM-3, p. 41ff) generic SCSI devices should
    be created unconditionally without looking at the PQ bit, so add a
    check for WLUNs in with this test.

    Acked-by: Martin Petermann
    Signed-off-by: James Bottomley

    James Bottomley
     

07 Aug, 2008

1 commit

  • Some USB devices set the protect bit in the INQUIRY data which
    currently causes the DIF code in sd to assume (incorrectly) that they
    support READ_CAPACITY(16). Fix this (only for the time being) by
    making sure we only believe the protect bit in the inquiry data if the
    device claims conformance to SCSI-3 or above.

    Acked-by: Martin K. Petersen
    Signed-off-by: James Bottomley

    Hugh Dickins
     

06 Aug, 2008

1 commit

  • This re-introduces commit 2b142900784c6e38c8d39fa57d5f95ef08e735d8,
    which was reverted due to the regression it caused by commit
    fca082c9f1e11ec07efa8d2f9f13688521253f36.

    That regression was not root-caused by the original commit, it was just
    uncovered by it, and the real fix was done by Alan Stern in commit
    580da34847488b404218d1d7f53b156f245f5555 ("Fix USB storage hang on
    command abort").

    We can thus re-introduce the change that was confirmed by Alan Jenkins
    to be still required by his odd card reader.

    Cc: Alan Jenkins
    Cc: Alan Stern
    Cc: James Bottomley
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

05 Aug, 2008

1 commit

  • This reverts commit 2b142900784c6e38c8d39fa57d5f95ef08e735d8, since it
    seems to break some other USB storage devices (at least a JMicron USB to
    ATA bridge). As such, while it apparently fixes some cardreaders, it
    would need to be made conditional on the exact reader it fixes in order
    to avoid causing regressions.

    Cc: Alan Jenkins
    Cc: James Bottomley
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

27 Jul, 2008

6 commits

  • The last_sector_bug flag was added to work around a bug in certain usb
    cardreaders, where they would crash if a multiple sector read included the
    last sector. The original implementation avoids this by e.g. splitting an 8
    sector read which includes the last sector into a 7 sector read, and a single
    sector read for the last sector. The flag is enabled for all USB devices.

    This revealed a second bug in other usb cardreaders, which crash when they
    get a multiple sector read which stops 1 sector short of the last sector.
    Affected hardware includes the Kingston "MobileLite" external USB cardreader
    and the internal USB cardreader on the Asus EeePC.

    Extend the last_sector_bug workaround to ensure that any access which touches
    the last 8 hardware sectors of the device is a single sector long. Requests
    are shrunk as necessary to meet this constraint.

    This gives us a safety margin against potential unknown or future bugs
    affecting multi-sector access to the end of the device. The two known bugs
    only affect the last 2 sectors. However, they suggest that these devices
    are prone to fencepost errors and that multi-sector access to the end of the
    device is not well tested. Popular OS's use multi-sector accesses, but they
    rarely read the last few sectors. Linux (with udev & vol_id) automatically
    reads sectors from the end of the device on insertion. It is assumed that
    single sector accesses are more thoroughly tested during development.

    Signed-off-by: Alan Jenkins
    Tested-by: Alan Jenkins
    Signed-off-by: James Bottomley

    Alan Jenkins
     
  • This patch (as1116) fixes a bug in scsi_eh_prep_cmnd() and
    scsi_eh_restore_cmnd(). These routines are supposed to save any
    values they change and restore them later, but someone forgot to
    save & restore scmd->underflow.

    This fixes part of the problem reported in Bugzilla #9638.

    [jejb: fix up rejections around DIF/DIX]
    Signed-off-by: Alan Stern
    Signed-off-by: James Bottomley

    Alan Stern
     
  • Implement support for DMA of protection information for devices that
    are data integrity capable.

    - Add support for mapping an extra scatter-gather list containing
    the protection information.

    - Allocate protection scsi_data_buffer if host is DIX (integrity DMA)
    capable.

    - Accessor function for checking whether a device has protection
    enabled.

    Signed-off-by: Martin K. Petersen
    Signed-off-by: James Bottomley

    Martin K. Petersen
     
  • Controllers that support DMA of protection information must be told
    explicitly how to handle the I/O. The controller has no knowledge of
    the protection capabilities of the target device so this information
    must be passed in the scsi_cmnd.

    - The protection operation tells the HBA whether to generate, strip or
    verify protection information.

    - The protection type tells the HBA which layout the target is
    formatted with. This is necessary because the controller must be
    able to correctly interpret the included protection information in
    order to verify it.

    - When a scsi_cmnd is reused for error handling the protection
    operation must be cleared and saved while error handling is in
    progress.

    - prot_op and prot_type are placed in an existing hole in scsi_cmnd
    and don't cause the structure to grow.

    Signed-off-by: Martin K. Petersen
    Signed-off-by: James Bottomley

    Martin K. Petersen
     
  • Controllers that support protection information must indicate this to
    the SCSI midlayer so that the ULD can prepare scsi_cmnds accordingly.

    This patch implements a host mask and various types of protection:

    - DIF Type 1-3 (between HBA and disk)
    - DIX Type 0-3 (between OS and HBA)

    The patch also allows the HBA to set the guard type to something
    different than the T10-mandated CRC.

    Signed-off-by: Martin K. Petersen
    Signed-off-by: James Bottomley

    Martin K. Petersen
     
  • multipath keeps a separate device table which may be
    more current than the built-in one.
    So we should make sure to always call ->attach whenever
    a multipath map with hardware handler is instantiated.
    And we should call ->detach on removal, too.

    [sekharan: update as per comments from agk]
    Signed-off-by: Hannes Reinecke
    Signed-off-by: Chandra Seetharaman
    Signed-off-by: James Bottomley

    Hannes Reinecke