1. 25 9月, 2014 6 次提交
  2. 17 9月, 2014 1 次提交
  3. 25 6月, 2014 1 次提交
  4. 04 6月, 2014 1 次提交
    • N
      qla2xxx: Convert to percpu_ida session tag pre-allocation · 51a07f84
      Nicholas Bellinger 提交于
      This patch converts qla2xxx target code to use generic percpu_ida
      tag allocation provided by target-core, thus removing the original
      kmem_cache_zalloc() for each struct qla_tgt_cmd descriptor in the
      incoming ATIO packet fast-path.
      
      This includes the conversion of qlt_handle_cmd_for_atio() to perform
      qla_tgt_sess lookup before dispatching a command descriptor into
      qla_tgt_wq process context, along with handling the case where no
      active session exists, and subsequently kicking off a seperate
      process context for qlt_create_sess_from_atio() to create a new one.
      
      It also includes moving tag allocation into generic code within
      qlt_get_tag(), so that the same logic can be shared between
      qlt_handle_cmd_for_atio() + qlt_create_sess_from_atio() contexts.
      Also, __qlt_do_work() has been made generic between both normal
      process context in qlt_do_work() + qlt_create_sess_from_atio().
      
      Next, update qlt_free_cmd() to release the percpu-ida tags, and
      drop the now-unused global qla_tgt_cmd_cachep.
      
      Finally in tcm_qla2xxx code, tcm_qla2xxx_check_initiator_node_acl()
      has been updated to use transport_init_session_tags() along with a
      hardcoded TCM_QLA2XXX_DEFAULT_TAGS=2088 as the number of qla_tgt_cmd
      descriptors to pre-allocate per qla_tgt_sess instance.
      
      (Use ha->fw_xcb_count if available to calculate num_tags, and
       also factor in extra pad tags - Quinn)
      
      Cc: Saurav Kashyap <saurav.kashyap@qlogic.com>
      Cc: Quinn Tran <quinn.tran@qlogic.com>
      Cc: Giridhar Malavali <giridhar.malavali@qlogic.com>
      Cc: Chad Dupuis <chad.dupuis@qlogic.com>
      Cc: Roland Dreier <roland@kernel.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      51a07f84
  5. 03 6月, 2014 1 次提交
  6. 19 5月, 2014 2 次提交
    • Q
      qla2xxx: ABTS cause double free of qla_tgt_cmd +. · 7b898542
      Quinn Tran 提交于
      Fix double free problem within qla2xxx driver where
      current code prematurely free qla_tgt_cmd while firmware
      still has the command.  When firmware release the command
      after abort, the code attempt a second free as part of
      command completion processing.
      
      When TCM start the free process, NULL pointer was hit.
      
      ------
      WARNING: CPU: 8 PID: 43613 at lib/list_debug.c:62 __list_del_entry+0x82/0xd0()
      list_del corruption. next->prev should be ffff88082b5cfb08, but was 6b6b6b6b6b6b6b6b
      CPU: 8 PID: 43613 Comm: kworker/8:0 Tainted: GF       W  O 3.13.0-rc3-nab_t10dif+ #6
      Hardware name: HP ProLiant DL380p Gen8, BIOS P70 08/20/2012
      Workqueue: events cache_reap
      000000000000003e ffff88081b2e3c78 ffffffff815a051f 000000000000003e
      ffff88081b2e3cc8 ffff88081b2e3cb8 ffffffff8104fc2c 0000000000000000
      ffff88082b5cfb00 ffff88081c788d00 ffff88082b5d7200 ffff88082b5d3080
      Call Trace:
      [<ffffffff815a051f>] dump_stack+0x49/0x62
      [<ffffffff8104fc2c>] warn_slowpath_common+0x8c/0xc0
      [<ffffffff8104fd16>] warn_slowpath_fmt+0x46/0x50
      [<ffffffff812b6592>] __list_del_entry+0x82/0xd0
      [<ffffffff8106d48c>] process_one_work+0x12c/0x510
      [<ffffffff8106d4d3>] ? process_one_work+0x173/0x510
      [<ffffffff8106ebdf>] worker_thread+0x11f/0x3a0
      [<ffffffff8106eac0>] ? manage_workers+0x170/0x170
      [<ffffffff81074f26>] kthread+0xf6/0x120
      [<ffffffff8109f103>] ? __lock_release+0x133/0x1b0
      [<ffffffff81074e30>] ? __init_kthread_worker+0x70/0x70
      [<ffffffff815aec2c>] ret_from_fork+0x7c/0xb0
      [<ffffffff81074e30>] ? __init_kthread_worker+0x70/0x70
      ---[ end trace dfc05c3f7caf8ebe ]---
      BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
      IP: [<ffffffff8106d391>] process_one_work+0x31/0x510
      -------
      Signed-off-by: NQuinn Tran <quinn.tran@qlogic.com>
      Signed-off-by: NGiridhar Malavali <giridhar.malavali@qlogic.com>
      Signed-off-by: NSaurav Kashyap <saurav.kashyap@qlogic.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      7b898542
    • Q
      qla2xxx: T10-Dif: add T10-PI support · f83adb61
      Quinn Tran 提交于
      Add support for T10-Dif for Target Mode to qla driver.
      The driver will look for firmware attribute that support
      this feature.  When the feature is present, the capabilities
      will be report to TCM layer.
      
      Add CTIO CRC2 iocb to build T10-Dif commands.
      Add support routines to process good & error cases.
      Signed-off-by: NQuinn Tran <quinn.tran@qlogic.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      Signed-off-by: NGiridhar Malavali <giridhar.malavali@qlogic.com>
      Signed-off-by: NSaurav Kashyap <saurav.kashyap@qlogic.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      f83adb61
  7. 25 2月, 2014 1 次提交
    • D
      qla2xxx: Fix kernel panic on selective retransmission request · 6f58c780
      Dr. Greg Wettstein 提交于
      A selective retransmission request (SRR) is a fibre-channel
      protocol control request which provides support for requesting
      retransmission of a data sequence in response to an issue such as
      frame loss or corruption.  These events are experienced
      infrequently in fibre-channel based networks which makes
      it difficult to test and assess codepaths which handle these
      events.
      
      We were fortunate enough, for some definition of fortunate, to
      have a metro-area single-mode SAN link which, at 10 GBPS
      sustained load levels, would consistently generate SRR's in
      a SCST based target implementation using our SCST/in-kernel
      Qlogic target interface driver.  In response to an SRR the
      in-kernel Qlogic target driver immediately panics resulting
      in a catastrophic storage failure for serviced initiators.
      
      The culprit was a debug statement in the qla_target.c file which
      does not verify that a pointer to the SCSI CDB is not null.
      The unchecked pointer dereference results in the kernel panic
      and resultant system failure.
      
      The other two references to the SCSI CDB by the SRR handling code
      use a ternary operator to verify a non-null pointer is being
      acted on.  This patch simply adds a similar test to the implicated
      debug statement.
      
      This patch is a candidate for any stable kernel being maintained
      since it addresses a potentially catastrophic event with
      minimal downside.
      Signed-off-by: NDr. Greg Wettstein <greg@enjellic.com>
      Cc: <stable@vger.kernel.org> #3.5+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      6f58c780
  8. 21 2月, 2014 2 次提交
    • N
      qla2xxx: Check + fail when npiv_vports_inuse exists in shutdown · 3c231bda
      Nicholas Bellinger 提交于
      This patch adds an check to qlt_stop_phase1() to avoid shutdown
      when the base_vha contains a non-zero fc_host->npiv_vports_inuse
      count.
      
      This includes holding qla_tgt_mutex in qlt_stop_phase1() between
      the fc_host->npiv_vports_inuse check + setting of tgt->tgt_stop to
      avoid a possible race between qlt_lport_register() -> tcm_qla2xxx
      -> tcm_qla2xxx_lport_register_npiv_cb() calling fc_vport_create().
      
      Cc: Sawan Chandak <sawan.chandak@qlogic.com>
      Cc: Quinn Tran <quinn.tran@qlogic.com>
      Cc: Saurav Kashyap <saurav.kashyap@qlogic.com>
      Cc: Giridhar Malavali <giridhar.malavali@qlogic.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      3c231bda
    • N
      qla2xxx: Fix qlt_lport_register base_vha callback race · ddb95145
      Nicholas Bellinger 提交于
      This patch closes a race between qlt_lport_register() and
      tcm_qla2xxx callback logic by holding qla_tgt_mutex before
      making the callback.
      
      In order for this to work, the qlt_add_target() and
      qlt_remove_target() code has been changed to avoid the
      accessing qla_tgt_mutex + list_[add,del] for NPIV enabled
      ports.
      
      This bug introduced in v3.14-rc1 code with commit 49a47f2c.
      
      Cc: Sawan Chandak <sawan.chandak@qlogic.com>
      Cc: Quinn Tran <quinn.tran@qlogic.com>
      Cc: Saurav Kashyap <saurav.kashyap@qlogic.com>
      Cc: Giridhar Malavali <giridhar.malavali@qlogic.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      ddb95145
  9. 13 2月, 2014 1 次提交
  10. 19 1月, 2014 3 次提交
  11. 20 12月, 2013 1 次提交
  12. 12 12月, 2013 1 次提交
  13. 11 9月, 2013 1 次提交
  14. 03 9月, 2013 1 次提交
  15. 21 6月, 2013 1 次提交
    • J
      qla_target: remove qlt_check_fcport_exist · 08234e3a
      Jörn Engel 提交于
      Comment from original 2012 patch:
        In all our testing this function has never returned true.  However, the
        dropping of hardware_lock necessary to call this function seems to cause
        a use-after-free we manage to hit rather frequently.  Given this
        cost-benefit ratio, I'm willing to remove some 100 lines of code.
      
      And since the same problem exists around shutdown_sess and put_sess,
      this patch changes them from taking the hardware_lock to requiring the
      hardware_lock to be taken.  In most cases the caller already had the
      lock and had to drop it for the called method to reacquire it.  At best
      that hurts performance and in rare instances it causes races with fatal
      consequences.
      
      We dropped the original 2012 patch when upgrading our kernel and it took
      us nearly half a year to discover we still need it.
      
      (nab: Fix qla_tgt_sess reference in tcm_qla2xxx_put_sess)
      Signed-off-by: NJoern Engel <joern@logfs.org>
      Cc: Giridhar Malavali <giridhar.malavali@qlogic.com>
      Cc: Chad Dupuis <chad.dupuis@qlogic.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      08234e3a
  16. 25 4月, 2013 1 次提交
  17. 22 2月, 2013 3 次提交
  18. 30 11月, 2012 1 次提交
  19. 28 11月, 2012 1 次提交
  20. 30 10月, 2012 1 次提交
  21. 27 10月, 2012 1 次提交
    • R
      qla2xxx: Update target lookup session tables when a target session changes · c8292d1d
      Roland Dreier 提交于
      It is possible for the target code to change the loop_id or s_id of a
      target session in reaction to an FC fabric change.  However, the
      session structures are stored in tables that are indexed by these two
      keys, and if we just change the session structure but leave the
      pointers to it in the old places in the table, havoc can ensue.  For
      example, a new session might come along that should go in the old slot
      in the table and overwrite the old session pointer.
      
      To handle this, add a new tgt_ops->update_sess() method that also
      updates the "by loop_id" and "by s_id" lookup tables when a session
      changes, so that the keys where a session pointer is stored in these
      tables always matches the keys in the session structure itself.
      
      (nab: Drop unnecessary double inversion with FCF_CONF_COMP_SUPPORTED
            usage)
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Cc: Chad Dupuis <chad.dupuis@qlogic.com>
      Cc: Arun Easi <arun.easi@qlogic.com>
      Cc: Saurav Kashyap <saurav.kashyap@qlogic.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      c8292d1d
  22. 23 9月, 2012 1 次提交
  23. 21 8月, 2012 1 次提交
    • T
      workqueue: deprecate flush[_delayed]_work_sync() · 43829731
      Tejun Heo 提交于
      flush[_delayed]_work_sync() are now spurious.  Mark them deprecated
      and convert all users to flush[_delayed]_work().
      
      If you're cc'd and wondering what's going on: Now all workqueues are
      non-reentrant and the regular flushes guarantee that the work item is
      not pending or running on any CPU on return, so there's no reason to
      use the sync flushes at all and they're going away.
      
      This patch doesn't make any functional difference.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: Ian Campbell <ian.campbell@citrix.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Mattia Dongili <malattia@linux.it>
      Cc: Kent Yoder <key@linux.vnet.ibm.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Cc: Karsten Keil <isdn@linux-pingi.de>
      Cc: Bryan Wu <bryan.wu@canonical.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Alasdair Kergon <agk@redhat.com>
      Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
      Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: linux-wireless@vger.kernel.org
      Cc: Anton Vorontsov <cbou@mail.ru>
      Cc: Sangbeom Kim <sbkim73@samsung.com>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Eric Van Hensbergen <ericvh@gmail.com>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Steven Whitehouse <swhiteho@redhat.com>
      Cc: Petr Vandrovec <petr@vandrovec.name>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Avi Kivity <avi@redhat.com> 
      43829731
  24. 17 7月, 2012 2 次提交
  25. 07 7月, 2012 1 次提交
    • A
      qla2xxx: print the right array elements in qlt_async_event · 4f1d0f19
      Alan Cox 提交于
      Based upon Alan's patch from Coverity scan id 793583, these debug
      messages in qlt_async_event() should be starting from byte 0, which is
      always the Asynchronous Event Status Code from the parent switch statement.
      
      Also, rename reason_code -> login_code following the language used in
      2500 FW spec for Port Database Changed (0x8014) -> Port Database Changed
      Event Mailbox Register for mailbox[2].
      Signed-off-by: NAlan Cox <alan@linux.intel.com>
      Cc: Chad Dupuis <chad.dupuis@qlogic.com>
      Cc: Giridhar Malavali <giridhar.malavali@qlogic.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      4f1d0f19
  26. 13 6月, 2012 3 次提交