summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsiLinus Torvalds2017-07-06164-4384/+11447
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull SCSI updates from James Bottomley: "This is mostly updates of the usual suspects: lpfc, qla2xxx, bnx2fc, qedf, hpsa, hisi_sas, smartpqi, cxlflash, aacraid, csiostor along with a host of minor and miscellaneous changes" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (276 commits) qla2xxx: Fix NVMe entry_type for iocb packet on BE system scsi: qla2xxx: avoid unused-function warning scsi: snic: fix a couple of spelling mistakes/typos scsi: qla2xxx: fix a bunch of typos and spelling mistakes scsi: lpfc: don't double count abort errors scsi: lpfc: spin_lock_irq() is not nestable scsi: hisi_sas: optimise DMA slot memory scsi: ibmvfc: constify dev_pm_ops structures. scsi: ibmvscsi: constify dev_pm_ops structures. scsi: cxlflash: Update debug prints in reset handlers scsi: cxlflash: Update send_tmf() parameters scsi: cxlflash: Avoid double free of character device scsi: Add STARGET_CREATED_REMOVE state to scsi_target_state scsi: ses: do not add a device to an enclosure if enclosure_add_links() fails. scsi: ufs: flush eh_work when eh_work scheduled. scsi: qla2xxx: Protect access to qpair members with qpair->qp_lock scsi: sun_esp: fix device reference leaks scsi: fnic: changing queue command to return result DID_IMM_RETRY when rport is init scsi: fnic: correct speed display and add support for 25,40 and 100G scsi: fnic: added timestamp reporting in fnic debug stats ...
| * qla2xxx: Fix NVMe entry_type for iocb packet on BE systemHimanshu Madhani2017-07-011-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes incorrect assignment for entry_type field for Continuation Type iocb packet on BE system. This was caught by -Woverflow warning on BE system compilation. For Continuation Type iocb driver needs to write complete 32 bit value to initialize other field members in structure to 0. Following warning is seen on BE system compile: drivers/scsi/qla2xxx/qla_nvme.c: In function 'qla2x00_start_nvme_mq': include/uapi/linux/byteorder/big_endian.h:32:26: warning: large integer implicitly truncated to unsigned type [-Woverflow] #define __cpu_to_le32(x) ((__force __le32)__swab32((x))) [mkp: fixed typo] Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: qla2xxx: avoid unused-function warningArnd Bergmann2017-07-012-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When NVMe support is disabled, we get a couple of harmless warnings: drivers/scsi/qla2xxx/qla_nvme.c:667:13: error: 'qla_nvme_unregister_remote_port' defined but not used [-Werror=unused-function] drivers/scsi/qla2xxx/qla_nvme.c:634:13: error: 'qla_nvme_abort_all' defined but not used [-Werror=unused-function] drivers/scsi/qla2xxx/qla_nvme.c:604:12: error: 'qla_nvme_wait_on_rport_del' defined but not used [-Werror=unused-function] This replaces the preprocessor checks in the code with equivalent compiler conditionals, which lets gcc drop the unused functions without warning, and is nicer to read. Fixes: e84067d74301 ("scsi: qla2xxx: Add FC-NVMe F/W initialization and transport registration") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Himanshu Madhani <himanshu.madhani@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: snic: fix a couple of spelling mistakes/typosColin Ian King2017-07-012-3/+3
| | | | | | | | | | | | | | | | | | | | Trivial fix to spelling mistakes/typos: "requrest_irq" -> "request_irq" "Firmwqre" -> "Firmware" Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: qla2xxx: fix a bunch of typos and spelling mistakesColin Ian King2017-07-018-11/+10Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the following typos/spelling mistakes: "attribure" -> "attribute" "suppored" -> "supported" "Symobilic" -> "Symbolic" "iteself" -> "itself" "reqeust" -> "request" "nvme_wait_on_comand" -> "nvme_wait_on_command" "bount" -> "bound" "captrue_mask" -> "capture_mask" "tempelate" -> "template" ..and also unwrap a line to fix a checkpatch warning. Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Himanshu Madhani <himanshu.madhani@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: lpfc: don't double count abort errorsDan Carpenter2017-07-011-1/+0Star
| | | | | | | | | | | | | | | | | | | | | | If lpfc_nvmet_unsol_fcp_issue_abort() fails then we accidentally increment "tgtp->xmt_abort_rsp_error" and then two lines later we increment it a second time. Fixes: 547077a44b3b ("scsi: lpfc: Adding additional stats counters for nvme.") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: James Smart <james.smart@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: lpfc: spin_lock_irq() is not nestableDan Carpenter2017-07-011-10/+10
| | | | | | | | | | | | | | | | | | | | | | We're calling spin_lock_irq() multiple times, the problem is that on the first spin_unlock_irq() then we will re-enable IRQs and we don't want that. Fixes: 966bb5b71196 ("scsi: lpfc: Break up IO ctx list into a separate get and put list") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: James Smart <james.smart@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: hisi_sas: optimise DMA slot memoryXiaofei Tan2017-07-015-122/+104Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we allocate 3 sets of DMA memories from separate pools for each slot. This is inefficient in terms of memory usage (buffers are less than 1 page in size, so we lose due to alignment), and also time spent in doing 3 allocations + de-allocations per slot, instead of 1. To optimise, combine the 3 DMA buffers into a single buffer from a single pool. Signed-off-by: Xiaofei Tan <tanxiaofei@huawei.com> Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: ibmvfc: constify dev_pm_ops structures.Arvind Yadav2017-07-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dev_pm_ops are not supposed to change at runtime. All functions working with dev_pm_ops provided by <linux/device.h> work with const dev_pm_ops. So mark the non-const structs as const. File size before: text data bss dec hex filename 41937 1296 20 43253 a8f5 drivers/scsi/ibmvscsi/ibmvfc.o File size After adding 'const': text data bss dec hex filename 42129 1104 20 43253 a8f5 drivers/scsi/ibmvscsi/ibmvfc.o Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Acked-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: ibmvscsi: constify dev_pm_ops structures.Arvind Yadav2017-07-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dev_pm_ops are not supposed to change at runtime. All functions working with dev_pm_ops provided by <linux/device.h> work with const dev_pm_ops. So mark the non-const structs as const. File size before: text data bss dec hex filename 17956 1456 8 19420 4bdc drivers/scsi/ibmvscsi/ibmvscsi.o File size After adding 'const': text data bss dec hex filename 18164 1264 8 19436 4bec drivers/scsi/ibmvscsi/ibmvscsi.o Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Acked-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: cxlflash: Update debug prints in reset handlersMatthew R. Ochs2017-07-011-15/+3Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The device and host reset handler contain debug prints to help identify the entities being reset. Today these reset handlers are based on a SCSI EH design that uses a SCSI command reference as a means of identifying the target entity. As such, the debug trace includes the SCSI command pointer and associated CDB. This is not necessary as the SCSI command is simply the messenger in these scenarios. Refactor the debug prints in the host and reset handlers to only present information that is applicable given the function scope. Signed-off-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: cxlflash: Update send_tmf() parametersMatthew R. Ochs2017-07-011-14/+13Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current send_tmf() implementation is based on the caller providing a SCSI command reference. In reality all that is needed is a SCSI device reference as the routine uses a private command. Refactor send_tmf() to pass the private adapter configuration reference and a SCSI device reference. As a nice side effect, this will ease the burden of converting caller routines to be based solely off of a SCSI device reference. Signed-off-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: cxlflash: Avoid double free of character deviceMatthew R. Ochs2017-07-011-1/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The device_unregister() service used when cleaning up the character device is already responsible for the internal state associated with the device upon successful creation. As the cxlflash driver does not obtain a second reference to the character device, the explicit call to put_device() is not required and can lead to an inconsistent sysfs among other issues as the reference is no longer valid after the first put_device() is performed. Remove the unnecessary put_device() to remedy this issue. Fixes: a834a36b57d9 ("scsi: cxlflash: Create character device to provide host management interface") Signed-off-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: Add STARGET_CREATED_REMOVE state to scsi_target_stateEwan D. Milne2017-07-013-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The addition of the STARGET_REMOVE state had the side effect of introducing a race condition that can cause a crash. scsi_target_reap_ref_release() checks the starget->state to see if it still in STARGET_CREATED, and if so, skips calling transport_remove_device() and device_del(), because the starget->state is only set to STARGET_RUNNING after scsi_target_add() has called device_add() and transport_add_device(). However, if an rport loss occurs while a target is being scanned, it can happen that scsi_remove_target() will be called while the starget is still in the STARGET_CREATED state. In this case, the starget->state will be set to STARGET_REMOVE, and as a result, scsi_target_reap_ref_release() will take the wrong path. The end result is a panic: [ 1255.356653] Oops: 0000 [#1] SMP [ 1255.360154] Modules linked in: x86_pkg_temp_thermal kvm_intel kvm irqbypass crc32c_intel ghash_clmulni_i [ 1255.393234] CPU: 5 PID: 149 Comm: kworker/u96:4 Tainted: G W 4.11.0+ #8 [ 1255.401879] Hardware name: Dell Inc. PowerEdge R320/08VT7V, BIOS 2.0.22 11/19/2013 [ 1255.410327] Workqueue: scsi_wq_6 fc_scsi_scan_rport [scsi_transport_fc] [ 1255.417720] task: ffff88060ca8c8c0 task.stack: ffffc900048a8000 [ 1255.424331] RIP: 0010:kernfs_find_ns+0x13/0xc0 [ 1255.429287] RSP: 0018:ffffc900048abbf0 EFLAGS: 00010246 [ 1255.435123] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 [ 1255.443083] RDX: 0000000000000000 RSI: ffffffff8188d659 RDI: 0000000000000000 [ 1255.451043] RBP: ffffc900048abc10 R08: 0000000000000000 R09: 0000012433fe0025 [ 1255.459005] R10: 0000000025e5a4b5 R11: 0000000025e5a4b5 R12: ffffffff8188d659 [ 1255.466972] R13: 0000000000000000 R14: ffff8805f55e5088 R15: 0000000000000000 [ 1255.474931] FS: 0000000000000000(0000) GS:ffff880616b40000(0000) knlGS:0000000000000000 [ 1255.483959] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1255.490370] CR2: 0000000000000068 CR3: 0000000001c09000 CR4: 00000000000406e0 [ 1255.498332] Call Trace: [ 1255.501058] kernfs_find_and_get_ns+0x31/0x60 [ 1255.505916] sysfs_unmerge_group+0x1d/0x60 [ 1255.510498] dpm_sysfs_remove+0x22/0x60 [ 1255.514783] device_del+0xf4/0x2e0 [ 1255.518577] ? device_remove_file+0x19/0x20 [ 1255.523241] attribute_container_class_device_del+0x1a/0x20 [ 1255.529457] transport_remove_classdev+0x4e/0x60 [ 1255.534607] ? transport_add_class_device+0x40/0x40 [ 1255.540046] attribute_container_device_trigger+0xb0/0xc0 [ 1255.546069] transport_remove_device+0x15/0x20 [ 1255.551025] scsi_target_reap_ref_release+0x25/0x40 [ 1255.556467] scsi_target_reap+0x2e/0x40 [ 1255.560744] __scsi_scan_target+0xaa/0x5b0 [ 1255.565312] scsi_scan_target+0xec/0x100 [ 1255.569689] fc_scsi_scan_rport+0xb1/0xc0 [scsi_transport_fc] [ 1255.576099] process_one_work+0x14b/0x390 [ 1255.580569] worker_thread+0x4b/0x390 [ 1255.584651] kthread+0x109/0x140 [ 1255.588251] ? rescuer_thread+0x330/0x330 [ 1255.592730] ? kthread_park+0x60/0x60 [ 1255.596815] ret_from_fork+0x29/0x40 [ 1255.600801] Code: 24 08 48 83 42 40 01 5b 41 5c 5d c3 66 66 66 2e 0f 1f 84 00 00 00 00 00 66 66 66 66 90 [ 1255.621876] RIP: kernfs_find_ns+0x13/0xc0 RSP: ffffc900048abbf0 [ 1255.628479] CR2: 0000000000000068 [ 1255.632756] ---[ end trace 34a69ba0477d036f ]--- Fix this by adding another scsi_target state STARGET_CREATED_REMOVE to distinguish this case. Fixes: f05795d3d771 ("scsi: Add intermediate STARGET_REMOVE state to scsi_target_state") Reported-by: David Jeffery <djeffery@redhat.com> Signed-off-by: Ewan D. Milne <emilne@redhat.com> Cc: <stable@vger.kernel.org> Reviewed-by: Laurence Oberman <loberman@redhat.com> Tested-by: Laurence Oberman <loberman@redhat.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: ses: do not add a device to an enclosure if enclosure_add_links() fails.Maurizio Lombardi2017-07-011-4/+10
| | | | | | | | | | | | | | | | | | | | | | The enclosure_add_device() function should fail if it can't create the relevant sysfs links. Cc: <stable@vger.kernel.org> Signed-off-by: Maurizio Lombardi <mlombard@redhat.com> Tested-by: Douglas Miller <dougmill@linux.vnet.ibm.com> Acked-by: James Bottomley <jejb@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: ufs: flush eh_work when eh_work scheduled.Zang Leigang2017-07-011-1/+2
| | | | | | | | | | | | | | | | Forget a condition: eh_work scheduled but do not start to work. Signed-off-by: Zang Leigang <zangleigang@hisilicon.com> Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: qla2xxx: Protect access to qpair members with qpair->qp_lockJohannes Thumshirn2017-07-011-10/+13
| | | | | | | | | | | | | | | | | | | | | | In qla2xx_start_scsi_mq() and qla2xx_dif_start_scsi_mq() we grab the qpair->qp_lock but do access members of the qpair before having the lock. Re-order the locking sequence to have all read and write access to qpair members under the qpair->qp_lock. Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Acked-by: Himanshu Madhani <himanshu.madhani@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: sun_esp: fix device reference leaksJohan Hovold2017-06-281-1/+8
| | | | | | | | | | | | | | | | | | Make sure to drop the reference to the dma device taken by of_find_device_by_node() on probe errors and on driver unbind. Fixes: 334ae614772b ("sparc: Kill SBUS DVMA layer.") Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: fnic: changing queue command to return result DID_IMM_RETRY when rport ↵Satish Kharat2017-06-281-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | is init Currently the queue command returns DID_NO_CONNECT anytime the rport is not in RPORT_ST_READY state. Changing it to return DID_NO_CONNECT only when the rport is in RPORT_ST_DELETE state. When the rport is in one of the init states retruning DID_IMM_RETRY. Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Signed-off-by: Satish Kharat <satishkh@cisco.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: fnic: correct speed display and add support for 25,40 and 100GSatish Kharat2017-06-283-2/+45
| | | | | | | | | | | | | | | | | | Setting speed based on the vinc device parameter read during linkup. Also adding support to display 25,40 and 100G Signed-off-by: Satish Kharat <satishkh@cisco.com> Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: fnic: added timestamp reporting in fnic debug statsSatish Kharat2017-06-283-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | Added the timestamps for 1. current timestamp 2. last fnic stats read timestamp 3. last fnic stats reset timestamp and the deltas since last stats read and last reset in fnic stats. fnic stats uses debugfs Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Signed-off-by: Satish Kharat <satishkh@cisco.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: fnic: Zero io_cmpl_skip on fw reset completionSatish Kharat2017-06-281-0/+1
| | | | | | | | | | | | | | | | | | | | io_cmpl_skip keep track of number of completions to skip when stats are reset. If a fw_reset happens immediately after stats reset it could put it out of sync so need to reset io_cmpl_skip when fw reset is completed. Signed-off-by: Satish Kharat <satishkh@cisco.com> Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: bnx2fc: Update version number to 2.11.8.Chad Dupuis2017-06-281-1/+1
| | | | | | | | | | Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: bnx2fc: Make rport_terminate_io callback a NOOP.Chad Dupuis2017-06-281-1/+6
| | | | | | | | | | | | | | | | Do not call the stock libfc terminate rport i/o handler so we won't reset the libfc exchange manager and kill any outstanding discovery requests. Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: bnx2fc: If IO is still in cleanup then do not return to SCSI layer.Chad Dupuis2017-06-281-8/+3Star
| | | | | | | | | | | | | | | | | | | | | | | | In eh_abort, driver is calling scsi->done() for a IO for which cleanup is pending. As the IO is outstanding with the firmware, it may do DMA associated with the IO. This may lead to heap corruption. Do not complete the IO for which cleanup is still pending. Return failure from eh_abort and let the SCSI-ml retry the IO. Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: bnx2fc: Adjust bnx2fc_npiv_create_vports for WWNNs from NVRAM that are ↵Chad Dupuis2017-06-281-1/+16
| | | | | | | | | | | | | | | | | | | | zero. Some vports addresses stored in NVRAM may have zero for the WWNN. Adjust the WWNN that we'll use to be the same as the WWPN. Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: bnx2fc: Update copyright for 2017.Chad Dupuis2017-06-2810-10/+20
| | | | | | | | | | Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: bnx2fc: Check for connection offload before sending RRQ.Chad Dupuis2017-06-281-3/+10
| | | | | | | | | | | | | | | | If the connection is not offloaded then the backpointers from the tgt pointer are undefined. Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: bnx2fc: Add filters to the non-offload FCoE receive path.Chad Dupuis2017-06-281-1/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the following filters to bnx2fc_recv_frame(): 1. Filter out invalid packets - eth->dest_mac[3] matches FC frame's D_ID 2. Filter out packets that are not from our connected target - In FIP_ST_ENABLED mode - eth->src_mac matches fcoe_ctlr->dest_addr 3. Filter out packets where if d_id of the packet doesn't belong to the device when one is already assigned a port_id, only then this packet is dropped Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: default to scsi-mqChristoph Hellwig2017-06-282-15/+0Star
| | | | | | | | | | | | | | | | | | | | Remove the SCSI_MQ_DEFAULT config option and default to the blk-mq I/O path now that we had plenty of testing, and have I/O schedulers for blk-mq. The module option to disable the blk-mq path is kept around for now. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: sas: scsi_queue_work can fail, so make callers awareJohannes Thumshirn2017-06-283-19/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libsas uses scsi_queue_work() to queue its internal event notifications. scsi_queue_work() can return -EINVAL if the work queue doesn't exist and it does call queue_work() which can return false if the work is already queued. Make the SAS event code capable of returning errors up to the caller, which is handy when changing to dynamically allocated work in libsas as well, as discussed here: https://lkml.org/lkml/2017/6/14/121. [mkp: fixed typo] Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: qla2xxx: Update Driver version to 10.00.00.00-kHimanshu Madhani2017-06-281-3/+3
| | | | | | | | | | | | | | | | Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: James Smart <james.smart@broadcom.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: qla2xxx: Use FC-NVMe FC4 type for FDMI registrationDuane Grigsby2017-06-281-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [mkp: fixed typo] Signed-off-by: Duane Grigsby <duane.grigsby@cavium.com> Signed-off-by: Darren Trapp <darren.trapp@cavium.com> Signed-off-by: Anil Gurumurthy <anil.gurumurhty@cavium.com> Signed-off-by: Giridhar Malavali <giridhar.malavali@cavium.com> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: James Smart <james.smart@broadcom.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: qla2xxx: Send FC4 type NVMe to the management serverDuane Grigsby2017-06-284-5/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds switch command support for FC-4 type of FC-NVMe (0x28) for resgistering HBA port to the management server. RFT_ID command is used to register FC-4 type of 0x28 and RFF_ID is used to register FC-4 features bits for FC-NVMe port. Signed-off-by: Darren Trapp <darren.trapp@cavium.com> Signed-off-by: Duane Grigsby <duane.grigsby@cavium.com> Signed-off-by: Anil Gurumurthy <anil.gurumurhty@cavium.com> Signed-off-by: Giridhar Malavali <giridhar.malavali@cavium.com> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com> Reviewed-By: James Smart <james.smart@broadcom.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: qla2xxx: Add FC-NVMe F/W initialization and transport registrationDuane Grigsby2017-06-2811-9/+1024
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This code provides the interfaces to register remote and local ports of FC4 type 0x28 with the FC-NVMe transport and transports the requests (FC-NVMe FC link services and FC-NVMe commands IUs) to the fabric. It also provides the support for allocating h/w queues and aborting FC-NVMe FC requests. Signed-off-by: Darren Trapp <darren.trapp@cavium.com> Signed-off-by: Duane Grigsby <duane.grigsby@cavium.com> Signed-off-by: Anil Gurumurthy <anil.gurumurhty@cavium.com> Signed-off-by: Giridhar Malavali <giridhar.malavali@cavium.com> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: qla2xxx: Add FC-NVMe command handlingDuane Grigsby2017-06-284-5/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds logic to handle the completion of FC-NVMe commands and creates a sub-command in the SRB command structure to manage NVMe commands. Signed-off-by: Darren Trapp <darren.trapp@cavium.com> Signed-off-by: Duane Grigsby <duane.grigsby@cavium.com> Signed-off-by: Anil Gurumurthy <anil.gurumurhty@cavium.com> Signed-off-by: Giridhar Malavali <giridhar.malavali@cavium.com> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: qla2xxx: Add FC-NVMe port discovery and PRLI handlingDuane Grigsby2017-06-289-27/+256
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added logic to change the login process into an optional PRIL step for FC-NVMe ports as a separate operation, such that we can change type to 0x28 (NVMe). Currently, the driver performs the PLOGI/PRLI together as one operation, but if the discovered port is an NVMe port then we first issue the PLOGI and then we issue the PRLI. Also, the fabric discovery logic was changed to mark each discovered FC NVMe port, so that we can register them with the FC-NVMe transport later. Signed-off-by: Darren Trapp <darren.trapp@cavium.com> Signed-off-by: Duane Grigsby <duane.grigsby@cavium.com> Signed-off-by: Anil Gurumurthy <anil.gurumurhty@cavium.com> Signed-off-by: Giridhar Malavali <giridhar.malavali@cavium.com> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: qla2xxx: Update driver version to 9.01.00.00-khimanshu.madhani@cavium.com2017-06-281-2/+2
| | | | | | | | | | | | Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com> Signed-off-by: Giridhar Malavali <giridhar.malavali@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: qla2xxx: Include Exchange offload/Extended Login into FW dumpQuinn Tran2017-06-284-3/+67
| | | | | | | | | | | | | | | | | | Add missing memory dump of Exchange Offload and Extended login into FW dump. Signed-off-by: Quinn Tran <quinn.tran@cavium.com> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: qla2xxx: Move target stat counters from vha to qpair.Quinn Tran2017-06-285-35/+63
| | | | | | | | | | | | | | | | Move counters to qpair to reduce cache miss. Signed-off-by: Quinn Tran <quinn.tran@cavium.com> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: qla2xxx: Remove datasegs_per_cmd and datasegs_per_cont fieldQuinn Tran2017-06-282-8/+6Star
| | | | | | | | | | | | | | | | | | These fields only hold one set of value. Replace it with macros to reduce cache thrash. Signed-off-by: Quinn Tran <quinn.tran@cavium.com> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: qla2xxx: Remove unused tgt_enable_64bit_addr flagQuinn Tran2017-06-282-32/+13Star
| | | | | | | | | | | | | | | | | | By default this flag is forced to true. Remove this flag and unneccessary check for this flag. Signed-off-by: Quinn Tran <quinn.tran@cavium.com> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: qla2xxx: Add debug logging routine for qpairQuinn Tran2017-06-284-14/+122
| | | | | | | | | | | | | | | | | | | | For target main path io routines that uses qpair, create new logging & debugging routines to use qpair instead of reaching for scsi_qla_host to reduce cache thrash. Signed-off-by: Quinn Tran <quinn.tran@cavium.com> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: qla2xxx: Add function call to qpair for door bellQuinn Tran2017-06-286-35/+94
| | | | | | | | | | | | | | | | | | Add call back to door bell for qpair. This help reduce access to qla_hw_data structure, in order to reduce cach thrash. Signed-off-by: Quinn Tran <quinn.tran@cavium.com> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: qla2xxx: use shadow register for ISP27XXQuinn Tran2017-06-284-1/+5
| | | | | | | | | | | | | | | | | | For ISP27XX, use shadow register to read FW provided REQQ's consumer index. The shadow register is dma'ed by firmware. Signed-off-by: Quinn Tran <quinn.tran@cavium.com> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: qla2xxx: move fields from qla_hw_data to qla_qpairQuinn Tran2017-06-286-48/+73
| | | | | | | | | | | | | | | | | | | | - Move chip_reset, enable_class_2 fields from qla_hw_data to qla_qpair to reduce cache thrash for target MQ. - Optimizations to reduce unnecessary memory load for good path io. Signed-off-by: Quinn Tran <quinn.tran@cavium.com> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: qla2xxx: Add fw_started flags to qpairQuinn Tran2017-06-284-8/+28
| | | | | | | | | | | | | | | | | | Add fw_started flag to qpair to reduce cache thrash. This reduce access to qla_hw_data structure by each qpair. Signed-off-by: Quinn Tran <quinn.tran@cavium.com> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: qla2xxx: Add debug knob for user control workloadQuinn Tran2017-06-285-4/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For Target mode, user can control the work load by placing qla2xxx's irq vector on certain CPU via the smp_affinity knob. This patch allows user to control the number of QPair's irq to be active. The irqs are allocated at driver load time until unload. The work itself is placed on the QPair based on user setting. Usage: modprobe qla2xxx qlini_mode=disabled ql2xuctrlirq=1 mount -t debugfs none /sys/kernel/debug echo 2 > /sys/kernel/debug/qla2xxx/qla2xxx_[host num]/naqp echo [cpu id] > /proc/irq/[irq id]/smp_affinity_list Signed-off-by: Quinn Tran <quinn.tran@cavium.com> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: qla2xxx: Fix mailbox failure while deleting Queue pairsSawan Chandak2017-06-284-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In target mode driver, queue pairs are not created during driver load time, instead they are created at the configuration time after chip reset. If a user tries to load/unload driver after queue pairs are created, then there would be mailbox failure, while deleting queue pairs. Flag is added to check if queue pairs are created or not. Queue pairs will be deleted only If they were created during target configuration. Signed-off-by: Sawan Chandak <sawan.chandak@cavium.com> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: qla2xxx: Enable Target Multi QueueQuinn Tran2017-06-287-38/+240
| | | | | | | | | | | | | | | | | | | | | | Enable Multi Queue for Target mode. At Initiator LUN scan time, each LUN is assign to a QPair. Each QPair is affinitize to certain CPU. When new cmd arrives from the wire, the lunid is used to search for qpair. The qpair's affinitized cpuid will be used to queue up the work element. Signed-off-by: Quinn Tran <quinn.tran@cavium.com> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>