Commit Graph

6607 Commits

Author SHA1 Message Date
Bart Van Assche
e8de615950 scst: Move RTPG and STPG handling into the SCST core
This patch does not change the behavior when using one of the vdisk handlers.
When using dev_disk to forward SCSI commands from one SCST node to another,
this patch causes RTPG and STPG commands to be processed on the source SCST
node (as it should) instead of on the destination SCST node.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8778 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-02-23 23:07:18 +00:00
Bart Van Assche
6d4c15da22 scst: Move the expl_alua member variable from scst_vdisk_dev into scst_device
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8777 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-02-23 23:05:43 +00:00
Bart Van Assche
785e721cf3 scst: Add the 'forward_src' sysfs attribute
Make forwarding source mode configurable per target port instead of
having a compile-time global option.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8776 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-02-23 23:05:13 +00:00
Bart Van Assche
2e5620098c scst: Add the 'forward_dst' sysfs attribute
Add the 'forward_dst' sysfs attribute next to the 'forwarding' attribute. The
plan is to remove the 'forwarding' attribute at some time in the future.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8775 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-02-23 23:04:11 +00:00
Bart Van Assche
bf2393ff01 scst: Split scst_tg_set_group_info()
Since scst_tg_set_group_info() is too long, split it into two functions.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8774 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-02-23 22:59:32 +00:00
Bart Van Assche
dc670b9c07 scst_vdisk: Clean up show() functions
Leave out "? 1 : 0" from after single bit variables.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8773 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-02-23 22:58:25 +00:00
Bart Van Assche
88711323dc scst: Use bitmap_parse() instead of __bitmap_parse()
__bitmap_parse() has been removed from kernel v5.6. See also commit
2d6261583be0 ("lib: rework bitmap_parse()") # v5.6-rc1.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8772 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-02-23 22:57:43 +00:00
Bart Van Assche
3ad0566ac7 scst/README: Fix spelling
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8771 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-02-23 22:55:59 +00:00
Bart Van Assche
4402104510 scst: Add a source code comment
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8770 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-02-23 17:31:58 +00:00
Bart Van Assche
3d98a7174e scst: Use enum scst_exec_res where appropriate
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8769 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-02-23 17:29:26 +00:00
Bart Van Assche
40b4dfd289 scst: Split the scst_targ.c source file
Since the scst_targ.c source file is large, move the functions for processing
SCSI commands into a new source file, scst_local_cmd.c.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8768 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-02-23 17:16:12 +00:00
Bart Van Assche
e72eae316a scst: Replace relative target port information in the INQUIRY response
Signed-off-by: Tamas Bartha <tamas.bartha@barre.hu>
[ bvanassche: reformatted this patch and renamed several variables ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8767 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-02-23 00:03:28 +00:00
Bart Van Assche
e2c2fab4a0 nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8766 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-02-08 05:45:43 +00:00
Bart Van Assche
a709260f2e scst/kernel/in-tree/Makefile.drivers.Linux-5.5.patch: Add this file
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8765 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-01-28 04:22:39 +00:00
Bart Van Assche
525e6a7028 qla2x00t-32gbit: Port to Linux kernel v5.5
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8764 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-01-28 04:22:07 +00:00
Bart Van Assche
af64553f9f nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8763 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-01-19 21:15:31 +00:00
Bart Van Assche
07ef7d36ca nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8762 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-01-13 04:25:25 +00:00
Bart Van Assche
f0e474c4d8 iscsi-scst: Suppress multiple Coverity complaints
Suppress several Coverity "tainted scalar" complaints and also two other
false positive Coverity complaints.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8761 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-01-12 05:37:34 +00:00
Bart Van Assche
ffd85476ae scst: Suppress a false positive Coverity memory corruption complaint
This patch suppresses the following Coverity complaint:

CID 119689 (#1 of 1): Out-of-bounds access (OVERRUN)
overrun-buffer-arg: Overrunning struct type scst_event of 64 bytes by
passing it to a function which accesses it at byte offset 3135 using
argument 64UL + payload_len (which evaluates to 3136). [Note: The source
code implementation of the function has been overridden by a builtin model.]



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8760 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-01-04 17:46:07 +00:00
Bart Van Assche
2c530f79af scst: Use designated initializers for sys_alloc_fns
Designated initializers are required for GCC to safely implement
RANDSTRUCT, a GCC plugin pulled from the Grsecurity patch set
upstream ~2017.

Fix the compile error caused by implementation of sys_alloc_fns
by rewriting the struct with designated members.

See also https://github.com/bvanassche/scst/pull/17.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8759 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-30 04:38:51 +00:00
Bart Van Assche
422d670126 srpt, isert-scst: Fix the build against MOFED
This patch is a fix for commit a169500590 ("Makefiles:
Use KBUILD_EXTRA_SYMBOLS instead of copying Module.symvers"; r8686).

Reported-by: Grant Albitz <GAlbitz@All-Bits.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8758 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-28 04:28:19 +00:00
Bart Van Assche
52370acb84 qla2x00t-32gbit: Reduce the size of struct qla_tgt_cmd
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8757 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-26 00:43:09 +00:00
Bart Van Assche
4978587a52 qla2x00t-32gbit: Fix a bug in qlt_alloc_qfull_cmd()
Remove a memset() call that clears the data members initialized by
sqa_qla2xxx_get_cmd().

Fixes: b8a1634ced ("qla2x00t-32gbit: Import this driver into the SCST repository")


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8756 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-26 00:42:31 +00:00
Bart Van Assche
3f63399dff qla2x00t-32gbit: Update driver version to 10.01.00.22-k
Link: https://lore.kernel.org/r/20191217220617.28084-15-hmadhani@marvell.com
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

[ commit e849efe8c8734aee0d207a1f006705d7a6d8dd39 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8755 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-26 00:42:06 +00:00
Bart Van Assche
cbe98a9ce7 qla2x00t-32gbit: Fix mtcp dump collection failure
MTCP dump failed due to MB Reg 10 was picking garbage data from stack
memory.

Fixes: 81178772b636a ("[SCSI] qla2xxx: Implemetation of mctp.")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20191217220617.28084-14-hmadhani@marvell.com
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

[ commit 7ae8c12cb1a5278795afbefabc67b119fe769b61 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8754 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-26 00:41:45 +00:00
Bart Van Assche
c75fc9910e qla2x00t-32gbit: Fix stuck session in GNL
Fix race condition between GNL completion processing and GNL request. Late
submission of GNL request was not seen by the GNL completion thread. This
patch will re-submit the GNL request for late submission fcport.

Link: https://lore.kernel.org/r/20191217220617.28084-13-hmadhani@marvell.com
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

[ commit 5c3f46d332234b833ed733144fb9dd40577eb8bc upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8753 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-26 00:41:20 +00:00
Bart Van Assche
22c88c2686 qla2x00t-32gbit: Fix RIDA Format-2
This patch fixes offset for Format-2 data structure for Report ID
Acquisition. This caused driver to set remote_nport_id to 0x0000 in N2N
configuration. In a scenario where initiator's WWPN is higher than target's
WWPN, driver will assign 0x00 as target nport-id, which results into login
failure.

Link: https://lore.kernel.org/r/20191217220617.28084-12-hmadhani@marvell.com
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

[ commit 101346ec73d9376823e7471b719c2e8445aa3541 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8752 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-26 00:40:58 +00:00
Bart Van Assche
a838112bdb qla2x00t-32gbit: Consolidate fabric scan
Consolidate scan for fabric loop and fabric topologies into a single scan.

Link: https://lore.kernel.org/r/20191217220617.28084-11-hmadhani@marvell.com
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

[ commit 25009f0e147951f02618d71e4671a3104e2bb552 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8751 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-26 00:40:25 +00:00
Bart Van Assche
9d2b5a9184 qla2x00t-32gbit: Correct fcport flags handling
This patch fixes some instances of FCF_ASYNC_{SENT|ACTIVE} flag setting and
clearning were missing.

Link: https://lore.kernel.org/r/20191217220617.28084-10-hmadhani@marvell.com
Signed-off-by: Shyam Sundar <ssundar@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

[ commit 0333e5f4f5d3edb2d0f43ea0f4befd20aaf812b4 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8750 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-26 00:40:05 +00:00
Bart Van Assche
c8fe6bdf91 qla2x00t-32gbit: Fix stuck login session using prli_pend_timer
Session is stuck if driver sees FW has received a PRLI. Driver allows FW to
finish with processing of PRLI by checking back with FW at a later time to
see if the PRLI has finished. Instead, driver failed to push forward after
re-checking PRLI completion.

Fixes: 974950710e2a ("qla2xxx: Fix stuck login session")
Cc: stable@vger.kernel.org # 5.3
Link: https://lore.kernel.org/r/20191217220617.28084-9-hmadhani@marvell.com
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

[ commit 08c0de658b08408284e5176d585782f924a21173 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8749 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-26 00:39:34 +00:00
Bart Van Assche
d65276050d qla2x00t-32gbit: Use common routine to free fcport struct
This patch does not change any any functionality.

Link: https://lore.kernel.org/r/20191217220617.28084-8-hmadhani@marvell.com
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

[ commit 3dae220595baa7a9fb582b851b54c10ad6a0cbae upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8748 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-26 00:39:13 +00:00
Bart Van Assche
6892c83653 qla2x00t-32gbit: Add D-Port Diagnostic reason explanation logs
This patch adds more details when D-Port diag async event is generated by
the firmware.

Link: https://lore.kernel.org/r/20191217220617.28084-7-hmadhani@marvell.com
Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

[ commit 425215647fc53ba183026e03206fa86fe5a4f542 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8747 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-26 00:38:50 +00:00
Bart Van Assche
6c8601bc82 qla2x00t-32gbit: Fix update_fcport for current_topology
logout_on_delete flag should not be set if the topology is Loop. This patch
fixes unintentional logout during loop topology.

Link: https://lore.kernel.org/r/20191217220617.28084-6-hmadhani@marvell.com
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

[ commit 89eb2e7e794da2691e5aca02ed102bb287e3575a upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8746 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-26 00:38:30 +00:00
Bart Van Assche
b7ce0c8460 qla2x00t-32gbit: Cleanup unused async_logout_done
This patch removes unused qla2x00_async_logout_done from the code.

Link: https://lore.kernel.org/r/20191217220617.28084-5-hmadhani@marvell.com
Signed-off-by: Shyam Sundar <ssundar@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

[ commit 96a0eb7164d125100ac692c7efeb6e70a7585042 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8745 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-26 00:38:04 +00:00
Bart Van Assche
d847f25524 qla2x00t-32gbit: Add a shadow variable to hold disc_state history of fcport
This patch adds a shadow variable to hold disc_state history for the fcport
and prints state transition when the logging is enabled.

Link: https://lore.kernel.org/r/20191217220617.28084-4-hmadhani@marvell.com
Signed-off-by: Shyam Sundar <ssundar@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

[ commit 27258a5771446f9c7edc929ecb76fe2c12c29d97 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8744 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-26 00:37:40 +00:00
Bart Van Assche
6ce21edf8b qla2x00t-32gbit: Fix fabric scan hang
On timeout, SRB pointer was cleared from outstanding command array and
dropped.  It was not allowed to go through the done process and cleanup.
This patch will abort the SRB where FW will return it with an error status
and resume the normal cleanup.

Link: https://lore.kernel.org/r/20191217220617.28084-3-hmadhani@marvell.com
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

[ commit f57a0107359605b29f4ea9afb8ee2e03473b1448 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8743 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-26 00:37:12 +00:00
Bart Van Assche
c27e7694d8 qla2x00t-32gbit: Remove defer flag to indicate immeadiate port loss
During cable pull test case, if the port is disconnected for time larger
than devloss timeout, driver does not mark path offline.  In such case,
instead of notifying SCSI-ML of loop down, driver goes into endless loop of
device relogin because defer flag is set.

With newer handling of device relogin in driver discovery, defer flag is
now redundant. This patch removes defer flag and cleans up code handling
port lost indication to SCSI-ML.

Link: https://lore.kernel.org/r/20191217220617.28084-2-hmadhani@marvell.com
Signed-off-by: Quinn Tran <qtran@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

[ commit 3c75ad1d87c7d277c6174051b98757fe981d592d upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8742 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-26 00:36:52 +00:00
Bart Van Assche
bb6f896ac4 qla2x00t-32gbit: Add debug dump of LOGO payload and ELS IOCB
The change adds a way to debug LOGO ELS, likewise PLOGI.

Link: https://lore.kernel.org/r/20191125165702.1013-14-r.bolshakov@yadro.com
Acked-by: Himanshu Madhani <hmadhani@marvell.com>
Acked-by: Quinn Tran <qutran@marvell.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Tested-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

[ commit 9545767db3cde2d4f9ca581d096d97ed00754282 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8741 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-26 00:36:30 +00:00
Bart Van Assche
be35a0b615 qla2x00t-32gbit: Ignore PORT UPDATE after N2N PLOGI
PORT UPDATE asynchronous event is generated on the host that issues PLOGI
ELS (in the case of higher WWPN). In that case, the event shouldn't be
handled as it sets unwanted DPC flags (i.e. LOOP_RESYNC_NEEDED) that
trigger link flap.

Ignore the event if the host has higher WWPN, but handle otherwise.

Cc: Quinn Tran <qutran@marvell.com>
Link: https://lore.kernel.org/r/20191125165702.1013-13-r.bolshakov@yadro.com
Acked-by: Himanshu Madhani <hmadhani@marvell.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Tested-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

[ commit af22f0c7b052c5c203207f1e5ebd6aa65f87c538 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8740 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-26 00:36:11 +00:00
Bart Van Assche
027599ccd0 qla2x00t-32gbit: Don't defer relogin unconditonally
qla2x00_configure_local_loop sets RELOGIN_NEEDED bit and calls
qla24xx_fcport_handle_login to perform the login. This bit triggers a wake
up of DPC later after a successful login.

The deferred call is not needed if login succeeds, and it's set in
qla24xx_fcport_handle_login in case of errors, hence it should be safe to
drop.

Link: https://lore.kernel.org/r/20191125165702.1013-12-r.bolshakov@yadro.com
Acked-by: Himanshu Madhani <hmadhani@marvell.com>
Acked-by: Quinn Tran <qutran@marvell.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Tested-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

[ commit dabc5ec915f3a2c657ecfb529cd3d4ec303a4412 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8739 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-26 00:35:42 +00:00
Bart Van Assche
341ef8cf2c qla2x00t-32gbit: Send Notify ACK after N2N PLOGI
qlt_handle_login schedules session for deletion even if a login is in
progress. That causes login bouncing, i.e. a few logins are made before it
settles down.

Complete the first login by sending Notify Acknowledge IOCB via
qlt_plogi_ack_unref if the session is pending login completion.

Fixes: 9cd883f07a54 ("scsi: qla2xxx: Fix session cleanup for N2N")
Cc: Krishna Kant <krishna.kant@purestorage.com>
Cc: Alexei Potashnik <alexei@purestorage.com>
Link: https://lore.kernel.org/r/20191125165702.1013-11-r.bolshakov@yadro.com
Acked-by: Quinn Tran <qutran@marvell.com>
Acked-by: Himanshu Madhani <hmadhani@marvell.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Tested-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

[ commit 5e6b01d84b9d20bcd77fc7c4733a2a4149bf220a upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8738 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-26 00:35:23 +00:00
Bart Van Assche
0a6f0f9ac5 qla2x00t-32gbit: Configure local loop for N2N target
qla2x00_configure_local_loop initializes PLOGI payload for PLOGI ELS using
Get Parameters mailbox command.

In the case when the driver is running in target mode, the topology is N2N
and the target port has higher WWPN, LOCAL_LOOP_UPDATE bit is cleared too
early and PLOGI payload is not initialized by the Get Parameters
command. That causes a failure of ELS IOCB carrying the PLOGI with 0x15 aka
Data Underrun error.

LOCAL_LOOP_UPDATE has to be set to initialize PLOGI payload.

Fixes: 48acad099074 ("scsi: qla2xxx: Fix N2N link re-connect")
Link: https://lore.kernel.org/r/20191125165702.1013-10-r.bolshakov@yadro.com
Acked-by: Quinn Tran <qutran@marvell.com>
Acked-by: Himanshu Madhani <hmadhani@marvell.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Tested-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

[ commit fd1de5830a5abaf444cc4312871e02c41e24fdc1 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8737 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-26 00:35:02 +00:00
Bart Van Assche
695f139aef qla2x00t-32gbit: Fix PLOGI payload and ELS IOCB dump length
The size of the buffer is hardcoded as 0x70 or 112 bytes, while the size of
ELS IOCB is 0x40 and the size of PLOGI payload returned by Get Parameters
command is 0x74.

Cc: Quinn Tran <qutran@marvell.com>
Link: https://lore.kernel.org/r/20191125165702.1013-9-r.bolshakov@yadro.com
Acked-by: Himanshu Madhani <hmadhani@marvell.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Tested-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

[ commit 0334cdea1fba36fad8bdf9516f267ce01de625f7 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8736 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-26 00:34:42 +00:00
Bart Van Assche
b047e2a169 qla2x00t-32gbit: Don't call qlt_async_event twice
MBA_PORT_UPDATE generates duplicate log lines in target mode because
qlt_async_event is called twice. Drop the calls within the case as the
function will be called right after the switch statement.

Cc: Quinn Tran <qutran@marvell.com>
Link: https://lore.kernel.org/r/20191125165702.1013-8-r.bolshakov@yadro.com
Acked-by: Himanshu Madhani <hmadhani@marvel.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Tested-by: Hannes Reinecke <hare@suse.de>
Acked-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

[ commit 2c2f4bed9b6299e6430a65a29b5d27b8763fdf25 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8735 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-26 00:34:15 +00:00
Bart Van Assche
63d90db75d qla2x00t-32gbit: Allow PLOGI in target mode
According to FC-LS-3 (Fibre Channel Link Services) 6.3.2.4
"N_Port Login - No Fabric present", if both parties in the point-to-point
connection know N_Port_Names of each other, Nx_Port with the highest
N_Port_name shall transmit PLOGI. The specification sets no restrictions on
the port role that should send PLOGI.

However, FCP-4 (Fibre Channel Protocol for SCSI, Fourth Version) 6.2
"Overview of Process Login and Process Logout", instructs that in
point-to-point topology, initiator shall send explicit PRLI ELS.

The change fixes stuck P2P login, when target WWPN is higher than initiator
WWPN.

Cc: Quinn Tran <qutran@marvell.com>
Cc: Himanshu Madhani <hmadhani@marvell.com>
Link: https://lore.kernel.org/r/20191125165702.1013-7-r.bolshakov@yadro.com
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

[ commit a9ed06d4e640a8dc978a4649ab78dac8b16d2db6 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8734 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-26 00:31:26 +00:00
Bart Van Assche
cf596469d6 qla2x00t-32gbit: Change discovery state before PLOGI
When a port sends PLOGI, discovery state should be changed to login
pending, otherwise RELOGIN_NEEDED bit is set in
qla24xx_handle_plogi_done_event(). RELOGIN_NEEDED triggers another PLOGI,
and it never goes out of the loop until login timer expires.

Fixes: 8777e4314d397 ("scsi: qla2xxx: Migrate NVME N2N handling into state machine")
Fixes: 8b5292bcfcacf ("scsi: qla2xxx: Fix Relogin to prevent modifying scan_state flag")
Cc: Quinn Tran <qutran@marvell.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20191125165702.1013-6-r.bolshakov@yadro.com
Acked-by: Himanshu Madhani <hmadhani@marvell.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Tested-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

[ commit 58e39a2ce4be08162c0368030cdc405f7fd849aa upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8733 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-26 00:31:06 +00:00
Bart Van Assche
5c3f238b76 qla2x00t-32gbit: Drop superfluous INIT_WORK of del_work
del_work is already initialized inside qla2x00_alloc_fcport, there's no
need to overwrite it. Indeed, it might prevent complete traversal of
workqueue list.

Fixes: a01c77d2cbc45 ("scsi: qla2xxx: Move session delete to driver work queue")
Cc: Quinn Tran <qutran@marvell.com>
Link: https://lore.kernel.org/r/20191125165702.1013-5-r.bolshakov@yadro.com
Acked-by: Himanshu Madhani <hmadhani@marvell.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Tested-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

[ commit 600954e6f2df695434887dfc6a99a098859990cf upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8732 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-26 00:30:45 +00:00
Bart Van Assche
d0a1eb9612 qla2x00t-32gbit: Initialize free_work before flushing it
Target creation triggers a new BUG_ON introduced in in commit 4d43d395fed1
("workqueue: Try to catch flush_work() without INIT_WORK().").  The BUG_ON
reveals an attempt to flush free_work in qla24xx_do_nack_work before it's
initialized in qlt_unreg_sess:

  WARNING: CPU: 7 PID: 211 at kernel/workqueue.c:3031 __flush_work.isra.38+0x40/0x2e0
  CPU: 7 PID: 211 Comm: kworker/7:1 Kdump: loaded Tainted: G            E     5.3.0-rc7-vanilla+ #2
  Workqueue: qla2xxx_wq qla2x00_iocb_work_fn [qla2xxx]
  NIP [c000000000159620] __flush_work.isra.38+0x40/0x2e0
  LR [c0080000009d91b0] qla24xx_do_nack_work+0x88/0x180 [qla2xxx]
  Call Trace:
  [c000000005f3f9c0] [c000000000159644] __flush_work.isra.38+0x64/0x2e0 (unreliable)
  [c000000005f3fa50] [c0080000009d91a0] qla24xx_do_nack_work+0x78/0x180 [qla2xxx]
  [c000000005f3fae0] [c0080000009496ec] qla2x00_do_work+0x604/0xb90 [qla2xxx]
  [c000000005f3fc40] [c008000000949cd8] qla2x00_iocb_work_fn+0x60/0xe0 [qla2xxx]
  [c000000005f3fc80] [c000000000157bb8] process_one_work+0x2c8/0x5b0
  [c000000005f3fd10] [c000000000157f28] worker_thread+0x88/0x660
  [c000000005f3fdb0] [c000000000161d64] kthread+0x1a4/0x1b0
  [c000000005f3fe20] [c00000000000b960] ret_from_kernel_thread+0x5c/0x7c

Fixes: 1021f0bc2f3d6 ("scsi: qla2xxx: allow session delete to finish before create.")
Cc: Quinn Tran <qutran@marvell.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20191125165702.1013-4-r.bolshakov@yadro.com
Acked-by: Himanshu Madhani <hmadhani@marvell.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Tested-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

[ commit 4c86b037a6db3ad2922ef3ba8a8989eb7794e040 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8731 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-26 00:30:18 +00:00
Bart Van Assche
5bab3ecb99 qla2x00t-32gbit: Use explicit LOGO in target mode
Target makes implicit LOGO on session teardown. LOGO ELS is not send on the
wire and initiator is not aware that target no longer wants talking to
it. Initiator keeps sending I/O requests, target responds with BA_RJT, they
time out and then initiator sends ABORT TASK (ABTS-LS).

Current behaviour incurs unneeded I/O timeout and can be fixed for some
initiators by making explicit LOGO on session deletion.

Link: https://lore.kernel.org/r/20191125165702.1013-3-r.bolshakov@yadro.com
Reviewed-by: Hannes Reinecke <hare@suse.de>
Tested-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

[ commit 86196a8fa8a84af1395a28ea0548f2ce6ae9bc22 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8730 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-26 00:29:20 +00:00
Bart Van Assche
686aa95dcf qla2x00t-32gbit: Fix incorrect SFUB length used for Secure Flash Update MB Cmd
SFUB length should be in DWORDs when passed to FW.

Fixes: 3f006ac342c03 ("scsi: qla2xxx: Secure flash update support for ISP28XX")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20191203223657.22109-4-hmadhani@marvell.com
Signed-off-by: Michael Hernandez <mhernandez@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

[ commit c868907e1ac6a08a17f8fa9ce482c0a496896e9e upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8729 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-26 00:28:59 +00:00