1. 12 1月, 2008 4 次提交
    • O
      [SCSI] libiscsi, iscsi_tcp: iscsi pool cleanup · 6320377f
      Olaf Kirch 提交于
      iscsi_pool_init simplified
      
      iscsi_pool_init currently has a lot of duplicate kfree() calls it does
      when some allocation fails. This patch simplifies the code a little by
      using iscsi_pool_free to tear down the pool in case of an error.
      
      iscsi_pool_init also returns a copy of the item array to the caller.
      Not all callers use this array, so we make it optional.
      
      Instead of allocating a second array and return that, allocate just one
      array, of twice the size.
      
      Update users of iscsi_pool_{init,free}
      
      This patch drops the (now useless) second argument to
      iscsi_pool_free, and updates all callers.
      
      It also removes the ctask->r2ts array, which was never
      used anyway. Since the items argument to iscsi_pool_init
      is now optional, we can pass NULL instead.
      Signed-off-by: NOlaf Kirch <olaf.kirch@oracle.com>
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      6320377f
    • B
      [SCSI] iscsi_tcp, libiscsi: initial AHS Support · 004d6530
      Boaz Harrosh 提交于
        at libiscsi generic code
        - currently code assumes a storage space of pdu header is allocated
          at llds ctask and is pointed to by iscsi_cmd_task->hdr. Here I add
          a hdr_max field pertaining to that storage, and an hdr_len that
          accumulates the current use of the pdu-header.
      
        - Add an iscsi_next_hdr() inline which returns the next free space
          to write new Header at. Also iscsi_next_hdr() is used to retrieve
          the address at which to write the header-digest.
      
        - Add iscsi_add_hdr(length). What the user do is calls iscsi_next_hdr()
          for address of the new header, than calls iscsi_add_hdr(length) with
          the size of the new header. iscsi_add_hdr() will check if space is
          available and update to the new size. length must be padded according
          to standard.
      
        - Add 2 padding inline helpers thanks to Olaf. Current patch does not
          use them but Following patches will.
          Also moved definition of ISCSI_PAD_LEN to iscsi_proto.h which had
          PAD_WORD_LEN that was never used anywhere.
      
        - Let iscsi_prep_scsi_cmd_pdu() signal an Error return since now  it is
          possible that it will fail.
      
        - I was tired of yet again writing a "this is a digest" comment next to
          sizeof(__u32) so I defined a new ISCSI_DIGEST_SIZE. Now I don't need
          any comments. Changed all places that used sizeof(__u32) or "4" in
          connection to a digest.
      
        iscsi_tcp specific code
        - At struct iscsi_tcp_cmd_task allocate maximum space allowed in
          standard for all headers following the iscsi_cmd header. and mark
          it so in iscsi_tcp_session_create()
        - At iscsi_send_cmd_hdr() retrieve the correct headers size and
          write header digest at iscsi_next_hdr().
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NOlaf Kirch <olaf.kirch@oracle.com>
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      004d6530
    • O
      [SCSI] iscsi_tcp: rewrite recv path · da32dd68
      Olaf Kirch 提交于
      Rewrite recv path. Fixes:
      - data digest processing and error handling.
      - ahs support.
      
      Some fixups by Mike Christie
      Signed-off-by: NOlaf Kirch <olaf.kirch@oracle.com>
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      da32dd68
    • M
      [SCSI] libiscsi, iscsi_tcp: add device support · 843c0a8a
      Mike Christie 提交于
      This patch adds logical unit reset support. This should work for ib_iser,
      but I have not finished testing that driver so it is not hooked in yet.
      
      This patch also temporarily reverts the iscsi_tcp r2t write out patch.
      That code is completely rewritten in this patchset.
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      843c0a8a
  2. 16 8月, 2007 1 次提交
  3. 27 7月, 2007 1 次提交
  4. 03 6月, 2007 4 次提交
    • M
      [SCSI] iscsi class, iscsi_tcp, iser, qla4xxx: add netdevname sysfs attr · d8196ed2
      Mike Christie 提交于
      iSCSI must support software iscsi (iscsi_tcp, iser), hardware iscsi (qla4xxx),
      and partial offload (broadcom). To be able to allow each stack or driver
      or port (virtual or physical) to be able to log into the same target portal
      we use the initiator tuple [[HWADDRESS | NETDEVNAME], INITIATOR_NAME] and
      the target tuple [TARGETNAME, CONN_ADDRESS, CONN_PORT] to id a session.
      This patch adds the netdev name, which is used by software iscsi when
      it binds a session to a netdevice using the SO_BINDTODEVICE sock opt.
      It cannot use HWADDRESS because if someone did vlans then the same netdevice
      will have the same mac and the initiator,target id will not be unique.
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Cc: Roland Dreier <rdreier@cisco.com>
      Cc: David C Somayajulu <david.somayajulu@qlogic.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      d8196ed2
    • M
      [SCSI] iscsi class, qla4xxx, iscsi_tcp: export local address · 22236961
      Mike Christie 提交于
      This patch exports the local address for the session. For
      qla4xxx this is the ip of the hba's port. For software
      this is the src addr of the socket.
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Cc: David C Somayajulu <david.somayajulu@qlogic.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      22236961
    • M
      [SCSI] libiscsi: make can_queue configurable · 1548271e
      Mike Christie 提交于
      This patch allows us to set can_queue and cmds_per_lun from userspace
      when we create the session/host. From there we can set it on a per
      target basis. The patch fully converts iscsi_tcp, but only hooks
      up ib_iser for cmd_per_lun since it currently has a lots of preallocations
      based on can_queue.
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Cc: Roland Dreier <rdreier@cisco.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      1548271e
    • M
      [SCSI] libiscsi: fix iscsi cmdsn allocation · 77a23c21
      Mike Christie 提交于
      The cmdsn allocation and pdu transmit code can race, and we can end
      up sending a pdu with cmdsn 10 before a pdu with 5. The target will
      then fail the connection/session. This patch fixes the problem by
      delaying the cmdsn allocation until we are about to send the pdu.
      
      This also removes the xmitmutex. We were using the connection xmitmutex
      during error handling to handle races with mtask and ctask cleanup and
      completion. For ctasks we now have nice refcounting and for the mtask,
      if we hit the case where the mtask timesout and it is floating
      around somewhere in the driver, we end up dropping the session.
      And to handle session level cleanup, we use the xmit suspend bit
      along with scsi_flush_queue and the session lock to make sure
      that the xmit thread is not possibly transmitting a task while
      we are trying to kill it.
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Cc: Roland Dreier <rdreier@cisco.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      77a23c21
  5. 02 6月, 2007 5 次提交
  6. 04 12月, 2006 1 次提交
  7. 26 10月, 2006 1 次提交
  8. 03 9月, 2006 2 次提交
  9. 29 7月, 2006 3 次提交
  10. 29 6月, 2006 1 次提交
  11. 06 6月, 2006 1 次提交
  12. 20 5月, 2006 1 次提交
  13. 10 5月, 2006 1 次提交
  14. 15 4月, 2006 1 次提交
    • M
      [SCSI] iscsi: add libiscsi · 7996a778
      Mike Christie 提交于
      There is a lot of code duplcited between iscsi_tcp
      and the upcoming iscsi_iser driver. This patch puts
      the duplicated code in a lib. There is more code
      to move around but this takes care of the
      basics. For iscsi_offload if they use the lib we will
      probably move some things around. For example in the
      queuecommand we will not assume that the LLD wants
      to do queue_work, but it is better to handle that
      later when we know for sure what iscsi_offload looks
      like (we could probably do this for iscsi_iser though to).
      
      Ideally I would like to get the iscsi_transports modules
      to a place where all they really have to do is put data
      on the wire, but how to do that will hopefully be more clear
      when we see other modules like iscsi_offload. Or maybe
      iscsi_offload will not use the lib and it will just be
      iscsi_iser and iscsi_tcp and maybe the iscsi_tcp_tgt if that
      is allowed in mainline.
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      7996a778