1. 25 Jun, 2014 1 commit
  2. 03 Jun, 2014 1 commit
    • Nicholas Bellinger's avatar
      qla2xxx: Convert to percpu_ida session tag pre-allocation · 51a07f84
      Nicholas Bellinger authored
      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: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      51a07f84
  3. 02 Jun, 2014 1 commit
  4. 19 May, 2014 1 commit
  5. 20 Feb, 2014 1 commit
    • Nicholas Bellinger's avatar
      qla2xxx: Check + fail when npiv_vports_inuse exists in shutdown · 3c231bda
      Nicholas Bellinger authored
      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: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      3c231bda
  6. 12 Feb, 2014 1 commit
  7. 18 Jan, 2014 1 commit
    • Nicholas Bellinger's avatar
      qla2xxx: Configure NPIV fc_vport via tcm_qla2xxx_npiv_make_lport · 49a47f2c
      Nicholas Bellinger authored
      This patch changes qla2xxx qlt_lport_register() code to accept
      target_lport_ptr + npiv_wwpn + npiv_wwnn parameters, and updates
      tcm_qla2xxx to use the new tcm_qla2xxx_lport_register_npiv_cb()
      callback for invoking fc_vport_create() from configfs context
      via tcm_qla2xxx_npiv_make_lport() code.
      
      In order for this to work, the qlt_lport_register() callback is
      now called without holding qla_tgt_mutex, as the fc_vport creation
      process will call qlt_vport_create() -> qlt_add_target(), which
      already expects to acquire it.
      
      It enforces /sys/kernel/config/target/qla2xxx_npiv/$NPIV_WWPN
      naming in the following format:
      
           $PHYSICAL_WWPN@$NPIV_WWPN:$NPIV_WWNN
      
      and assumes the $PHYSICAL_WWPN in question has already had been
      configured for target mode in non NPIV mode.
      
      Finally, it updates existing tcm_qla2xxx_lport_register_cb() logic
      to setup the non NPIV assignments that have now been moved out of
      qlt_lport_register() code.
      
      Cc: Sawan Chandak <sawan.chandak@qlogic.com>
      Cc: Quinn Tran <quinn.tran@qlogic.com>
      Cc: Saurav Kashyap <saurav.kashyap@qlogic.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      49a47f2c
  8. 25 Apr, 2013 1 commit
  9. 22 Feb, 2013 2 commits
  10. 26 Oct, 2012 1 commit
    • Roland Dreier's avatar
      qla2xxx: Update target lookup session tables when a target session changes · c8292d1d
      Roland Dreier authored
      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: default avatarRoland 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: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      c8292d1d
  11. 16 Jul, 2012 2 commits
  12. 12 Jun, 2012 1 commit
  13. 22 May, 2012 1 commit
    • Nicholas Bellinger's avatar
      [SCSI] qla2xxx: Add LLD target-mode infrastructure for >= 24xx series · 2d70c103
      Nicholas Bellinger authored
      Add LLD target mode for >= 24xx series HW.  This code was originally based on
      external qla2x00t module based on 8.02.01-k4, and has been refactored to
      push the bulk of code into mainline qla2xxx.ko LLD -> qla_target.c.
      
      The implementation uses internal workqueues for I/O context submission
      into tcm_qla2xxx code, and includes the struct qla_tgt_func_tmpl API for
      external interaction to allow qla2xxx LDD to function without direct
      target-core dependencies:
      
      It also enables qla_target.c usage within existing qla2xxx LLD code.
      This includes:
      
      *) Addition of target mode specific members to existing data
      structures in qla_def.h and struct qla_hw_data->tgt_ops using
      qla_target.h:struct qla_tgt_func_tmpl
      
      *) Addition of struct qla_tgt_func_tmpl and direct calls into
      qla_target.c logic w/ qlt_* prefixed functions.
      
      *) Addition of qla_iocb.c:qla2x00_req_pkt() for ring processing, and
      qla2x00_issue_marker() for handling request/response queue processing
      for target mode operation
      
      *) Addition of various qla_tgt_mode_enabled() logic checks in
      qla24xx_nvram_config(), qla2x00_initialize_adapter(), qla2x00_rff_id(),
      qla2x00_abort_isp(), qla24xx_modify_vp_config(), and
      qla2x00_vp_abort_isp().
      
      By default the new qlini_mode module parameter is setting initiator-mode
      to 'enabled' in order for 'modprobe qla2xxx' to continue to function as
      expected in initiator only mode.  Enabling target-mode operation will
      currently require a:
      
          modprobe qla2xxx qlini_mode="disabled"
      
      in order to explictly disabled initiator mode and allow target-mode
      to be enabled via tcm_qla2xxx configfs fabric callers.
      
      (nab: Convert to qlini_mode='enabled' by default in qla_target.c)
      (joern: Remove loop_id from qla_tgt_make_local_sess() arguments +
              Remove unused s_id + fix s_id endianness bug +
              simplify qla_tgt_abort_work)
      (gerard: fix section __exit mismatch in qla_tgt_exit)
      (arun: Capture ATIO queue during firmware dump + Send SCR in target mode +
             Target mode review comments)
      (roland: Don't create duplicate target sessions to address tearing down
               ACLs with IO in flight + Add missing call to qlt_fc_port_deleted
      	 call during qla2x00_schedule_rport_del timeout)
      Signed-off-by: default avatarNicholas A. Bellinger <nab@linux-iscsi.org>
      Signed-off-by: default avatarChad Dupuis <chad.dupuis@qlogic.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      2d70c103