1. 28 Mar, 2019 17 commits
    • Saurav Kashyap's avatar
      scsi: qedf: Check for link state before processing LL2 packets and send fipvlan retries · 76dbf4ff
      Saurav Kashyap authored
       - Check if link is UP before sending and processing any packets on wire.
      Signed-off-by: default avatarSaurav Kashyap <skashyap@marvell.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      76dbf4ff
    • Chad Dupuis's avatar
      scsi: qedf: Add missing fc_disc_init call after allocating lport · 0cbd0075
      Chad Dupuis authored
      When receiving an unsolicited frame we could crash on a list traversal in
      fc_rport_lookup while searching the rport which is associated with our
      lport.
      
      Initialize the lport's discovery node after allocating the lport in
      __qedf_probe().
      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>
      0cbd0075
    • Andrew Vasquez's avatar
      scsi: qedf: Correct the memory barriers in qedf_ring_doorbell · 90ccf757
      Andrew Vasquez authored
       - Correct memory barriers to make sure all cmnds are flushed.
      Signed-off-by: default avatarAndrew Vasquez <andrewv@marvell.com>
      Signed-off-by: default avatarSaurav Kashyap <skashyap@marvell.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      90ccf757
    • Chad Dupuis's avatar
      scsi: qedf: Use a separate completion for cleanup commands · 96b1765a
      Chad Dupuis authored
       - If a TMF and cleanup are issued at the same time they could cause a call
         trace if issued against the same xid as the io_req->tm_done completion
         is used for both.
      
       - Set and clear cleanup bit in cleanup routine.
      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>
      96b1765a
    • Saurav Kashyap's avatar
      scsi: qedf: Modify abort and tmf handler to handle edge condition and flush · 69ef2c69
      Saurav Kashyap authored
      An I/O can be in any state when flush is called, it can be in abort,
      waiting for abort, RRQ send and waiting or TMF send.
      
       - HZ can be different on different architecture, correctly set abort
         timeout value.
      
       - Flush can complete the I/Os prematurely, handle refcount for aborted
         I/Os and for which RRQ is pending.
      
       - Differentiate LUN/TARGET reset, as cleanup needs to be send to firmware
         accordingly.
      
       - Add flush mutex to sync cleanup call from abort and flush routine.
      
       - Clear abort/outstanding bit on timeout.
      Signed-off-by: default avatarShyam Sundar <shyam.sundar@marvell.com>
      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>
      69ef2c69
    • Shyam Sundar's avatar
      scsi: qedf: Modify flush routine to handle all I/Os and TMF · 5d5e5565
      Shyam Sundar authored
      The purpose of flush routine is to cleanup I/Os to the firmware and
      complete them to scsi middle layer. This routine is invoked before
      connection is uploaded because of rport going away.
      
       - Don't process any I/Os, aborts, TMFs coming when flush in progress.
      
       - Add flags to handle cleanup and release of I/Os because flush can
         prematurely complete I/Os.
      
       - Original command can get completed to driver when cleanup for same is
         posted to firmware, handle this condition.
      
       - Modify flush to handle I/Os in all the states like abort, TMF, RRQ and
         timeouts.
      Signed-off-by: default avatarShyam Sundar <ssundar@marvell.com>
      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>
      5d5e5565
    • Chad Dupuis's avatar
      scsi: qedf: Simplify s/g list mapping · 3e2c11b3
      Chad Dupuis authored
      When mapping the pages from a scatter/gather list from the SCSI layer we
      only need to follow these rules:
      
       - Max SGEs for each I/O request is 256
       - No size limit on each SGE
       - No need to split OS provided SGEs to 4K before sending to firmware.
       - Slow SGE is applicable only when:
         - There are > 8 SGEs and any middle SGE is less than a page size (4K)
      
      Make necessary changes so that driver follows these rules. Applicable only
      for Write requests (not for Read requests). No need to check SGE address
      alignment requirements (first, middle or last) before declaring slow SGE.
      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>
      3e2c11b3
    • Chad Dupuis's avatar
      scsi: qedf: Add missing return in qedf_post_io_req() in the fcport offload check · c5e06ba2
      Chad Dupuis authored
      Fixes the following crash as the return was missing from the check if an
      fcport is offloaded. If we hit this code we continue to try to post an
      invalid task which can lead to the crash:
      
      [30259.616411] [0000:61:00.3]:[qedf_post_io_req:989]:3: Session not offloaded yet.
      [30259.616413] [0000:61:00.3]:[qedf_upload_connection:1340]:3: Uploading connection port_id=490020.
      [30259.623769] BUG: unable to handle kernel NULL pointer dereference at 0000000000000198
      [30259.631645] IP: [<ffffffffc035b1ed>] qedf_init_task.isra.16+0x3d/0x450 [qedf]
      [30259.638816] PGD 0
      [30259.640841] Oops: 0000 [#1] SMP
      [30259.644098] Modules linked in: fuse 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 stp llc ebtable_filter ebtables devlink ip6table_filter ip6_tables iptable_filter vfat fat ib_isert iscsi_target_mod ib_srpt target_core_mod ib_srp scsi_transport_srp ib_ipoib ib_ucm ib_umad dm_service_time skx_edac intel_powerclamp coretemp intel_rapl iosf_mbi kvm_intel kvm irqbypass crc32_pclmul ghash_clmulni_intel aesni_intel rpcrdma sunrpc rdma_ucm ib_uverbs lrw gf128mul ib_iser rdma_cm iw_cm ib_cm libiscsi scsi_transport_iscsi qedr(OE) glue_helper ablk_helper cryptd ib_core dm_round_robin joydev pcspkr ipmi_ssif ses enclosure ipmi_si ipmi_devintf ipmi_msghandler mei_me
      [30259.715529]  mei sg hpilo hpwdt shpchp wmi lpc_ich acpi_power_meter dm_multipath ip_tables xfs libcrc32c sd_mod crc_t10dif crct10dif_generic uas usb_storage mgag200 qedf(OE) i2c_algo_bit libfcoe drm_kms_helper libfc syscopyarea sysfillrect scsi_transport_fc qede(OE) sysimgblt fb_sys_fops ptp ttm pps_core drm qed(OE) smartpqi crct10dif_pclmul crct10dif_common crc32c_intel i2c_core scsi_transport_sas scsi_tgt dm_mirror dm_region_hash dm_log dm_mod
      [30259.754237] CPU: 9 PID: 977 Comm: kdmwork-253:7 Kdump: loaded Tainted: G        W  OE  ------------   3.10.0-862.el7.x86_64 #1
      [30259.765664] Hardware name: HPE Synergy 480 Gen10/Synergy 480 Gen10 Compute Module, BIOS I42 04/04/2018
      [30259.775000] task: ffff8c801efd0000 ti: ffff8c801efd8000 task.ti: ffff8c801efd8000
      [30259.782505] RIP: 0010:[<ffffffffc035b1ed>]  [<ffffffffc035b1ed>] qedf_init_task.isra.16+0x3d/0x450 [qedf]
      [30259.792116] RSP: 0018:ffff8c801efdbbb0  EFLAGS: 00010046
      [30259.797444] RAX: 0000000000000000 RBX: ffffa7f1450948d8 RCX: ffff8c7fe5bc40c8
      [30259.804600] RDX: ffff8c800715b300 RSI: ffffa7f1450948d8 RDI: ffff8c80169c2480
      [30259.811755] RBP: ffff8c801efdbc30 R08: 00000000000000ae R09: ffff8c800a314540
      [30259.818911] R10: ffff8c7fe5bc40c8 R11: ffff8c801efdb8ae R12: 0000000000000000
      [30259.826068] R13: ffff8c800715b300 R14: ffff8c80169c2480 R15: ffff8c8005da28e0
      [30259.833223] FS:  0000000000000000(0000) GS:ffff8c803f840000(0000) knlGS:0000000000000000
      [30259.841338] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [30259.847100] CR2: 0000000000000198 CR3: 000000081242e000 CR4: 00000000007607e0
      [30259.854256] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [30259.861412] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [30259.868568] PKRU: 00000000
      [30259.871278] Call Trace:
      [30259.873737]  [<ffffffffc035c948>] qedf_post_io_req+0x148/0x680 [qedf]
      [30259.880201]  [<ffffffffc035d070>] qedf_queuecommand+0x1f0/0x240 [qedf]
      [30259.886749]  [<ffffffffa329b050>] scsi_dispatch_cmd+0xb0/0x240
      [30259.892600]  [<ffffffffa32a45bc>] scsi_request_fn+0x4cc/0x680
      [30259.898364]  [<ffffffffa3118ad9>] __blk_run_queue+0x39/0x50
      [30259.903954]  [<ffffffffa3114393>] __elv_add_request+0xd3/0x260
      [30259.909805]  [<ffffffffa311baf0>] blk_insert_cloned_request+0xf0/0x1b0
      [30259.916358]  [<ffffffffc010b622>] map_request+0x142/0x220 [dm_mod]
      [30259.922560]  [<ffffffffc010b716>] map_tio_request+0x16/0x40 [dm_mod]
      [30259.928932]  [<ffffffffa2ebb1f5>] kthread_worker_fn+0x85/0x180
      [30259.934782]  [<ffffffffa2ebb170>] ? kthread_stop+0xf0/0xf0
      [30259.940284]  [<ffffffffa2ebae31>] kthread+0xd1/0xe0
      [30259.945176]  [<ffffffffa2ebad60>] ? insert_kthread_work+0x40/0x40
      [30259.951290]  [<ffffffffa351f61d>] ret_from_fork_nospec_begin+0x7/0x21
      [30259.957750]  [<ffffffffa2ebad60>] ? insert_kthread_work+0x40/0x40
      [30259.963860] Code: fe 41 55 49 89 d5 41 54 53 48 89 f3 48 83 ec 58 4c 8b 67 28 4c 8b 4e 18 65 48 8b 04 25 28 00 00 00 48 89 45 d0 31 c0 4c 8b 7e 58 <49> 8b 84 24 98 01 00 00 48 8b 00 f6 80 31 01 00 00 10 0f 85 0b
      [30259.983372] RIP  [<ffffffffc035b1ed>] qedf_init_task.isra.16+0x3d/0x450 [qedf]
      [30259.990630]  RSP <ffff8c801efdbbb0>
      [30259.994127] CR2: 0000000000000198
      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>
      c5e06ba2
    • Chad Dupuis's avatar
      scsi: qedf: Correct xid range overlap between offloaded requests and libfc requests · 650ce64c
      Chad Dupuis authored
      There is currently an overlap where exchange IDs between what is used for
      offloaded commands and by libfc for ELS commands.  Correct this so that
      exchange ID range is:
      
      Offloaded requests: 0 to 0xfff
      libfc requests: 0x1000 to 0xfffe
      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>
      650ce64c
    • Chad Dupuis's avatar
      scsi: qedf: Do not retry ELS request if qedf_alloc_cmd fails · f1c43590
      Chad Dupuis authored
      If we cannot allocate an ELS middlepath request, simply fail instead of
      trying to delay and then reallocate.  This delay logic is causing soft
      lockup messages:
      
      NMI watchdog: BUG: soft lockup - CPU#2 stuck for 22s! [kworker/2:1:7639]
      Modules linked in: xt_CHECKSUM ipt_MASQUERADE nf_nat_masquerade_ipv4 tun devlink ip6t_rpfilter ipt_REJECT nf_reject_ipv4 ip6t_REJECT nf_reject_ipv6 xt_conntrack ip_set nfnetlink ebtable_nat ebtable_broute bridge stp llc ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_security ip6table_raw iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_mangle iptable_security iptable_raw ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter dm_service_time vfat fat rpcrdma sunrpc ib_isert iscsi_target_mod ib_iser libiscsi scsi_transport_iscsi ib_srpt target_core_mod ib_srp scsi_transport_srp ib_ipoib rdma_ucm ib_ucm ib_uverbs ib_umad rdma_cm ib_cm iw_cm sb_edac 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 iTCO_wdt iTCO_vendor_support qedr(OE) ib_core joydev ipmi_ssif pcspkr hpilo hpwdt sg ipmi_si ipmi_devintf ipmi_msghandler ioatdma shpchp lpc_ich wmi dca acpi_power_meter dm_multipath ip_tables xfs libcrc32c sd_mod crc_t10dif crct10dif_generic qedf(OE) libfcoe mgag200 libfc i2c_algo_bit drm_kms_helper scsi_transport_fc qede(OE) syscopyarea sysfillrect sysimgblt fb_sys_fops ttm qed(OE) drm crct10dif_pclmul e1000e crct10dif_common crc32c_intel scsi_tgt hpsa i2c_core ptp scsi_transport_sas pps_core dm_mirror dm_region_hash dm_log dm_mod
      CPU: 2 PID: 7639 Comm: kworker/2:1 Kdump: loaded Tainted: G           OEL ------------   3.10.0-861.el7.x86_64 #1
      Hardware name: HP ProLiant DL580 Gen9/ProLiant DL580 Gen9, BIOS U17 07/21/2016
      Workqueue: qedf_2_dpc qedf_handle_rrq [qedf]
      task: ffff959edd628fd0 ti: ffff959ed6f08000 task.ti: ffff959ed6f08000
      RIP: 0010:[<ffffffff8355913a>]  [<ffffffff8355913a>] delay_tsc+0x3a/0x60
      RSP: 0018:ffff959ed6f0bd30  EFLAGS: 00000246
      RAX: 000000008ef5f791 RBX: 5f646d635f666465 RCX: 0000025b8ededa2f
      RDX: 000000000000025b RSI: 0000000000000002 RDI: 0000000000217d1e
      RBP: ffff959ed6f0bd30 R08: ffffffffc079aae8 R09: 0000000000000200
      R10: ffffffffc07952c6 R11: 0000000000000000 R12: 6c6c615f66646571
      R13: ffff959ed6f0bcc8 R14: ffff959ed6f0bd08 R15: ffff959e00000028
      FS:  0000000000000000(0000) GS:ffff959eff480000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00007f4117fa1eb0 CR3: 0000002039e66000 CR4: 00000000003607e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      Call Trace:
      [<ffffffff8355907d>] __const_udelay+0x2d/0x30
      [<ffffffffc079444a>] qedf_initiate_els+0x13a/0x450 [qedf]
      [<ffffffffc0794210>] ? qedf_srr_compl+0x2a0/0x2a0 [qedf]
      [<ffffffffc0795337>] qedf_send_rrq+0x127/0x230 [qedf]
      [<ffffffffc078ed55>] qedf_handle_rrq+0x15/0x20 [qedf]
      [<ffffffff832b2dff>] process_one_work+0x17f/0x440
      [<ffffffff832b3ac6>] worker_thread+0x126/0x3c0
      [<ffffffff832b39a0>] ? manage_workers.isra.24+0x2a0/0x2a0
      [<ffffffff832bae31>] kthread+0xd1/0xe0
      [<ffffffff832bad60>] ? insert_kthread_work+0x40/0x40
      [<ffffffff8391f637>] ret_from_fork_nospec_begin+0x21/0x21
      [<ffffffff832bad60>] ? insert_kthread_work+0x40/0x40
      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>
      f1c43590
    • Stanley Chu's avatar
    • Nathan Chancellor's avatar
      scsi: qla2xxx: Simplify conditional check again · 46333ceb
      Nathan Chancellor authored
      Clang warns when it sees a logical not on the left side of a conditional
      statement because it thinks the logical not should be applied to the whole
      statement, not just the left side:
      
      drivers/scsi/qla2xxx/qla_nx.c:3703:7: warning: logical not is only
      applied to the left hand side of this comparison
      [-Wlogical-not-parentheses]
      
      This particular instance was already fixed by commit 0bfe7d3c ("scsi:
      qla2xxx: Simplify conditional check") upstream but it was reintroduced by
      commit 3695310e ("scsi: qla2xxx: Update flash read/write routine") in
      the 5.2/scsi-queue.
      
      Fixes: 3695310e ("scsi: qla2xxx: Update flash read/write routine")
      Link: https://github.com/ClangBuiltLinux/linux/issues/80Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      46333ceb
    • Bart Van Assche's avatar
      scsi: sd: Inline sd_probe_part2() · d16ece57
      Bart Van Assche authored
      Make sd_probe() easier to read by inlining sd_probe_part2(). This patch
      does not change any functionality.
      
      Cc: Lee Duncan <lduncan@suse.com>
      Cc: Hannes Reinecke <hare@suse.com>
      Cc: Luis Chamberlain <mcgrof@kernel.org>
      Cc: Johannes Thumshirn <jthumshirn@suse.de>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      d16ece57
    • Bart Van Assche's avatar
      scsi: sd: Rely on the driver core for asynchronous probing · 21e6ba3f
      Bart Van Assche authored
      As explained during the 2018 LSF/MM session about increasing SCSI disk
      probing concurrency, the problems with the current probing approach are as
      follows:
      
      - The driver core is unaware of asynchronous SCSI LUN probing.
        wait_for_device_probe() waits for all asynchronous probes except
        asynchronous SCSI disk probes.
      
      - There is unnecessary serialization between sd_probe() and sd_remove().
        This can lead to a deadlock.
      
      Hence this patch that modifies the sd driver such that it uses the driver
      core framework for asynchronous probing. The async domains and
      get_device()/put_device() pairs that became superfluous due to this change
      are removed.
      
      This patch does not affect the time needed for loading the scsi_debug
      kernel module with parameters delay=0 and max_luns=256.
      
      This patch depends on commit ef0ff683 ("driver core: Probe devices
      asynchronously instead of the driver") that went upstream in kernel version
      v5.1-rc1.
      
      Cc: Lee Duncan <lduncan@suse.com>
      Cc: Hannes Reinecke <hare@suse.com>
      Cc: Luis Chamberlain <mcgrof@kernel.org>
      Cc: Johannes Thumshirn <jthumshirn@suse.de>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      21e6ba3f
    • Colin Ian King's avatar
      scsi: mpt3sas: fix indentation issue · ea9006df
      Colin Ian King authored
      There are a couple of statements that are incorrectly indented, fix these.
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      ea9006df
    • Colin Ian King's avatar
      scsi: libcxgbi: remove uninitialized variable len · 83785733
      Colin Ian King authored
      The variable len is not being inintialized and the uninitialized value is
      being returned. However, this return path is never reached because the
      default case in the switch statement returns -ENOSYS.  Clean up the code by
      replacing the return -ENOSYS with a break for the default case and
      returning -ENOSYS at the end of the function.  This allows len to be
      removed.
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      83785733
    • tangwenji's avatar
      scsi: target: alua: fix the tg_pt_gps_count · 82129697
      tangwenji authored
      Reducing the count should be alua_tg_pt_gps_count instead of
      alua_tg_pt_gps_counter when free alua group.
      Signed-off-by: default avatartangwenji <tang.wenji@zte.com.cn>
      Reviewed-by: default avatarMike Christie <mchristi@redhat.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      82129697
  2. 26 Mar, 2019 7 commits
  3. 21 Mar, 2019 7 commits
  4. 19 Mar, 2019 9 commits