8786 Commits

Author SHA1 Message Date
Gleb Chesnokov
092e8e34c0 sysfs: Add debug logs for sysfs attribute calls 2022-11-02 12:59:33 +03:00
Gleb Chesnokov
3961019e74 ib_srpt: Port to Linux kernel v6.1
Support for the following IB changes in the Linux kernel v6.1:
- 91a3f14ec953 ("IB/cm: Remove the service_mask parameter from ib_cm_listen()")
2022-10-27 12:31:00 +03:00
Gleb Chesnokov
45f9f12bb3 iscsi-scst: Remove cm_listen conftest
Remove cm_listen conftest because iscsi-scst doesn't use ib_cm_listen API.
2022-10-27 12:31:00 +03:00
Gleb Chesnokov
79492d9233 qla2x00t-32gbit: Drop DID_TARGET_FAILURE use
DID_TARGET_FAILURE is internal to the SCSI layer. Drivers must not use it
because:

 1. It's not propagated upwards, so SG IO/passthrough users will not see an
    error and think a command was successful.

 2. There is no handling for it in scsi_decide_disposition() so it
    results in entering SCSI error handling.

This has qla2xxx use DID_NO_CONNECT because it looks like we hit this error
when we can't find a port. It will give us the same hard error behavior and
it seems to match the error where we can't find the endpoint.

Link: https://lore.kernel.org/r/20220812010027.8251-7-michael.christie@oracle.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit a965d35c8741 upstream ]
2022-10-27 12:31:00 +03:00
Gleb Chesnokov
534bbd33b3 qla2x00t-32gbit: Port to Linux kernel v6.1
Support for the following block layer changes in the Linux kernel v6.1:
- a4e1d0b76e7b ("block: Change the return type of blk_mq_map_queues() into void")
2022-10-27 12:31:00 +03:00
Gleb Chesnokov
20ec24e076 scst_lib: Port to Linux kernel v6.1
Support for the following block layer changes in the Linux kernel v6.1:
- de671d6116b5 ("block: change request end_io handler to pass back a return value")
2022-10-27 12:31:00 +03:00
Gleb Chesnokov
9a7ec775ce scst_dlm: Port to Linux kernel v6.1
Support for the following vfs file changes in the Linux kernel v6.1:
- 25885a35a720 ("Change calling conventions for filldir_t")

Support for the following dlm changes in the Linux kernel v6.1:
- 12cda13cfd53 ("fs: dlm: remove DLM_LSFL_FS from uapi")
2022-10-27 12:31:00 +03:00
Gleb Chesnokov
1863f8c5c8 scripts: Remove references to the ibmvstgt, mpt and mvsas_tgt drivers 2022-10-25 10:44:54 +03:00
Gleb Chesnokov
d137b37fe1 scst_lib: Fix handling of a SENSE with buffer size 0
Sending a REQUEST_SENSE with a buffer size 0 to the LUN that does not
exist causes the following kernel panic:

RIP: 0010:sg_init_table+0x1e/0x30
Call Trace:
  scst_alloc_sg+0xc3/0x270 [scst]
  scst_set_cmd_error+0x803/0xa40 [scst]
  __scst_init_cmd+0x5c3/0xb80 [scst]
  scst_cmd_init_done+0x142/0xae0 [scst]
  cmnd_rx_start+0x7f5/0x13d0 [iscsi_scst]
  isert_pdu_rx+0x54/0x140 [isert_scst]
  isert_recv_completion_handler+0x498/0x580 [isert_scst]
  isert_poll_cq+0x396/0x800 [isert_scst]
  isert_cq_comp_work_cb+0x4a/0x120 [isert_scst]
  process_one_work+0x1d1/0x410
  worker_thread+0x2b/0x3d0
  kthread+0x11a/0x130
  ret_from_fork+0x1f/0x40

Hence set bufflen to 18 if a buffer size 0 was passed to avoid the
crash.

Reported-by: Lev Vainblat <lev@zadarastorage.com>
2022-10-23 18:31:38 +03:00
Gleb Chesnokov
54eeae329b scst_lib: Fix handling of an INQUIRY with buffer size 0
Sending an INQUIRY with a buffer size 0 to the LUN that does not exist
causes the following kernel panic:

RIP: 0010:sg_init_table+0x1e/0x30
Call Trace:
  scst_alloc_sg+0xc3/0x270 [scst]
  scst_set_cmd_error+0x8c9/0xa80 [scst]
  __scst_init_cmd+0x5c3/0xb80 [scst]
  scst_cmd_init_done+0x142/0xae0 [scst]
  cmnd_rx_start+0x7f5/0x13d0 [iscsi_scst]
  isert_pdu_rx+0x54/0x140 [isert_scst]
  isert_recv_completion_handler+0x498/0x580 [isert_scst]
  isert_poll_cq+0x396/0x800 [isert_scst]
  isert_cq_comp_work_cb+0x4a/0x120 [isert_scst]
  process_one_work+0x1d1/0x410
  worker_thread+0x2b/0x3d0
  kthread+0x11a/0x130
  ret_from_fork+0x1f/0x40

Hence set bufflen to 36 if a buffer size 0 was passed to avoid the
crash.

Reported-by: Lev Vainblat <lev@zadarastorage.com>
2022-10-23 18:31:38 +03:00
Gleb Chesnokov
9d83d8c28a scst_lib: Fix quoted string split across lines
This patch doesn't change any functionality.
2022-10-23 18:31:38 +03:00
Gleb Chesnokov
0c609d56a2 scst/include/backport.h: Remove support for RHEL5
The SCST has dropped support for RHEL5 since SCST v3.6.
2022-10-23 18:31:38 +03:00
Gleb Chesnokov
0c07b92b19 nightly build: Update kernel versions 2022-10-04 20:01:36 +03:00
Gleb Chesnokov
9f13194628 qla2x00t-32gbit: Fix memory leak in __qlt_24xx_handle_abts()
Commit 8f394da36a36 ("scsi: qla2xxx: Drop TARGET_SCF_LOOKUP_LUN_FROM_TAG")
made the __qlt_24xx_handle_abts() function return early if
tcm_qla2xxx_find_cmd_by_tag() didn't find a command, but it missed to clean
up the allocated memory for the management command.

Link: https://lore.kernel.org/r/20220914024924.695604-1-rafaelmendsr@gmail.com
Fixes: 8f394da36a36 ("scsi: qla2xxx: Drop TARGET_SCF_LOOKUP_LUN_FROM_TAG")
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Rafael Mendonca <rafaelmendsr@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 601be20fc6a1 upstream ]
2022-09-26 13:04:38 +03:00
Gleb Chesnokov
fa1a8e1ee5 scst/include/backport.h: Fix the build against CentOS 8-stream
Fixes: https://github.com/SCST-project/scst/issues/77
2022-09-15 12:17:52 +03:00
Gleb Chesnokov
102398a61f scripts/update-version: Update the SCST_VERSION_CODE
SCST_VERSION_CODE has not been updated since SCST v3.4 because
the update-version script used the wrong file for parsing. Hence fix
the update-version script and SCST_VERSION_CODE.
2022-09-14 12:36:33 +03:00
Gleb Chesnokov
5769ac8429 qla2x00t-32gbit: Disable ATIO interrupt coalesce for quad port ISP27XX
This partially reverts commit d2b292c3f6fd ("scsi: qla2xxx: Enable ATIO
interrupt handshake for ISP27XX")

For some workloads where the host sends a batch of commands and then
pauses, ATIO interrupt coalesce can cause some incoming ATIO entries to be
ignored for extended periods of time, resulting in slow performance,
timeouts, and aborted commands.

Disable interrupt coalesce and re-enable the dedicated ATIO MSI-X
interrupt.

Link: https://lore.kernel.org/r/97dcf365-89ff-014d-a3e5-1404c6af511c@cybernetics.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Reviewed-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Tony Battersby <tonyb@cybernetics.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 53661ded2460 upstream ]
2022-09-13 11:47:01 +03:00
Gleb Chesnokov
807e2c31a6 qla2x00t-32gbit: Update version to 10.02.07.800-k
Link: https://lore.kernel.org/r/20220713052045.10683-11-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 6c20cc4885c5 upstream ]
2022-09-13 11:47:01 +03:00
Gleb Chesnokov
d3a4565a4a qla2x00t-32gbit: Update manufacturer details
Update manufacturer details to indicate Marvell Semiconductors.

Link: https://lore.kernel.org/r/20220713052045.10683-10-njavali@marvell.com
Cc: stable@vger.kernel.org
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Bikash Hazarika <bhazarika@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 1ccad27716ec upstream ]
2022-09-13 11:47:01 +03:00
Gleb Chesnokov
0f7d7d7d70 qla2x00t-32gbit: Fix sparse warning for dport_data
Use le16_to_cpu to fix sparse warning reported for dport_data.

sparse warnings: (new ones prefixed by >>)
>> drivers/scsi/qla2xxx/qla_bsg.c:2485:34: sparse: sparse: incorrect
>> type in assignment (different base types) @@ expected unsigned
>> short [usertype] mbx1 @@ got restricted __le16 @@
   drivers/scsi/qla2xxx/qla_bsg.c:2485:34: sparse: expected unsigned short [usertype] mbx1
      drivers/scsi/qla2xxx/qla_bsg.c:2485:34: sparse: got restricted __le16
>> drivers/scsi/qla2xxx/qla_bsg.c:2486:34: sparse: sparse:
>> incorrect type in assignment (different base types) @@
>> expected unsigned short [usertype] mbx2 @@ got restricted __le16 @@
   drivers/scsi/qla2xxx/qla_bsg.c:2486:34: sparse: expected unsigned short [usertype] mbx2
   drivers/scsi/qla2xxx/qla_bsg.c:2486:34: sparse: got restricted __le16

Link: https://lore.kernel.org/r/20220713052045.10683-9-njavali@marvell.com
Fixes: 476da8faa336 ("scsi: qla2xxx: Add a new v2 dport diagnostic feature")
Cc: stable@vger.kernel.org
Reported-by: kernel test robot <lkp@intel.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 166d74b876b7 upstream ]
2022-09-13 11:47:01 +03:00
Gleb Chesnokov
9faab8c7e2 qla2x00t-32gbit: Fix discovery issues in FC-AL topology
A direct attach tape device, when gets swapped with another, was not
discovered. Fix this by looking at loop map and reinitialize link if there
are devices present.

Link: https://lore.kernel.org/linux-scsi/baef87c3-5dad-3b47-44c1-6914bfc90108@cybernetics.com/
Link: https://lore.kernel.org/r/20220713052045.10683-8-njavali@marvell.com
Cc: stable@vger.kernel.org
Reported-by: Tony Battersby <tonyb@cybernetics.com>
Tested-by: Tony Battersby <tonyb@cybernetics.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 47ccb113cead upstream ]
2022-09-13 11:47:01 +03:00
Gleb Chesnokov
4043e70f2e qla2x00t-32gbit: Fix imbalance vha->vref_count
vref_count took an extra decrement in the task management path.  Add an
extra ref count to compensate the imbalance.

Link: https://lore.kernel.org/r/20220713052045.10683-7-njavali@marvell.com
Cc: stable@vger.kernel.org
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 63fa7f2644b4 upstream ]
2022-09-13 11:47:01 +03:00
Gleb Chesnokov
fa2bf1d69d qla2x00t-32gbit: edif: Fix dropped IKE message
This patch fixes IKE message being dropped due to error in processing Purex
IOCB and Continuation IOCBs.

Link: https://lore.kernel.org/r/20220713052045.10683-6-njavali@marvell.com
Fixes: fac2807946c1 ("scsi: qla2xxx: edif: Add extraction of auth_els from the wire")
Cc: stable@vger.kernel.org
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 c019cd656e71 upstream ]
2022-09-13 11:47:01 +03:00
Gleb Chesnokov
a6b7e6e0bf qla2x00t-32gbit: Fix response queue handler reading stale packets
On some platforms, the current logic of relying on finding new packet
solely based on signature pattern can lead to driver reading stale
packets. Though this is a bug in those platforms, reduce such exposures by
limiting reading packets until the IN pointer.

Two module parameters are introduced:

  ql2xrspq_follow_inptr:

    When set, on newer adapters that has queue pointer shadowing, look for
    response packets only until response queue in pointer.

    When reset, response packets are read based on a signature pattern
    logic (old way).

  ql2xrspq_follow_inptr_legacy:

    Like ql2xrspq_follow_inptr, but for those adapters where there is no
    queue pointer shadowing.

Link: https://lore.kernel.org/r/20220713052045.10683-5-njavali@marvell.com
Cc: stable@vger.kernel.org
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 b1f707146923 upstream ]
2022-09-13 11:47:01 +03:00
Gleb Chesnokov
a891b97b3b qla2x00t-32gbit: Zero undefined mailbox IN registers
While requesting a new mailbox command, driver does not write any data to
unused registers.  Initialize the unused register value to zero while
requesting a new mailbox command to prevent stale entry access by firmware.

Link: https://lore.kernel.org/r/20220713052045.10683-4-njavali@marvell.com
Cc: stable@vger.kernel.org
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Bikash Hazarika <bhazarika@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 6c96a3c7d495 upstream ]
2022-09-13 11:47:01 +03:00
Gleb Chesnokov
fadf76ffc4 qla2x00t-32gbit: Fix incorrect display of max frame size
Replace display field with the correct field.

Link: https://lore.kernel.org/r/20220713052045.10683-3-njavali@marvell.com
Fixes: 8777e4314d39 ("scsi: qla2xxx: Migrate NVME N2N handling into state machine")
Cc: stable@vger.kernel.org
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Bikash Hazarika <bhazarika@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit cf3b4fb65579 upstream ]
2022-09-13 11:47:01 +03:00
Gleb Chesnokov
9dcf496c60 qla2x00t-32gbit: Revert "qla2x00t-32gbit: Fix disk failure to rediscover"
This fixes the regression of NVMe discovery failure during driver load
time.

This reverts commit 6a45c8e137d4e2c72eecf1ac7cf64f2fdfcead99.

Link: https://lore.kernel.org/r/20220713052045.10683-2-njavali@marvell.com
Cc: stable@vger.kernel.org
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 5bc7b01c513a upstream ]
2022-09-13 11:47:01 +03:00
Gleb Chesnokov
796caf71dd qla2x00t-32gbit: Check correct variable in qla24xx_async_gffid()
There is a copy and paste bug here.  It should check ".rsp" instead of
".req".  The error message is copy and pasted as well so update that too.

Link: https://lore.kernel.org/r/YrK1A/t3L6HKnswO@kili
Fixes: 9c40c36e75ff ("scsi: qla2xxx: edif: Reduce Initiator-Initiator thrashing")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 7c33e477bd88 upstream ]
2022-09-13 11:47:01 +03:00
Gleb Chesnokov
94c2c4ce38 qla2x00t-32gbit: Update version to 10.02.07.700-k
Link: https://lore.kernel.org/r/20220616053508.27186-12-njavali@marvell.com
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 4de0d18da901 upstream ]
2022-09-13 11:29:40 +03:00
Gleb Chesnokov
7eddc7eed5 qla2x00t-32gbit: Fix erroneous mailbox timeout after PCI error injection
Clear wait for mailbox interrupt flag to prevent stale mailbox:

Feb 22 05:22:56 ltcden4-lp7 kernel: qla2xxx [0135:90:00.1]-500a:4: LOOP UP detected (16 Gbps).
Feb 22 05:22:59 ltcden4-lp7 kernel: qla2xxx [0135:90:00.1]-d04c:4: MBX Command timeout for cmd 69, ...

To fix the issue, driver needs to clear the MBX_INTR_WAIT flag on purging
the mailbox. When the stale mailbox completion does arrive, it will be
dropped.

Link: https://lore.kernel.org/r/20220616053508.27186-11-njavali@marvell.com
Fixes: b6faaaf796d7 ("scsi: qla2xxx: Serialize mailbox request")
Cc: Naresh Bannoth <nbannoth@in.ibm.com>
Cc: Kyle Mahlkuch <Kyle.Mahlkuch@ibm.com>
Cc: stable@vger.kernel.org
Reported-by: Naresh Bannoth <nbannoth@in.ibm.com>
Tested-by: Naresh Bannoth <nbannoth@in.ibm.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 f260694e6463 upstream ]
2022-09-13 11:29:40 +03:00
Gleb Chesnokov
56cdd6cb66 qla2x00t-32gbit: Fix losing FCP-2 targets on long port disable with I/Os
FCP-2 devices were not coming back online once they were lost, login
retries exhausted, and then came back up.  Fix this by accepting RSCN when
the device is not online.

Link: https://lore.kernel.org/r/20220616053508.27186-10-njavali@marvell.com
Fixes: 44c57f205876 ("scsi: qla2xxx: Changes to support FCP2 Target")
Cc: stable@vger.kernel.org
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 2416ccd3815b upstream ]
2022-09-13 11:29:40 +03:00
Gleb Chesnokov
6e9f5714de qla2x00t-32gbit: Add debug prints in the device remove path
Add a debug print in the devloss callback.

Link: https://lore.kernel.org/r/20220616053508.27186-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 f12d2d130efc upstream ]
2022-09-13 11:29:40 +03:00
Gleb Chesnokov
67f37540fa qla2x00t-32gbit: Fix losing target when it reappears during delete
FC target disappeared during port perturbation tests due to a race that
tramples target state.  Fix the issue by adding state checks before
proceeding.

Link: https://lore.kernel.org/r/20220616053508.27186-8-njavali@marvell.com
Fixes: 44c57f205876 ("scsi: qla2xxx: Changes to support FCP2 Target")
Cc: stable@vger.kernel.org
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 118b0c863c8f upstream ]
2022-09-13 11:29:40 +03:00
Gleb Chesnokov
d3d046017b qla2x00t-32gbit: Fix losing FCP-2 targets during port perturbation tests
When a mix of FCP-2 (tape) and non-FCP-2 targets are present, FCP-2 target
state was incorrectly transitioned when both of the targets were gone. Fix
this by ignoring state transition for FCP-2 targets.

Link: https://lore.kernel.org/r/20220616053508.27186-7-njavali@marvell.com
Fixes: 44c57f205876 ("scsi: qla2xxx: Changes to support FCP2 Target")
Cc: stable@vger.kernel.org
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 58d1c124cd79 upstream ]
2022-09-13 11:29:40 +03:00
Gleb Chesnokov
774351d4b0 qla2x00t-32gbit: Fix crash due to stale SRB access around I/O timeouts
Ensure SRB is returned during I/O timeout error escalation. If that is not
possible fail the escalation path.

Following crash stack was seen:

BUG: unable to handle kernel paging request at 0000002f56aa90f8
IP: qla_chk_edif_rx_sa_delete_pending+0x14/0x30 [qla2xxx]
Call Trace:
 ? qla2x00_status_entry+0x19f/0x1c50 [qla2xxx]
 ? qla2x00_start_sp+0x116/0x1170 [qla2xxx]
 ? dma_pool_alloc+0x1d6/0x210
 ? mempool_alloc+0x54/0x130
 ? qla24xx_process_response_queue+0x548/0x12b0 [qla2xxx]
 ? qla_do_work+0x2d/0x40 [qla2xxx]
 ? process_one_work+0x14c/0x390

Link: https://lore.kernel.org/r/20220616053508.27186-6-njavali@marvell.com
Fixes: d74595278f4a ("scsi: qla2xxx: Add multiple queue pair functionality.")
Cc: stable@vger.kernel.org
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 c39587bc0aba upstream ]
2022-09-13 11:29:40 +03:00
Gleb Chesnokov
056729a7d4 qla2x00t-32gbit: Turn off multi-queue for 8G adapters
For 8G adapters, multi-queue was enabled accidentally. Make sure
multi-queue is not enabled.

Link: https://lore.kernel.org/r/20220616053508.27186-5-njavali@marvell.com
Cc: stable@vger.kernel.org
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 5304673bdb16 upstream ]
2022-09-13 11:29:40 +03:00
Gleb Chesnokov
6e096cba99 qla2x00t-32gbit: Wind down adapter after PCIe error
Put adapter into a wind down state if OS does not make any attempt to
recover the adapter after PCIe error.

Link: https://lore.kernel.org/r/20220616053508.27186-4-njavali@marvell.com
Cc: stable@vger.kernel.org
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 d3117c83ba31 upstream ]
2022-09-13 11:29:40 +03:00
Gleb Chesnokov
ba83b3a49b qla2x00t-32gbit: Add a new v2 dport diagnostic feature
FW requires minimum 72 bytes buffer size for D_port result. Buffer size
1024 is mentioned in the FW spec so buffer size is increased to 1024.
Rewrite the logic to handle START/RESTART command from SDMAPI.

Link: https://lore.kernel.org/r/20220616053508.27186-3-njavali@marvell.com
Signed-off-by: Bikash Hazarika <bhazarika@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 476da8faa336 upstream ]
2022-09-13 11:29:40 +03:00
Gleb Chesnokov
ae2c0e208a qla2x00t-32gbit: Fix excessive I/O error messages by default
Disable printing I/O error messages by default.  The messages will be
printed only when logging was enabled.

Link: https://lore.kernel.org/r/20220616053508.27186-2-njavali@marvell.com
Fixes: 8e2d81c6b5be ("scsi: qla2xxx: Fix excessive messages during device logout")
Cc: stable@vger.kernel.org
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 bff4873c7090 upstream ]
2022-09-13 11:29:40 +03:00
Gleb Chesnokov
92a731d0d7 qla2x00t-32gbit: Update version to 10.02.07.600-k
Link: https://lore.kernel.org/r/20220608115849.16693-11-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 0f4d7d556125 upstream ]
2022-09-13 11:15:41 +03:00
Gleb Chesnokov
1c26699006 qla2x00t-32gbit: edif: Fix slow session teardown
User experience slow recovery when target device went through a stop/start
of the authentication application (app_stop/app_start).

Between the period of app_stop and app_start on the target device, target
device choose to send ELS Reject for any receive AUTH ELS command.  At this
time, authentication application does not do ELS reject if it encounters
error.

Therefore, AUTH ELS reject signify authentication application is not
running. If driver passes up the AUTH ELS Reject to the authentication
application, then it would result in authentication application
retrying/resending the same AUTH ELS command again + delay.

As a work around, driver should trigger a session tear down where it tells
the local authentication application to also tear down.  At the next
relogin, both sides are then synchronized.

Link: https://lore.kernel.org/r/20220608115849.16693-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 bcf536072f74 upstream ]
2022-09-13 11:15:41 +03:00
Gleb Chesnokov
3d0b662f7a qla2x00t-32gbit: edif: Reduce N2N thrashing at app_start time
For N2N + remote WWPN is bigger than local adapter, remote adapter will
login to local adapter while authentication application is not running.
When authentication application starts, the current session in FW needs to
to be invalidated.

Make sure the old session is torn down before triggering a relogin.

Link: https://lore.kernel.org/r/20220608115849.16693-9-njavali@marvell.com
Fixes: 4de067e5df12 ("scsi: qla2xxx: edif: Add N2N support for EDIF")
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 37be3f9d6993 upstream ]
2022-09-13 11:15:41 +03:00
Gleb Chesnokov
9866511082 qla2x00t-32gbit: edif: Fix no logout on delete for N2N
The driver failed to send implicit logout on session delete. For edif, this
failed to flush any lingering SA index in FW.

Set a flag to turn on implicit logout early in the session recovery to make
sure the logout will go out in case of error.

Link: https://lore.kernel.org/r/20220608115849.16693-8-njavali@marvell.com
Fixes: 4de067e5df12 ("scsi: qla2xxx: edif: Add N2N support for EDIF")
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 ec538eb838f3 upstream ]
2022-09-13 11:15:41 +03:00
Gleb Chesnokov
93238e0580 qla2x00t-32gbit: edif: Fix session thrash
Current code prematurely sends out PRLI before authentication application
has given the OK to do so. This causes PRLI failure and session teardown.

Prevents PRLI from going out before authentication app gives the OK.

Link: https://lore.kernel.org/r/20220608115849.16693-7-njavali@marvell.com
Fixes: 91f6f5fbe87b ("scsi: qla2xxx: edif: Reduce connection thrash")
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 a8fdfb0b39c2 upstream ]
2022-09-13 11:15:41 +03:00
Gleb Chesnokov
b9505ddcf8 qla2x00t-32gbit: edif: Tear down session if keys have been removed
If all keys for a session have been deleted, trigger a session teardown.

Link: https://lore.kernel.org/r/20220608115849.16693-6-njavali@marvell.com
Fixes: dd30706e73b7 ("scsi: qla2xxx: edif: Add key update")
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 d7e2e4a68fc0 upstream ]
2022-09-13 11:15:41 +03:00
Gleb Chesnokov
f4ec5bf693 qla2x00t-32gbit: edif: Fix no login after app start
The scenario is this: User loaded driver but has not started authentication
app. All sessions to secure device will exhaust all login attempts, fail,
and in stay in deleted state. Then some time later the app is started. The
driver will replenish the login retry count, trigger delete to prepare for
secure login. After deletion, relogin is triggered.

For the session that is already deleted, the delete trigger is a no-op. If
none of the sessions trigger a relogin, no progress is made.

Add a relogin trigger.

Link: https://lore.kernel.org/r/20220608115849.16693-5-njavali@marvell.com
Fixes: 7ebb336e45ef ("scsi: qla2xxx: edif: Add start + stop bsgs")
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 24c796098f53 upstream ]
2022-09-13 11:15:41 +03:00
Gleb Chesnokov
8f8331fe93 qla2x00t-32gbit: edif: Reduce disruption due to multiple app start
Multiple app start can trigger a session bounce. Make driver skip over
session teardown if app start is seen more than once.

Link: https://lore.kernel.org/r/20220608115849.16693-4-njavali@marvell.com
Fixes: 7ebb336e45ef ("scsi: qla2xxx: edif: Add start + stop bsgs")
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 0dbfce5255fe upstream ]
2022-09-13 11:15:41 +03:00
Gleb Chesnokov
14b62dbee3 qla2x00t-32gbit: edif: Send LOGO for unexpected IKE message
If the session is down and the local port continues to receive AUTH ELS
messages, the driver needs to send back LOGO so that the remote device
knows to tear down its session. Terminate and clean up the AUTH ELS
exchange followed by a passthrough LOGO.

Link: https://lore.kernel.org/r/20220608115849.16693-3-njavali@marvell.com
Fixes: 225479296c4f ("scsi: qla2xxx: edif: Reject AUTH ELS on session down")
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 2b659ed67a12 upstream ]
2022-09-13 11:15:41 +03:00
Gleb Chesnokov
d48d24f4ef qla2x00t-32gbit: edif: Fix I/O timeout due to over-subscription
The current edif code does not keep track of FW IOCB resources.  This led
to IOCB queue full on error recovery (I/O timeout).  Make use of the
existing code that tracks IOCB resources to prevent over-subscription.

Link: https://lore.kernel.org/r/20220608115849.16693-2-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 63ab6cb582fa upstream ]
2022-09-13 11:15:41 +03:00
Gleb Chesnokov
09950e41b5 qla2x00t-32gbit: Update version to 10.02.07.500-k
Link: https://lore.kernel.org/r/20220607044627.19563-12-njavali@marvell.com
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 4dc48a107a14 upstream ]
2022-09-13 10:49:31 +03:00