Commit Graph

7325 Commits

Author SHA1 Message Date
Bart Van Assche
8c19a57583 qla2x00t-32gbit: Backport the EDIF BSG code
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9569 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:45:50 +00:00
Bart Van Assche
3c36167585 qla2x00t-32gbit: Open-code qla2xxx_eh_device_reset()
Device reset and target reset will be using different calling sequences, so
open-code __qla2xxx_eh_generic_reset() in qla2xxx_eh_device_reset(), and
remove the now obsolete function __qla2xxx_eh_generic_reset().  No
functional changes.

Link: https://lore.kernel.org/r/20210819091913.94436-4-hare@suse.de
Cc: Nilesh Javali <njavali@marvell.com>
Reviewed-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit cbe1f0d70072cbdb28c8687f3fca79d07e8d1860 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9568 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:45:46 +00:00
Bart Van Assche
c6c70f504d qla2x00t-32gbit: Open-code qla2xxx_eh_target_reset()
Device reset and target reset will be using different calling sequences, so
open-code __qla2xxx_eh_generic_reset() in qla2xxx_eh_target_reset().  No
functional changes.

Link: https://lore.kernel.org/r/20210819091913.94436-3-hare@suse.de
Cc: Nilesh Javali <njavali@marvell.com>
Reviewed-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit e56b2234ab64f92486ea246f1322ff236e87e229 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9567 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:45:42 +00:00
Bart Van Assche
700bbd7eb2 qla2x00t-32gbit: Do not call fc_block_scsi_eh() during bus reset
When calling bus reset the driver will be doing a full SAN resync, so there
is no need to wait for any pending RSCNs; they'll be re-issued during
resync anyway.

Link: https://lore.kernel.org/r/20210819091913.94436-2-hare@suse.de
Cc: Nilesh Javali <njavali@marvell.com>
Reviewed-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit c74ce061f8983bcb048b895bc127447909321fe8 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9566 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:45:38 +00:00
Bart Van Assche
b2f977c791 qla2x00t-32gbit: Update version to 10.02.06.200-k
Link: https://lore.kernel.org/r/20210817051315.2477-13-njavali@marvell.com
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 34f69ec703559f0a43ec3307795c28514861b511 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9565 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:45:34 +00:00
Bart Van Assche
bd8956724c qla2x00t-32gbit: edif: Fix returnvar.cocci warnings
drivers/scsi/qla2xxx/qla_edif.c:213:25-29: Unneeded variable: "rval". Return "0"
on line 264

Remove unneeded variable used to store return value.

Generated by: scripts/coccinelle/misc/returnvar.cocci

Link: https://lore.kernel.org/r/20210817051315.2477-12-njavali@marvell.com
Fixes: 7ebb336e45ef ("scsi: qla2xxx: edif: Add start + stop bsgs")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 17f3df8fd718fb229ae3453ae59b3f2349464d06 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9564 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:45:30 +00:00
Bart Van Assche
da7cfbb899 qla2x00t-32gbit: Fix NVMe session down detection
When Target port transitions personality from one to another (NVMe <-->
FCP), there could be some overlap of the two where one layer is going down
while the other layer is coming up. This overlap can cause temporary I/O
error. Detect those errors/transitions and recover from them. Triggers
session tear down and allow relogin to re-drive the connection under the
following conditions:

- NVMe command error

- On PRLO + N2N (rida format 2)

Link: https://lore.kernel.org/r/20210817051315.2477-11-njavali@marvell.com
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 7a8ff7d9854a1727435557184c8255bbbca60920 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9563 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:45:25 +00:00
Bart Van Assche
5fc2357c68 qla2x00t-32gbit: Fix NVMe retry
For target port that register itself as both FCP + NVMe, initiator driver
will try to login one mode at a time. If the last mode did not succeed,
then driver will try the other mode.

When error is encountered, current code only flip to other mode one time
(NVMe->FCP) and remain on the last mode.  Driver wrongly assumed target
port does not support PRLI NVMe, instead it was not ready to receive PRLI.

This patch will alternate back and forth on every PRLI failure until login
retry count has depleted or it is succeeded.

Link: https://lore.kernel.org/r/20210817051315.2477-10-njavali@marvell.com
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit f88444570072a6863f3e2bd67878560a51b187f2 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9562 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:45:20 +00:00
Bart Van Assche
e011c72863 qla2x00t-32gbit: Fix hang on NVMe command timeouts
The abort callback gets called only when it gets posted to firmware. The
refcounting is done properly in the callback. On internal errors, the
callback is not invoked leading to a hung I/O. Fix this by having separate
error code when command gets returned from firmware.

Link: https://lore.kernel.org/r/20210817051315.2477-9-njavali@marvell.com
Signed-off-by: Arun Easi <aeasi@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 2cabf10dbbe380e2ef27a69ce2059bcab7c8b419 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9561 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:45:16 +00:00
Bart Van Assche
cb5acb2323 qla2x00t-32gbit: Fix NVMe | FCP personality change
Currently driver saves the personality type (FCP|NVMe) at the start of
first discovery of the remote device. If the remote device personality do
change over time, then qla driver needs to present that to user to decide.

Link: https://lore.kernel.org/r/20210817051315.2477-8-njavali@marvell.com
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit f6e327fc09e48271c103efb3b69fc4ccda3f408b upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9560 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:45:12 +00:00
Bart Van Assche
d2312b6268 qla2x00t-32gbit: edif: Do secure PLOGI when auth app is present
For initiator mode, always do secure login when authentication app started.
Also remove redundant flags to indicate secure connection.

Link: https://lore.kernel.org/r/20210817051315.2477-7-njavali@marvell.com
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 1dc64a360bda55d632202e3fef266cef7d4f6f00 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9559 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:45:07 +00:00
Bart Van Assche
6e3fa20e65 qla2x00t-32gbit: edif: Add N2N support for EDIF
For EDIF + N2N to work, firmware 9.8 or later is required. The driver will
pause after PLOGI to allow app to authenticate. Once authentication
completes, app will tell driver to do PRLI.

Link: https://lore.kernel.org/r/20210817051315.2477-6-njavali@marvell.com
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 4de067e5df12c4db4d3d930ba58354d23674f67c upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9558 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:45:02 +00:00
Bart Van Assche
88876f3f32 qla2x00t-32gbit: Fix hang during NVMe session tear down
The following hung task call trace was seen:

[ 1230.183294] INFO: task qla2xxx_wq:523 blocked for more than 120 seconds.
[ 1230.197749] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 1230.205585] qla2xxx_wq      D    0   523      2 0x80004000
[ 1230.205636] Workqueue: qla2xxx_wq qlt_free_session_done [qla2xxx]
[ 1230.205639] Call Trace:
[ 1230.208100]  __schedule+0x2c4/0x700
[ 1230.211607]  schedule+0x38/0xa0
[ 1230.214769]  schedule_timeout+0x246/0x2f0
[ 1230.222651]  wait_for_completion+0x97/0x100
[ 1230.226921]  qlt_free_session_done+0x6a0/0x6f0 [qla2xxx]
[ 1230.232254]  process_one_work+0x1a7/0x360

...when device side port resets were done.

Abort threads were getting out without processing due to the "deleted"
flag check. The delete thread, meanwhile, could not proceed with a
logout (that would have cleared out pending requests) as the logout IOCB
work was not progressing. It appears like the hung qlt_free_session_done()
thread is causing the ha->wq works on hold. The qlt_free_session_done()
was hung waiting for nvme_fc_unregister_remoteport() + localport_delete cb
to be complete, which would only happen when all I/Os are released.

Fix this by allowing abort to progress until device delete is completely
done. This should make the qlt_free_session_done() proceed without hang and
thus clear up the deadlock.

Link: https://lore.kernel.org/r/20210817051315.2477-5-njavali@marvell.com
Signed-off-by: Arun Easi <aeasi@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 310e69edfbd57995868a428eeddea09a7b5d2749 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9557 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:44:58 +00:00
Bart Van Assche
354b18f993 qla2x00t-32gbit: edif: Fix EDIF enable flag
edif_enabled is prematurely turned on if hardware is capable of handling
the feature.  However, firmware also needs to support EDIF before enabling
this bit.

Link: https://lore.kernel.org/r/20210817051315.2477-4-njavali@marvell.com
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit d07b75ba96497e9bfb9f0e673800a9d764ac212a upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9556 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:44:54 +00:00
Bart Van Assche
f8c549e5b9 qla2x00t-32gbit: edif: Reject AUTH ELS on session down
Reject inflight AUTH ELS if driver is going through session recovery.

Link: https://lore.kernel.org/r/20210817051315.2477-3-njavali@marvell.com
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 225479296c4fb2d3449e55b48eca2a9d6aca1e4e upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9555 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:44:50 +00:00
Bart Van Assche
ad72fd5c26 qla2x00t-32gbit: edif: Fix stale session
When firmware indicates session has been torn down via UPDATE SA IOCB or
ELS Passthrough IOCB, the driver needs to also tear down the session.

Link: https://lore.kernel.org/r/20210817051315.2477-2-njavali@marvell.com
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit b15ce2f34cf42487982db0a8606095db1c8c8f28 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9554 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:44:46 +00:00
Bart Van Assche
bc381af443 qla2x00t-32gbit: Update version to 10.02.06.100-k
Link: https://lore.kernel.org/r/20210810043720.1137-15-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit bd19573e05f6e643f003672c799b3b2301f2f493 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9553 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:44:41 +00:00
Bart Van Assche
aa8246ab2e qla2x00t-32gbit: Sync queue idx with queue_pair_map idx
The first invocation of function find_first_zero_bit will return 0 and
queue_id gets set to 0.

An index of queue_pair_map also gets set to 0.

qpair_id = find_first_zero_bit(ha->qpair_qid_map, ha->max_qpairs);

set_bit(qpair_id, ha->qpair_qid_map);
ha->queue_pair_map[qpair_id] = qpair;

In the alloc_queue callback driver checks the map, if queue is already
allocated:

ha->queue_pair_map[qidx]

This works fine as long as max_qpairs is greater than nvme_max_hw_queues(8)
since the size of the queue_pair_map is equal to max_qpair. In case nr_cpus
is less than 8, max_qpairs is less than 8. This creates wrong value
returned as qpair.

[ 1572.353669] qla2xxx [0000:24:00.3]-2121:6: Returning existing qpair of 4e00000000000000 for idx=2
[ 1572.354458] general protection fault: 0000 [#1] SMP PTI
[ 1572.354461] CPU: 1 PID: 44 Comm: kworker/1:1H Kdump: loaded Tainted: G          IOE    --------- -  - 4.18.0-304.el8.x86_64 #1
[ 1572.354462] Hardware name: HP ProLiant DL380p Gen8, BIOS P70 03/01/2013
[ 1572.354467] Workqueue: kblockd blk_mq_run_work_fn
[ 1572.354485] RIP: 0010:qla_nvme_post_cmd+0x92/0x760 [qla2xxx]
[ 1572.354486] Code: 84 24 5c 01 00 00 00 00 b8 0a 74 1e 66 83 79 48 00 0f 85 a8 03 00 00 48 8b 44 24 08 48 89 ee 4c 89 e7 8b 50 24 e8 5e 8e 00 00 <f0> 41 ff 47 04 0f ae f0 41 f6 47 24 04 74 19 f0 41 ff 4f 04 b8 f0
[ 1572.354487] RSP: 0018:ffff9c81c645fc90 EFLAGS: 00010246
[ 1572.354489] RAX: 0000000000000001 RBX: ffff8ea3e5070138 RCX: 0000000000000001
[ 1572.354490] RDX: 0000000000000001 RSI: 0000000000000001 RDI: ffff8ea4c866b800
[ 1572.354491] RBP: ffff8ea4c866b800 R08: 0000000000005010 R09: ffff8ea4c866b800
[ 1572.354492] R10: 0000000000000001 R11: 000000069d1ca3ff R12: ffff8ea4bc460000
[ 1572.354493] R13: ffff8ea3e50702b0 R14: ffff8ea4c4c16a58 R15: 4e00000000000000
[ 1572.354494] FS:  0000000000000000(0000) GS:ffff8ea4dfd00000(0000) knlGS:0000000000000000
[ 1572.354495] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1572.354496] CR2: 000055884504fa58 CR3: 00000005a1410001 CR4: 00000000000606e0
[ 1572.354497] Call Trace:
[ 1572.354503]  ? check_preempt_curr+0x62/0x90
[ 1572.354506]  ? dma_direct_map_sg+0x72/0x1f0
[ 1572.354509]  ? nvme_fc_start_fcp_op.part.32+0x175/0x460 [nvme_fc]
[ 1572.354511]  ? blk_mq_dispatch_rq_list+0x11c/0x730
[ 1572.354515]  ? __switch_to_asm+0x35/0x70
[ 1572.354516]  ? __switch_to_asm+0x41/0x70
[ 1572.354518]  ? __switch_to_asm+0x35/0x70
[ 1572.354519]  ? __switch_to_asm+0x41/0x70
[ 1572.354521]  ? __switch_to_asm+0x35/0x70
[ 1572.354522]  ? __switch_to_asm+0x41/0x70
[ 1572.354523]  ? __switch_to_asm+0x35/0x70
[ 1572.354525]  ? entry_SYSCALL_64_after_hwframe+0xb9/0xca
[ 1572.354527]  ? __switch_to_asm+0x41/0x70
[ 1572.354529]  ? __blk_mq_sched_dispatch_requests+0xc6/0x170
[ 1572.354531]  ? blk_mq_sched_dispatch_requests+0x30/0x60
[ 1572.354532]  ? __blk_mq_run_hw_queue+0x51/0xd0
[ 1572.354535]  ? process_one_work+0x1a7/0x360
[ 1572.354537]  ? create_worker+0x1a0/0x1a0
[ 1572.354538]  ? worker_thread+0x30/0x390
[ 1572.354540]  ? create_worker+0x1a0/0x1a0
[ 1572.354541]  ? kthread+0x116/0x130
[ 1572.354543]  ? kthread_flush_work_fn+0x10/0x10
[ 1572.354545]  ? ret_from_fork+0x35/0x40

Fix is to use index 0 for admin and first IO queue.

Link: https://lore.kernel.org/r/20210810043720.1137-14-njavali@marvell.com
Fixes: e84067d74301 ("scsi: qla2xxx: Add FC-NVMe F/W initialization and transport registration")
Cc: stable@vger.kernel.org
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Saurav Kashyap <skashyap@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit c8fadf019964d0eb1da410ba8b629494d3339db9 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9552 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:44:32 +00:00
Bart Van Assche
8bff2dfde2 qla2x00t-32gbit: Changes to support kdump kernel for NVMe BFS
The MSI-X and MSI calls fails in kdump kernel. Because of this
qla2xxx_create_qpair() fails leading to .create_queue callback failure.
The fix is to return existing qpair instead of allocating new one and
allocate a single hw queue.

[   19.975838] qla2xxx [0000:d8:00.1]-00c7:11: MSI-X: Failed to enable support,
giving   up -- 16/-28.
[   19.984885] qla2xxx [0000:d8:00.1]-0037:11: Falling back-to MSI mode --
ret=-28.
[   19.992278] qla2xxx [0000:d8:00.1]-0039:11: Falling back-to INTa mode --
ret=-28.
..
..
..
[   21.141518] qla2xxx [0000:d8:00.0]-2104:2: qla_nvme_alloc_queue: handle
00000000e7ee499d, idx =1, qsize 32
[   21.151166] qla2xxx [0000:d8:00.0]-0181:2: FW/Driver is not multi-queue capable.
[   21.158558] qla2xxx [0000:d8:00.0]-2122:2: Failed to allocate qpair
[   21.164824] nvme nvme0: NVME-FC{0}: reset: Reconnect attempt failed (-22)
[   21.171612] nvme nvme0: NVME-FC{0}: Reconnect attempt in 2 seconds

Link: https://lore.kernel.org/r/20210810043720.1137-13-njavali@marvell.com
Cc: stable@vger.kernel.org
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Saurav Kashyap <skashyap@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 4a0a542fe5e4273baf9228459ef3f75c29490cba upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9551 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:44:28 +00:00
Bart Van Assche
6f2b95635f qla2x00t-32gbit: Changes to support kdump kernel
Avoid allocating firmware dump and only allocate a single queue for a kexec
kernel.

Link: https://lore.kernel.org/r/20210810043720.1137-12-njavali@marvell.com
Cc: stable@vger.kernel.org
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Saurav Kashyap <skashyap@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 62e0dec59c1e139dab55aff5aa442adc97804271 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9550 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:44:24 +00:00
Bart Van Assche
410bb7c65c qla2x00t-32gbit: Suppress unnecessary log messages during login
Suppress logging of retryable errors. These can still be seen if extended
logging is enabled.

Link: https://lore.kernel.org/r/20210810043720.1137-11-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Arun Easi <aeasi@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit a5741427322b6158fbe9f1a4c118e95a05cecd53 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9549 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:44:20 +00:00
Bart Van Assche
39b8ce590d qla2x00t-32gbit: Fix NPIV create erroneous error
When user creates multiple NPIVs, the switch capabilities field is checked
before a vport is allowed to be created. This field is being toggled if a
switch scan is in progress. This creates erroneous reject of vport create.

Link: https://lore.kernel.org/r/20210810043720.1137-10-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit a57214443f0f85639a0d9bbb8bd658d82dbf0927 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9548 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:44:16 +00:00
Bart Van Assche
369fa2ff74 qla2x00t-32gbit: Fix unsafe removal from linked list
On NPIV delete, the VPort is taken off a linked list in an unsafe manner.
The check for VPort refcount should be done behind lock before taking off
the element.

[ 2733.016907] general protection fault: 0000 [#1] SMP NOPTI
[ 2733.016908] qla2xxx [0000:22:00.1]-7088:27: VP[4] deleted.
[ 2733.016912] CPU: 22 PID: 23481 Comm: qla2xxx_15_dpc Kdump: loaded Tainted:
G           OE KX    5.3.18-47-default #1 SLE15-SP3
[ 2733.016914] Hardware name: Dell Inc. PowerEdge R7525/0PYVT1, BIOS 2.1.4 02/17/2021
[ 2733.016929] RIP: 0010:qla2x00_abort_isp+0x90/0x850 [qla2xxx]
[ 2733.016933] RSP: 0018:ffffb9cfc91efe98 EFLAGS: 00010087
[ 2733.016935] RAX: 0000000000000292 RBX: dead000000000100 RCX: 0000000000000000
[ 2733.016936] RDX: 0000000000000001 RSI: ffff944bfeb99558 RDI: ffff944bfc4b4488
[ 2733.016937] RBP: ffff944bfc4b2868 R08: 00000000000187a2 R09: 0000000000000001
[ 2733.016937] R10: ffffb9cfc91efcc8 R11: 0000000000000001 R12: ffff944bfc4b4000
[ 2733.016938] R13: ffff944bfc4b4870 R14: ffff944bfc4b4488 R15: ffff944bda895c80
[ 2733.016939] FS:  0000000000000000(0000) GS:ffff944bfeb80000(0000) knlGS:0000000000000000
[ 2733.016940] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 2733.016940] CR2: 00007fc173e74458 CR3: 0000001ff57de000 CR4: 0000000000350ee0
[ 2733.016941] Call Trace:
[ 2733.016951]   qla2xxx_pci_error_detected+0x190/0x190 [qla2xxx]
[ 2733.016957]   qla2x00_do_dpc+0x560/0xa10 [qla2xxx]
[ 2733.016962]   kthread+0x10d/0x130
[ 2733.016963]   kthread_park+0xa0/0xa0
[ 2733.016966]   ret_from_fork+0x22/0x40

Link: https://lore.kernel.org/r/20210810043720.1137-9-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 0c9a5f3e42f75dbad5966aa59db935b694ab00d1 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9547 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:44:12 +00:00
Bart Van Assche
b24184dc31 qla2x00t-32gbit: Fix port type info
Over time, fcport->port_type became a flag field. The flags within this
field were not defined properly. This caused external tools to read wrong
info.

Link: https://lore.kernel.org/r/20210810043720.1137-8-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 01c97f2dd8fb4d2188c779a975031c0fe1ec061d upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9546 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:44:08 +00:00
Bart Van Assche
bf058b5f77 qla2x00t-32gbit: Add debug print of 64G link speed
Add debug print of 64G link speed.

Link: https://lore.kernel.org/r/20210810043720.1137-7-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 85818882c3d91485a153e7df3a8fdd8a0c4ff763 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9545 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:44:04 +00:00
Bart Van Assche
16d8f4982f qla2x00t-32gbit: Show OS name and version in FDMI-1
To be consistent with other OS drivers, register OS name and version in
FDMI-1 fabric registration.

Link: https://lore.kernel.org/r/20210810043720.1137-6-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Arun Easi <aeasi@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 137316ba79a686d7193ea6c8e5eb284fa24e4f9f upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9544 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:44:00 +00:00
Bart Van Assche
ec35ca4db5 qla2x00t-32gbit: Changes to support FCP2 Target
Add changes to support FCP2 Target.

Link: https://lore.kernel.org/r/20210810043720.1137-5-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Saurav Kashyap <skashyap@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 44c57f205876518b14ab2b4b5d88a181f41260bb upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9543 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:43:56 +00:00
Bart Van Assche
b24a07ab4a qla2x00t-32gbit: Adjust request/response queue size for 28xx
Adjust request/respond queue size for 28xx to match 27xx adapter.

Link: https://lore.kernel.org/r/20210810043720.1137-4-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit ade660d4d50645521b6ce16703ccbbf21f1367a1 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9542 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:43:51 +00:00
Bart Van Assche
1d7a12e843 qla2x00t-32gbit: Add host attribute to trigger MPI hang
Add a mechanism to trigger MPI pause for debugging purposes.

Link: https://lore.kernel.org/r/20210810043720.1137-2-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Arun Easi <aeasi@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 4c15442d9c06ae6ce0a03fd69c4869f343d67473 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9541 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:43:47 +00:00
Bart Van Assche
51e2940169 qla2x00t-32gbit: Use scsi_cmd_to_rq() instead of scsi_cmnd.request
Prepare for removal of the request pointer by using scsi_cmd_to_rq()
instead. This patch does not change any functionality.

Link: https://lore.kernel.org/r/20210809230355.8186-39-bvanassche@acm.org
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit c7d6b2c2cd5656b05849afb0de3f422da1742d0f upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9540 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:43:43 +00:00
Bart Van Assche
dc4aaf34e4 qla2x00t-32gbit: Remove redundant initialization of variable num_cnt
The variable num_cnt is being initialized with a value that is never read,
it is being updated later on. The assignment is redundant and can be
removed.

Link: https://lore.kernel.org/r/20210804131344.112635-1-colin.king@canonical.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Addresses-Coverity: ("Unused value")
[ commit 77d0f07abada8c9aeb54caba879a298a0b94c02a upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9539 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:43:39 +00:00
Bart Van Assche
93580a7882 qla2x00t-32gbit: Fix use after free in debug code
The sp->free(sp); call frees "sp" and then the debug code dereferences
it on the next line.  Swap the order.

Link: https://lore.kernel.org/r/20210803155625.GA22735@kili
Fixes: 84318a9f01ce ("scsi: qla2xxx: edif: Add send, receive, and accept for auth_els")
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit e3d2612f583ba6e234cb7fe4559132c8f28905f1 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9538 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:43:35 +00:00
Bart Van Assche
eb5be680e3 qla2x00t-32gbit: Fix spelling mistakes "allloc" -> "alloc"
There are two spelling mistakes with the same triple l in alloc, one in a
comment, the other in a ql_dbg() debug message. Fix them.

Link: https://lore.kernel.org/r/20210729082413.4761-1-colin.king@canonical.com
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 0f783c2d640ac03ad3bb3ba6b7a1287ddf18031d upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9537 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:43:31 +00:00
Bart Van Assche
3e1b01cd07 qla2x00t-32gbit: Update version to 10.02.00.107-k
Link: https://lore.kernel.org/r/20210624052606.21613-12-njavali@marvell.com
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 9798c653547d35cebef59d35edbbc269d85fb1b3 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9536 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:43:27 +00:00
Bart Van Assche
b87f44fcb7 qla2x00t-32gbit: edif: Increment command and completion counts
Increment the command and the completion counts.

Link: https://lore.kernel.org/r/20210624052606.21613-11-njavali@marvell.com
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 71bef5020cd13e1aaa878d10481aafc1ecd4a8f6 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9535 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:43:23 +00:00
Bart Van Assche
e6fc5efef0 qla2x00t-32gbit: edif: Add encryption to I/O path
Some FC adapters from Marvell offer the ability to encrypt data in flight
(EDIF). This feature requires an application to act as an authenticator.

After the completion of PLOGI, both sides have authenticated and PRLI
completed, encrypted I/Os are allowed to proceed.

- Use new firmware API to encrypt traffic on the wire

- Add driver parameter to enable|disable EDIF feature

Link: https://lore.kernel.org/r/20210624052606.21613-10-njavali@marvell.com
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Co-developed-by: Larry Wisneski <Larry.Wisneski@marvell.com>
Signed-off-by: Larry Wisneski <Larry.Wisneski@marvell.com>
Co-developed-by: Duane Grigsby <duane.grigsby@marvell.com>
Signed-off-by: Duane Grigsby <duane.grigsby@marvell.com>
Co-developed-by: Rick Hicksted Jr <rhicksted@marvell.com>
Signed-off-by: Rick Hicksted Jr <rhicksted@marvell.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 44d018577f179383ea2c409f3a392e9dbd1a155e upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9534 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:43:18 +00:00
Bart Van Assche
33b58dc868 qla2x00t-32gbit: edif: Add doorbell notification for app
Some FC adapters from Marvell offer the ability to encrypt data in flight
(EDIF). This feature requires an application to act as an authenticator.

During runtime, driver and authentication application need to stay in sync
in terms of: Session being down|up, arrival of new authentication
message (AUTH ELS) and SADB update completion.

These events are queued up as doorbell to the authentication
application. Application would read this doorbell on regular basis to stay
up to date. Each SCSI host would have a separate doorbell queue.

The doorbell interface can daisy chain a list of events for each read. Each
event contains an event code + hint to help application steer the next
course of action.

Link: https://lore.kernel.org/r/20210624052606.21613-9-njavali@marvell.com
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Co-developed-by: Larry Wisneski <Larry.Wisneski@marvell.com>
Signed-off-by: Larry Wisneski <Larry.Wisneski@marvell.com>
Co-developed-by: Duane Grigsby <duane.grigsby@marvell.com>
Signed-off-by: Duane Grigsby <duane.grigsby@marvell.com>
Co-developed-by: Rick Hicksted Jr <rhicksted@marvell.com>
Signed-off-by: Rick Hicksted Jr <rhicksted@marvell.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 7a09e8d92c6d56121910ccb2e8bc0d1affff66ee upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9533 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:43:13 +00:00
Bart Van Assche
06e10ebdab qla2x00t-32gbit: edif: Add detection of secure device
Some FC adapters from Marvell offer the ability to encrypt data in flight
(EDIF). This feature requires an application to act as an authenticator.

There is no FC switch scan service that can indicate whether a device is
secure or non-secure.

In order to detect whether the remote port supports encrypted operation,
driver must first do a PLOGI with the remote device. On completion of the
PLOGI, driver will query firmware to see if the device supports secure
login. To do that, driver + firmware must advertise the security bit via
PLOGI's service parameter. The remote device shall respond using the same
service parameter whether it supports it or not.

Link: https://lore.kernel.org/r/20210624052606.21613-8-njavali@marvell.com
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Co-developed-by: Larry Wisneski <Larry.Wisneski@marvell.com>
Signed-off-by: Larry Wisneski <Larry.Wisneski@marvell.com>
Co-developed-by: Duane Grigsby <duane.grigsby@marvell.com>
Signed-off-by: Duane Grigsby <duane.grigsby@marvell.com>
Co-developed-by: Rick Hicksted Jr <rhicksted@marvell.com>
Signed-off-by: Rick Hicksted Jr <rhicksted@marvell.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 9efea843a906c6674ac6728f3f5db2cbfa3e1830 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9532 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:43:07 +00:00
Bart Van Assche
86e300f841 qla2x00t-32gbit: edif: Add authentication pass + fail bsgs
Some FC adapters from Marvell offer the ability to encrypt data in flight
(EDIF). This feature requires an application to act as an authenticator.

On completion of the authentication process, the authentication application
will notify driver on whether it is successful or not.

In case of success, application will use the QL_VND_SC_AUTH_OK BSG call to
tell driver to proceed to the PRLI phase.

In case of failure, application will use the QL_VND_SC_AUTH_FAIL bsg call
to tell driver to tear down the connection and retry. In the case where an
existing session is active, the re-key process can fail. The session tear
down ensures data is not further compromised.

Link: https://lore.kernel.org/r/20210624052606.21613-7-njavali@marvell.com
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Co-developed-by: Larry Wisneski <Larry.Wisneski@marvell.com>
Signed-off-by: Larry Wisneski <Larry.Wisneski@marvell.com>
Co-developed-by: Duane Grigsby <duane.grigsby@marvell.com>
Signed-off-by: Duane Grigsby <duane.grigsby@marvell.com>
Co-developed-by: Rick Hicksted Jr <rhicksted@marvell.com>
Signed-off-by: Rick Hicksted Jr <rhicksted@marvell.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 8a4bb2c1dd623b5a71609de5b04ef3b5086b0a3e upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9531 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:43:02 +00:00
Bart Van Assche
12701c1c28 qla2x00t-32gbit: edif: Add key update
Some FC adapters from Marvell offer the ability to encrypt data in flight
(EDIF). This feature requires an application to act as an authenticator.

As part of the authentication process, the authentication application will
generate a SADB entry (Security Association/SA, key, SPI value, etc). This
SADB is then passed to driver to be programmed into hardware. There will be
a pair of SADB's (Tx and Rx) for each connection.

After some period, the application can choose to change the key. At that
time, a new set of SADB pair is given to driver. The old set of SADB will
be deleted.

Add a new bsg call (QL_VND_SC_SA_UPDATE) to allow application to allow
adding or deleting SADB entries.  Driver will not keep the key in
memory. It will pass it to HW.

It is assumed that application will assign a unique SPI value to this SADB
(SA + key). Driver + hardware will assign a handle to track this unique
SPI/SADB.

Link: https://lore.kernel.org/r/20210624052606.21613-6-njavali@marvell.com
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Co-developed-by: Larry Wisneski <Larry.Wisneski@marvell.com>
Signed-off-by: Larry Wisneski <Larry.Wisneski@marvell.com>
Co-developed-by: Duane Grigsby <duane.grigsby@marvell.com>
Signed-off-by: Duane Grigsby <duane.grigsby@marvell.com>
Co-developed-by: Rick Hicksted Jr <rhicksted@marvell.com>
Signed-off-by: Rick Hicksted Jr <rhicksted@marvell.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit dd30706e73b70d67e88fdaca688db7a3374fd5de upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9530 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:42:57 +00:00
Bart Van Assche
7d3da75a56 qla2x00t-32gbit: edif: Add extraction of auth_els from the wire
Some FC adapters from Marvell offer the ability to encrypt data in flight
(EDIF). This feature requires an application to act as an authenticator.

Once authentication messages sent from a remote device have arrived, each
message is extracted and placed in a buffer for application to retrieve.
The FC frame header will be stripped, leaving behind the AUTH ELS payload.
It is up to the application to strip the AUTH ELS header to get to the
actual authentication message.

Link: https://lore.kernel.org/r/20210624052606.21613-5-njavali@marvell.com
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Co-developed-by: Larry Wisneski <Larry.Wisneski@marvell.com>
Signed-off-by: Larry Wisneski <Larry.Wisneski@marvell.com>
Co-developed-by: Duane Grigsby <duane.grigsby@marvell.com>
Signed-off-by: Duane Grigsby <duane.grigsby@marvell.com>
Co-developed-by: Rick Hicksted Jr <rhicksted@marvell.com>
Signed-off-by: Rick Hicksted Jr <rhicksted@marvell.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit fac2807946c10b9a509b9c348afd442fa823c5f7 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9529 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:42:52 +00:00
Bart Van Assche
df4370774b qla2x00t-32gbit: edif: Add send, receive, and accept for auth_els
Some FC adapters from Marvell offer the ability to encrypt data in flight
(EDIF). This feature requires an application to act as an authenticator.

Add the ability for authentication application to send and retrieve
messages as part of the authentication process via existing
FC_BSG_HST_ELS_NOLOGIN BSG interface.

To send a message, application is expected to format the data in the AUTH
ELS format. Refer to FC-SP2 for details.

If a message was received, application is required to reply with either a
LS_ACC or LS_RJT complete the exchange using the same interface. Otherwise,
remote device will treat it as a timeout.

Link: https://lore.kernel.org/r/20210624052606.21613-4-njavali@marvell.com
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Co-developed-by: Larry Wisneski <Larry.Wisneski@marvell.com>
Signed-off-by: Larry Wisneski <Larry.Wisneski@marvell.com>
Co-developed-by: Duane Grigsby <duane.grigsby@marvell.com>
Signed-off-by: Duane Grigsby <duane.grigsby@marvell.com>
Co-developed-by: Rick Hicksted Jr <rhicksted@marvell.com>
Signed-off-by: Rick Hicksted Jr <rhicksted@marvell.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 84318a9f01ce13650ea23eb6362066bb95ccc9fe upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9528 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:42:26 +00:00
Bart Van Assche
54e6815ea3 qla2x00t-32gbit: edif: Add getfcinfo and statistic bsgs
Some FC adapters from Marvell offer the ability to encrypt data in flight
(EDIF). This feature requires an application to act as an authenticator.

Add two new BSG calls:

- QL_VND_SC_GET_FCINFO: Application can from time to time request a list
of all FC ports or a single device that supports secure connection.  If
driver sees a new or old device has logged into the switch, this call is
used to check for the WWPN.

- QL_VND_SC_GET_STATS: Application request for various statistics for each
FC port.

Link: https://lore.kernel.org/r/20210624052606.21613-3-njavali@marvell.com
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Co-developed-by: Larry Wisneski <Larry.Wisneski@marvell.com>
Signed-off-by: Larry Wisneski <Larry.Wisneski@marvell.com>
Co-developed-by: Duane Grigsby <duane.grigsby@marvell.com>
Signed-off-by: Duane Grigsby <duane.grigsby@marvell.com>
Co-developed-by: Rick Hicksted Jr <rhicksted@marvell.com>
Signed-off-by: Rick Hicksted Jr <rhicksted@marvell.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 7878f22a2e03b69baf792f74488962981a1c9547 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9527 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:42:22 +00:00
Bart Van Assche
b4d044c056 qla2x00t-32gbit: edif: Add start + stop bsgs
Some FC adapters from Marvell offer the ability to encrypt data in flight
(EDIF). This feature requires an application to act as an authenticator.

Add two new BSG calls:

 - QL_VND_SC_APP_START: Application will announce its presence to driver
   with this call. Driver will restart all connections to see if remote
   device supports security or not.

 - QL_VND_SC_APP_STOP: Application announces it is in the process of
   exiting. Driver will restart all connections to revert back to
   non-secure. Provided the remote device is willing to allow a non-secure
   connection.

Link: https://lore.kernel.org/r/20210624052606.21613-2-njavali@marvell.com
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Co-developed-by: Larry Wisneski <Larry.Wisneski@marvell.com>
Signed-off-by: Larry Wisneski <Larry.Wisneski@marvell.com>
Co-developed-by: Duane Grigsby <duane.grigsby@marvell.com>
Signed-off-by: Duane Grigsby <duane.grigsby@marvell.com>
Co-developed-by: Rick Hicksted Jr <rhicksted@marvell.com>
Signed-off-by: Rick Hicksted Jr <rhicksted@marvell.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 7ebb336e45ef1ce23462c3bbd03779929008901f upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9526 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:42:16 +00:00
Bart Van Assche
093f26f4a4 qla2x00t-32gbit: Remove unused variable 'status'
Fix the clang build warning:

  drivers/scsi/qla2xxx/qla_nx.c:2209:6: error: variable 'status' set but not used [-Werror,-Wunused-but-set-variable]
        int status = 0;

Link: https://lore.kernel.org/r/20210726201924.3202278-4-morbo@google.com
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Bill Wendling <morbo@google.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit cb51bcd5c34b0558ba2bb04963bcb1053375a8e4 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9525 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:42:12 +00:00
Bart Van Assche
99df94c0c4 qla2x00t-32gbit: Use the proper SCSI midlayer interfaces for PI
Use the SCSI midlayer interfaces to query protection interval, reference
tag, and per-command DIX flags.

Link: https://lore.kernel.org/r/20210609033929.3815-4-martin.petersen@oracle.com
Reviewed-by: Arun Easi <aeasi@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Message-Id: <20210609033929.3815-4-martin.petersen@oracle.com>
[ commit e2e9cd68fb3c673f7c1e12792f3137b77f6f7431 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9524 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:42:08 +00:00
Bart Van Assche
3ad6f757b5 qla2x00t-32gbit: Remove redundant continue statement in a for-loop
The continue statement at the end of the for-loop is redundant, remove it.

Link: https://lore.kernel.org/r/20210702131542.19880-1-colin.king@canonical.com
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Addresses-Coverity: ("Continue has no effect")
[ commit 37306698c3d023c10a2b1a01baac3089b52412f6 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9523 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:42:03 +00:00
Bart Van Assche
d53ef52a58 qla2x00t-32gbit: Add heartbeat check
Use "no-op" mailbox command to check if the adapter firmware is still
responsive.

Link: https://lore.kernel.org/r/20210619052427.6440-1-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit d94d8158e1841813624e9fecf93a12e64e004dd8 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9522 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:41:57 +00:00
Bart Van Assche
f96773f1ac qla2x00t-32gbit: Use list_move_tail() instead of list_del()/list_add_tail()
Using list_move_tail() instead of list_del() + list_add_tail().

Link: https://lore.kernel.org/r/20210609072321.1356896-1-libaokun1@huawei.com
Reported-by: Hulk Robot <hulkci@huawei.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Baokun Li <libaokun1@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit b6e7fba0c9ccba96198762b1b51559543466de03 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9521 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:41:53 +00:00
Bart Van Assche
b4dbbb5359 qla2x00t-32gbit: Remove duplicate declarations
qla2x00_post_uevent_work(), qla2x00_free_fcport() and ql2xexlogins are
declared multiple times. Remove the duplicates.

Link: https://lore.kernel.org/r/1621843402-34828-1-git-send-email-zhangshaokun@hisilicon.com
Cc: Nilesh Javali <njavali@marvell.com>
Cc: GR-QLogic-Storage-Upstream@marvell.com
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 9dda74f3436449e1a4087e05fef583ccfd689bdd upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9520 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:41:45 +00:00