1. 27 Jun, 2019 11 commits
    • Lin Yi's avatar
      scsi: bnx2fc: fix bnx2fc_cmd refcount imbalance in send_srr · 7bfe5ae5
      Lin Yi authored
      If cb_arg alloc failed, we can't release the struct orig_io_req refcount
      before we take its refcount. As Saurav said, move the srr_err label down
      to avoid unnecessary refcount release and nullptr free.
      Signed-off-by: default avatarLin Yi <teroincn@163.com>
      Acked-by: default avatarSaurav Kashyap <skashyap@marvell.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      7bfe5ae5
    • Lin Yi's avatar
      scsi: bnx2fc: fix bnx2fc_cmd refcount imbalance in send_rec · 177709c0
      Lin Yi authored
      If cb_arg alloc failed, we can't release the struct orig_io_req refcount
      before we take its refcount. As Saurav said, move the rec_err label down
      to avoid unnecessary refcount release and nullptr free.
      Signed-off-by: default avatarLin Yi <teroincn@163.com>
      Acked-by: default avatarSaurav Kashyap <skashyap@marvell.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      177709c0
    • Saurav Kashyap's avatar
      scsi: bnx2fc: Update the driver version to 2.12.10 · 10b3ef22
      Saurav Kashyap authored
      Update the driver version to 2.12.10.
      Signed-off-by: default avatarSaurav Kashyap <skashyap@marvell.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      10b3ef22
    • Saurav Kashyap's avatar
      scsi: bnx2fc: Limit the IO size according to the FW capability · 3c97b569
      Saurav Kashyap authored
       - Reduce the sg_tablesize to 255.
      
       - Reduce the MAX BDs firmware can handle to 255.
      
       - Return IO to ML if BD goes more then 255 after split.
      
       - Correct the size of each BD split to 0xffff.
      Signed-off-by: default avatarSaurav Kashyap <skashyap@marvell.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      3c97b569
    • Saurav Kashyap's avatar
      scsi: bnx2fc: Do not allow both a cleanup completion and abort completion for the same request · 25ad7394
      Saurav Kashyap authored
      If firmware sends either cleanup or abort completion, it means other won't
      be sent. Clean out flags for other as well.
      Signed-off-by: default avatarSaurav Kashyap <skashyap@marvell.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      25ad7394
    • Saurav Kashyap's avatar
      scsi: bnx2fc: Separate out completion flags and variables for abort and cleanup · 0e0fcef9
      Saurav Kashyap authored
      Separate out abort and cleanup flag and completion, to have better
      understaning of what is getting processed.
      Signed-off-by: default avatarSaurav Kashyap <skashyap@marvell.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      0e0fcef9
    • Chad Dupuis's avatar
      scsi: bnx2fc: Only put reference to io_req in bnx2fc_abts_cleanup if cleanup times out · a92ac6ee
      Chad Dupuis authored
      In certain tests where the SCSI error handler issues an abort that is
      already outstanding, we will cleanup the command so that the SCSI error
      handler can proceed.  In some of these cases we were seeing a command
      mismatch:
      
       kernel: scsi host2: bnx2fc: xid:0x42b eh_abort - refcnt = 2
       kernel: bnx2fc: eh_abort: io_req (xid = 0x42b) already in abts processing
       kernel: scsi host2: bnx2fc: xid:0x42b Entered bnx2fc_initiate_cleanup
       kernel: scsi host2: bnx2fc: xid:0x42b CLEANUP io_req xid = 0x80b
       kernel: scsi host2: bnx2fc: xid:0x80b cq_compl- cleanup resp rcvd
       kernel: scsi host2: bnx2fc: xid:0x42b complete - rx_state = 9
       kernel: scsi host2: bnx2fc: xid:0x42b Entered process_cleanup_compl refcnt = 2, cmd_type = 1
       kernel: scsi host2: bnx2fc: xid:0x42b scsi_done. err_code = 0x7
       kernel: scsi host2: bnx2fc: xid:0x42b sc=ffff8807f93dfb80, result=0x7, retries=0, allowed=5
       kernel: ------------[ cut here ]------------
       kernel: WARNING: at /root/rpmbuild/BUILD/netxtreme2-7.14.43/obj/default/bnx2fc-2.12.1/driver/bnx2fc_io.c:1347 bnx2fc_eh_abort+0x56f/0x680 [bnx2fc]()
       kernel: xid=0x42b refcount=-1
       kernel: Modules linked in:
       kernel: nls_utf8 isofs sr_mod cdrom tcp_lp dm_round_robin xt_CHECKSUM iptable_mangle ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat nf_nat_ipv4 nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack ipt_REJECT nf_reject_ipv4 tun bridge ebtable_filter ebtables fuse ip6table_filter ip6_tables iptable_filter bnx2fc(OE) cnic(OE) uio fcoe libfcoe 8021q libfc garp mrp scsi_transport_fc stp llc scsi_tgt vfat fat dm_service_time intel_powerclamp coretemp intel_rapl iosf_mbi kvm_intel kvm irqbypass crc32_pclmul ghash_clmulni_intel aesni_intel lrw gf128mul glue_helper ablk_helper cryptd ses enclosure ipmi_ssif i2c_core hpilo hpwdt wmi sg ipmi_devintf pcspkr ipmi_si ipmi_msghandler shpchp acpi_power_meter dm_multipath nfsd auth_rpcgss nfs_acl lockd grace sunrpc ip_tables xfs sd_mod crc_t10dif
       kernel: crct10dif_generic bnx2x(OE) crct10dif_pclmul crct10dif_common crc32c_intel mdio ptp pps_core libcrc32c smartpqi scsi_transport_sas fjes uas usb_storage dm_mirror dm_region_hash dm_log dm_mod
       kernel: CPU: 9 PID: 2012 Comm: scsi_eh_2 Tainted: G        W  OE  ------------   3.10.0-514.el7.x86_64 #1
       kernel: Hardware name: HPE Synergy 480 Gen10/Synergy 480 Gen10 Compute Module, BIOS I42 03/21/2018
       kernel: ffff8807f25a3d98 0000000015e7fa0c ffff8807f25a3d50 ffffffff81685eac
       kernel: ffff8807f25a3d88 ffffffff81085820 ffff8807f8e39000 ffff880801ff7468
       kernel: ffff880801ff7610 0000000000002002 ffff8807f8e39014 ffff8807f25a3df0
       kernel: Call Trace:
       kernel: [<ffffffff81685eac>] dump_stack+0x19/0x1b
       kernel: [<ffffffff81085820>] warn_slowpath_common+0x70/0xb0
       kernel: [<ffffffff810858bc>] warn_slowpath_fmt+0x5c/0x80
       kernel: [<ffffffff8168d842>] ? _raw_spin_lock_bh+0x12/0x50
       kernel: [<ffffffffa0549e6f>] bnx2fc_eh_abort+0x56f/0x680 [bnx2fc]
       kernel: [<ffffffff814570af>] scsi_error_handler+0x59f/0x8b0
       kernel: [<ffffffff81456b10>] ? scsi_eh_get_sense+0x250/0x250
       kernel: [<ffffffff810b052f>] kthread+0xcf/0xe0
       kernel: [<ffffffff810b0460>] ? kthread_create_on_node+0x140/0x140
       kernel: [<ffffffff81696418>] ret_from_fork+0x58/0x90
       kernel: [<ffffffff810b0460>] ? kthread_create_on_node+0x140/0x140
       kernel: ---[ end trace 42deb88f2032b111 ]---
      
      The reason that there was a mismatch is that the SCSI command is actual
      returned from the cleanup handler.  In previous testing, the type of
      cleanup notification we'd get from the CQE did not trigger the code that
      returned the SCSI command.  To overcome the previous behavior we would put
      a reference in bnx2fc_abts_cleanup() to account for the SCSI command.
      However, in cases where the SCSI command is actually off, we end up with an
      extra put.
      
      The fix for this is to only take the extra put in bnx2fc_abts_cleanup if
      the completion for the cleanup times out.
      Signed-off-by: default avatarChad Dupuis <cdupuis@marvell.com>
      Signed-off-by: default avatarSaurav Kashyap <skashyap@marvell.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      a92ac6ee
    • Chad Dupuis's avatar
      scsi: bnx2fc: Redo setting source FCoE MAC · 4adb451c
      Chad Dupuis authored
      For bnx2fc, the source FCoE MAC is stored in the fcoe_port struct in the
      data_src_mac field.  Currently this is set in fcoe_ctlr_recv_flogi which
      ends up setting it by simply using fc_fcoe_set_mac() which only uses the
      default FCF-MAC.  We still want to store the source FCoE MAC in
      port->data_src_mac but we want to snoop the FLOGI response payload so as to
      set it in the following method:
      
      1. If a granted_mac is found, use that.
      
      2. If not granted_mac is there but there is a FCF-MAP from the FCF then
         create the MAC from the FCF-MAP and the destination ID from the frame.
      
      3. If there is no FCF-MAP the use the spec. default FCF-MAP and the
         destination ID from the frame.
      Signed-off-by: default avatarChad Dupuis <cdupuis@marvell.com>
      Signed-off-by: default avatarSaurav Kashyap <skashyap@marvell.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      4adb451c
    • Adrian Hunter's avatar
      scsi: ufshdc-pci: Add Intel PCI IDs for EHL · 8c09d752
      Adrian Hunter authored
      Add more Intel PCI IDs.
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      8c09d752
    • Bean Huo's avatar
      scsi: ufs-bsg: complete ufs-bsg job only if no error · b13a3539
      Bean Huo authored
      In the case of UPIU/DME request execution failed in UFS device,
      ufs_bsg_request() will complete the failed bsg job by calling
      bsg_job_done(). Meanwhile, it returns this error status to blk-mq layer,
      then triggers blk-mq completing this request again, this will cause the
      following panic.
      
      Call trace:
      ll_sc___cmpxchg_case_acq_32+0x4/0x20
      complete+0x28/0x70
      blk_end_sync_rq+0x24/0x30
      blk_mq_end_request+0xb8/0x118
      bsg_job_put+0x4c/0x58
      bsg_complete+0x20/0x30
      blk_done_softirq+0xb4/0xe8
      do_softirq+0x154/0x3f0
      run_ksoftirqd+0x4c/0x68
      smpboot_thread_fn+0x22c/0x268
      kthread+0x130/0x138
      ret_from_fork+0x10/0x1c
      Code: f84107fe d65f03c0 d503201f f9800011 (885ffc10)
      ---[ end trace d92825bff6326e66 ]---
      Kernel panic - not syncing: Fatal exception in interrupt
      
      This patch is to fix this issue. The solution is to complete the ufs-bsg
      job only if no error happened.
      
      [mkp: commit description tweak]
      
      Fixes: df032bf2 (scsi: ufs: Add a bsg endpoint that supports UPIUs)
      Signed-off-by: default avatarBean Huo <beanhuo@micron.com>
      Reviewed-by: default avatarAvri Altman <Avri.Altman@wdc.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      b13a3539
    • Bean Huo's avatar
      scsi: ufs-bsg: fix typo in ufs_bsg_request · c870d65f
      Bean Huo authored
      Correct dev_dbg to dev_err, so as to print out the error information in
      case of DME command failed.
      Signed-off-by: default avatarBean Huo <beanhuo@micron.com>
      Reviewed-by: default avatarAvri Altman <Avri.Altman@wdc.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      c870d65f
  2. 20 Jun, 2019 21 commits
  3. 18 Jun, 2019 8 commits
    • Suganath Prabu S's avatar
      scsi: mpt3sas: Update driver version to 29.100.00.00 · 895d8860
      Suganath Prabu S authored
      Update driver version from 28.100.00.00 to 29.100.00.00
      This is equivalent to Phase 10 OOB driver.
      Signed-off-by: default avatarSuganath Prabu S <suganath-prabu.subramani@broadcom.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      895d8860
    • Suganath Prabu S's avatar
      scsi: mpt3sas: Introduce perf_mode module parameter · ca7e1e9d
      Suganath Prabu S authored
      1. Introduce module parameter perf_mode for only Aero/Sea generation HBAs.
      
      2. Update IOC page1 fields according to performance mode.
      
      Below are the performance modes that can be enabled with module parameter
      perf_mode:
      
       0: Balanced - Few high iops reply queues will be enabled.  Interrupt
          coalescing will be enabled only for these high iops reply descriptor
          queues.
      
       1: Iops - Interrupt coalescing will be enabled on all reply queues.
          Coalescing timeout is set to 0x20.This is default value for Aero.
      
       2: Latency - Interrupt coalescing will be enabled on all reply queues.
          Coalescing timeout is set to 0xA.  This is a legacy behavior similar to
          Ventura & Invader HBA series.
      
      Default perf mode set by driver will be balanced mode if the following
      conditions are met:
      
       - CPU vendor = Intel;
       - Aero controller working in 16GT/s pcie speed
      
      Performance mode will be set to latency mode for all other cases.
      
      4k Random Read IO performance numbers on 24 SAS SSD drives for above three
      permormance modes. Performance data is from Intel Skylake and HGST SS300
      (drive model SDLL1DLR400GCCA1).
      
      IOPs:
       -----------------------------------------------------------------------
        |perf_mode    | qd = 1 | qd = 64 |   note                             |
        |-------------|--------|---------|-------------------------------------
        |balanced     |  259K  |  3061k  | Provides max performance numbers   |
        |             |        |         | both on lower QD workload &        |
        |             |        |         | also on higher QD workload         |
        |-------------|--------|---------|-------------------------------------
        |iops         |  220K  |  3100k  | Provides max performance numbers   |
        |             |        |         | only on higher QD workload.        |
        |-------------|--------|---------|-------------------------------------
        |latency      |  246k  |  2226k  | Provides good performance numbers  |
        |             |        |         | only on lower QD worklaod.         |
        -----------------------------------------------------------------------
      
      Avarage Latency:
        -----------------------------------------------------
        |perf_mode    |  qd = 1      |    qd = 64           |
        |-------------|--------------|----------------------|
        |balanced     |  92.05 usec  |    501.12 usec       |
        |-------------|--------------|----------------------|
        |iops         |  108.40 usec |    498.10 usec       |
        |-------------|--------------|----------------------|
        |latency      |  97.10 usec  |    689.26 usec       |
        -----------------------------------------------------
      Signed-off-by: default avatarSuganath Prabu S <suganath-prabu.subramani@broadcom.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      ca7e1e9d
    • Suganath Prabu S's avatar
      scsi: mpt3sas: Enable interrupt coalescing on high iops · 2426f209
      Suganath Prabu S authored
      Enable interrupt coalescing only on high iops queues.
      
      In ioc config page 1, offset 0x14 (ProductSpecific field) is used to
      determine interrupt coalescing enabled/disabled on per reply descriptor
      post queue group(8) basis.  If 31st bit is zero, then interrupt coalescing
      is enabled for all reply descriptor post queues. If 31st bit is set to one,
      then user can enable/disable interrupt coalescing on per reply descriptor
      post queue group(8) basis. So to enable interrupt coalescing only on first
      reply descriptor post queue group (i.e. on high iops queues), set bit 0 and
      31.
      
      This configuration should reset during driver unload or shutdown to the
      default settings. For this, the driver takes copy of default ioc page 1 and
      copies back the default or unmodified ioc page1 during unload and
      shutdown. This means that on next driver load (e.g. if older version driver
      is loaded by user), current modified changes on ioc page1 won't take
      effect.
      Signed-off-by: default avatarSuganath Prabu S <suganath-prabu.subramani@broadcom.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      2426f209
    • Suganath Prabu S's avatar
      scsi: mpt3sas: Affinity high iops queues IRQs to local node · 728bbc6c
      Suganath Prabu S authored
      High iops queues are mapped to non-managed irqs. Set affinity of
      non-managed irqs to local numa node.  Low latency queues are mapped to
      managed irqs.
      
      Driver reserves some reply queues for max iops (through
      pci_alloc_irq_vectors_affinity and .pre_vectors interface). The rest of
      queues are for low latency.
      
      Based on io workload in io submission path, driver will decide which group
      of reply queues (either high iops queues or low latency queues) to be
      used. High iops queues will be mapped to local numa node of controller and
      low latency queues will be mapped to cpus across numa nodes. In general,
      high iops and low latency queues should fit into 128 reply queues
      which is the max number of reply queues supported by Aero/Sea.
      Signed-off-by: default avatarSuganath Prabu S <suganath-prabu.subramani@broadcom.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      728bbc6c
    • Suganath Prabu S's avatar
      scsi: mpt3sas: save and use MSI-X index for posting RD · 998c3001
      Suganath Prabu S authored
      In the IO submission path _base_get_msix_index is called twice. Initially
      while getting the smid and subsequently while posting the request
      descriptor (RD).
      
      Refactor code to query msix index only while posting the request
      descriptor. Save determined msix index in msix_io field.
      Signed-off-by: default avatarSuganath Prabu S <suganath-prabu.subramani@broadcom.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      998c3001
    • Suganath Prabu S's avatar
      scsi: mpt3sas: Use high iops queues under some circumstances · 5dd48a55
      Suganath Prabu S authored
      The driver will use round-robin method for io submission in batches within
      the high iops queues when the number of in-flight ios on the target device
      is larger than 8. Otherwise the driver will use low latency reply queues.
      Signed-off-by: default avatarSuganath Prabu S <suganath-prabu.subramani@broadcom.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      5dd48a55
    • Suganath Prabu S's avatar
      scsi: mpt3sas: change _base_get_msix_index prototype · 02136516
      Suganath Prabu S authored
      Code refactoring.
      
      In function _base_get_msix_index, add scmd as second argument. This change
      is made in preparation for the next patch where we introduce a new function
      to get the MSI-X index for high iops queues.
      Signed-off-by: default avatarSuganath Prabu S <suganath-prabu.subramani@broadcom.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      02136516
    • Suganath Prabu S's avatar
      scsi: mpt3sas: Add flag high_iops_queues · 18fd3d8c
      Suganath Prabu S authored
      Aero controllers support balanced performance mode through the ability to
      configure queues with different properties.
      
      Reply queues with interrupt coalescing enabled are called "high iops reply
      queues" and reply queues with interrupt coalescing disabled are called "low
      latency reply queues".
      
      The driver configures a combination of high iops and low latency reply
      queues if:
      
       - HBA is an AERO controller;
      
       - MSI-X vectors supported by the HBA is 128;
      
       - Total CPU count in the system more than high iops queue count;
      
       - Driver is loaded with default max_msix_vectors module parameter; and
      
       - System booted in non-kdump mode.
      Signed-off-by: default avatarSuganath Prabu S <suganath-prabu.subramani@broadcom.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      18fd3d8c