30 Jun, 2011

1 commit


25 Feb, 2011

2 commits


31 Dec, 2010

1 commit


22 Dec, 2010

1 commit

  • The patch fixes the following situations where NOP-Out pkt is called for:
    - local unsolicited NOP-Out requests (requesting no NOP-In response)
    - local NOP-Out responses to unsolicited NOP-In requests

    kernel panic is observed due to double session spin_lock requests; one in the
    bnx2i_process_nopin_local_cmpl routine in bnx2i_hwi.c and the other in the
    iscsi_put_task routine in libiscsi.c

    The proposed fix is to export the currently static __iscsi_put_task() routine
    and have bnx2i call it directly instead of the iscsi_put_task() routine which
    holds the session spin lock.

    Signed-off-by: Eddie Wai
    Reviewed-by: Michael Chan
    Reviewed-by: Anil Veerabhadrappa
    Acked-by: Benjamin Li
    Reviewed-by: Mike Christie
    Signed-off-by: James Bottomley

    Eddie Wai
     

17 Nov, 2010

1 commit

  • Move the mid-layer's ->queuecommand() invocation from being locked
    with the host lock to being unlocked to facilitate speeding up the
    critical path for drivers who don't need this lock taken anyway.

    The patch below presents a simple SCSI host lock push-down as an
    equivalent transformation. No locking or other behavior should change
    with this patch. All existing bugs and locking orders are preserved.

    Additionally, add one parameter to queuecommand,
    struct Scsi_Host *
    and remove one parameter from queuecommand,
    void (*done)(struct scsi_cmnd *)

    Scsi_Host* is a convenient pointer that most host drivers need anyway,
    and 'done' is redundant to struct scsi_cmnd->scsi_done.

    Minimal code disturbance was attempted with this change. Most drivers
    needed only two one-line modifications for their host lock push-down.

    Signed-off-by: Jeff Garzik
    Acked-by: James Bottomley
    Signed-off-by: Linus Torvalds

    Jeff Garzik
     

03 Mar, 2010

1 commit


23 Dec, 2009

1 commit

  • This is a new generic kernel FIFO implementation.

    The current kernel fifo API is not very widely used, because it has to
    many constrains. Only 17 files in the current 2.6.31-rc5 used it.
    FIFO's are like list's a very basic thing and a kfifo API which handles
    the most use case would save a lot of development time and memory
    resources.

    I think this are the reasons why kfifo is not in use:

    - The API is to simple, important functions are missing
    - A fifo can be only allocated dynamically
    - There is a requirement of a spinlock whether you need it or not
    - There is no support for data records inside a fifo

    So I decided to extend the kfifo in a more generic way without blowing up
    the API to much. The new API has the following benefits:

    - Generic usage: For kernel internal use and/or device driver.
    - Provide an API for the most use case.
    - Slim API: The whole API provides 25 functions.
    - Linux style habit.
    - DECLARE_KFIFO, DEFINE_KFIFO and INIT_KFIFO Macros
    - Direct copy_to_user from the fifo and copy_from_user into the fifo.
    - The kfifo itself is an in place member of the using data structure, this save an
    indirection access and does not waste the kernel allocator.
    - Lockless access: if only one reader and one writer is active on the fifo,
    which is the common use case, no additional locking is necessary.
    - Remove spinlock - give the user the freedom of choice what kind of locking to use if
    one is required.
    - Ability to handle records. Three type of records are supported:
    - Variable length records between 0-255 bytes, with a record size
    field of 1 bytes.
    - Variable length records between 0-65535 bytes, with a record size
    field of 2 bytes.
    - Fixed size records, which no record size field.
    - Preserve memory resource.
    - Performance!
    - Easy to use!

    This patch:

    Since most users want to have the kfifo as part of another object,
    reorganize the code to allow including struct kfifo in another data
    structure. This requires changing the kfifo_alloc and kfifo_init
    prototypes so that we pass an existing kfifo pointer into them. This
    patch changes the implementation and all existing users.

    [akpm@linux-foundation.org: fix warning]
    Signed-off-by: Stefani Seibold
    Acked-by: Greg Kroah-Hartman
    Acked-by: Mauro Carvalho Chehab
    Acked-by: Andi Kleen
    Acked-by: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stefani Seibold
     

05 Dec, 2009

2 commits

  • This implements warm target reset tmf support for
    the scsi-ml target reset callback. Previously we would
    just drop the session in that callback. This patch will
    now try a target reset and if that fails drop the session.

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

    Mike Christie
     
  • This patch modifies scsi_host_template->change_queue_depth so that
    it takes an argument indicating why it is being called. This will be
    used so that if a LLD needs to do some extra processing when
    handling queue fulls or later ramp ups, it can do so.

    This is a simple port of the drivers setting a change_queue_depth
    callback. In the patch I just have these LLDs adjust the queue depth
    if the user was requesting it.

    Signed-off-by: Mike Christie

    [Vasu.Dev: v2
    Also converted pmcraid_change_queue_depth and then verified
    all modules compile using "make allmodconfig" for any new build
    warnings on X86_64.

    Updated original description after combing two original
    patches from Mike to make this patch git bisectable.]
    Signed-off-by: Vasu Dev
    [jejb: fixed up 53c700]
    Signed-off-by: James Bottomley

    Mike Christie
     

03 Oct, 2009

1 commit


12 Sep, 2009

2 commits

  • bnx2i currently has a check for if a ep is properly bound, so if
    iscsi_queuecommand/xmit_task is called while there is no ep
    we will not queue IO.

    be2iscsi sends IO from queuecommand/xmit_task like how bnx2i does
    and needs a similar test. This patch has us just use the suspend_bit
    test for this.

    When ep_poll has succeeed iscsid will call conn_bind, the LLD will
    then call iscsi_conn_bind which will clear the suspend bit.
    When ep_disconnect is called (or if there is a conn error) we set
    the suspend bit. For the ep_disconnect case I am adding a helper
    in this patch that will take the session lock to make sure
    iscsi_queuecommand/xmit_task is not running and it will set
    the suspend bit.

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

    Mike Christie
     
  • beiscsi does not need the iscsi scsi cmd processing. It does not
    even get this info on the completion path. This adds a function
    to just update the sequencing numbers and complete a task.

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

    Mike Christie
     

21 Jun, 2009

1 commit


24 May, 2009

3 commits

  • If a task did not complete normally due to a TMF, libiscsi will
    now complete the task with the state ISCSI_TASK_ABRT_TMF. Drivers
    like bnx2i that need to free resources if a command did not complete normally
    can then check the task state. If a driver does not need to send
    a special command if we have dropped the session then they can check
    for ISCSI_TASK_ABRT_SESS_RECOV.

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

    Mike Christie
     
  • bnx2i needs to send a hardware specific cleanup command if
    a command has not completed normally (iscsi/scsi response from
    target), and the session is still ok (this is the case when we
    send a TMF to stop the command).

    At this time it will need to drop the session lock. The problem
    with the current code is that fail_all_commands assumes we
    will hold the lock the entire time, so it uses list_for_each_entry_safe.
    If while bnx2i drops the session lock multiple cmds complete then
    list_for_each_entry_safe will not handle this correctly.

    This patch removes the running lists and just has us loop over
    the cmds array (in later patches we will then replace that
    array with a block tag map at the session level). It also fixes
    up the completion path so that if the TMF code and the normal recv
    path were completing the same command then they both do not try
    to do release the refcount taken when the task is queued.

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

    Mike Christie
     
  • bnx2i needs to be able to look up mgmt task like login and nop, because
    it does some processing of them on the completion path. This exports
    iscsi_itt_to_task so it can look up the task.

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

    Mike Christie
     

27 Apr, 2009

1 commit


14 Mar, 2009

5 commits


30 Dec, 2008

2 commits

  • 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
     
  • 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
     

13 Oct, 2008

2 commits

  • 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
     
  • 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
     

12 Jul, 2008

12 commits

  • The recv lock was defined so the iscsi layer could block
    the recv path from processing IO during recovery. It
    turns out iser just set a lock to that pointer which was pointless.

    We now disconnect the transport connection before doing recovery
    so we do not need the recv lock. For iscsi_tcp we still stop
    the recv path incase older tools are being used.

    This patch also has iscsi_itt_to_ctask user grab the session lock
    and has the caller access the task with the lock or get a ref
    to it in case the target is broken and sends a tmf success response
    then sends data or a response for the command that was supposed to
    be affected bty the tmf.

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

    Mike Christie
     
  • Drivers expect that the cmds_max value they pass to the iscsi layer
    is the max scsi commands + mgmt tasks. This patch implements that
    and fixes some checks for nr cmd limits.

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

    Mike Christie
     
  • This adds two new attrs used for creating initiator ports and
    binding sessions to hardware.

    The session level initiatorname:

    Since bnx2i does a scsi_host per host device, we need to add the
    iface initiator port settings on the session, so we can create
    multiple initiator ports (each with different inames) per device/scsi_host.

    The current iname reflects that qla4xxx can have one iname per hba, and we are
    allocating a host per session for software. The iname on the host will
    remain so we can export and set the hba level qla4xxx setting.

    The ifacename attr:

    To bind a session to a some peice of hardware in userspace we maintain
    some mappings, but during boot or iscsid restart (iscsid contains the user
    space part of the driver) we need to be able to figure out which of those
    host mappings abstractions maps to certain sessions. This patch adds
    a ifacename attr, which userspace can set to id the host side of the
    endpoint across pivot_roots and iscsid restarts.

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

    Mike Christie
     
  • Currently we duplicate the list of sessions, because we were using the
    test for if a session was on the host list to indicate if the session
    was bound or unbound. We can instead use the target_id and fix up
    the class so that drivers like bnx2i do not have to manage the target id
    space.

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

    Mike Christie
     
  • This is the second part of the iscsi task merging, and
    all it does it rename iscsi_cmd_task to iscsi_task and
    mtask/ctask to just task.

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

    Mike Christie
     
  • There is no need to have the mgmt and cmd tasks separate
    structs. It used to save a lot of memory when we overprealocated
    memory for tasks, but the next patches will set up the
    driver so in the future they can use a mempool or some other
    common scsi command allocator and common tagging.

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

    Mike Christie
     
  • Currently to get a ctask from the session cmd array, you have to
    know to use the itt modifier. To make this easier on LLDs and
    so in the future we can easilly kill the session array and use
    the host shared map instead, this patch adds a nice wrapper
    to strip the itt into a session->cmds index and return a ctask.

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

    Mike Christie
     
  • Some drivers want to be able to just pass in the driver data pointers
    to the iscsi objects. To enable this we need the iscsi printk macro
    to cast the object.

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

    Mike Christie
     
  • This removes the session and conn data_size fields from the iscsi_transport.
    Just pass in the value like with host allocation. This patch also makes
    it so the LLD iscsi_conn data is allocated with the iscsi_cls_conn.

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

    Mike Christie
     
  • This finishes the host/session unbinding, by adding some helpers
    to add and remove hosts and the session they manage.

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

    Mike Christie
     
  • bnx2i allocates a host per netdevice but will use libiscsi,
    so this unbinds the session from the host in that code.

    This will also be useful for the iser parent device dma settings
    fixes.

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

    Mike Christie
     
  • iscsi offload (bnx2i and qla4xx) allocate a scsi host per hba,
    so the session creation path needs a shost/host_no argument.
    Software iscsi/iser will follow the same behabior as before
    where it allcoates a host per session, but in the future iser
    will probably look more like bnx2i where the host's parent is
    the hardware (rnic for iser and for bnx2i it is the nic), because
    it does not use a socket layer like how iscsi_tcp does.

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

    Mike Christie
     

30 Apr, 2008

1 commit