Commit Graph

7293 Commits

Author SHA1 Message Date
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
Bart Van Assche
a592caeee0 qla2x00t-32gbit: Log PCI address in qla_nvme_unregister_remote_port()
Pass in fcport->vha to ql_log() in order to add the PCI address to the log.

Currently NULL is passed in which gives this confusing log entry:

> qla2xxx [0000:00:00.0]-2112: : qla_nvme_unregister_remote_port: unregister remoteport on 0000000009d6a2e9 50000973981648c7

Link: https://lore.kernel.org/r/20210531122444.116655-1-dwagner@suse.de
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 27c707b14659287f793402ad8ca26ada7e3e8c51 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9519 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:41:41 +00:00
Bart Van Assche
24c412ac4f qla2x00t-32gbit: Introduce scsi_build_sense()
Introduce scsi_build_sense() as a wrapper around scsi_build_sense_buffer()
to format the buffer and set the correct SCSI status.

Link: https://lore.kernel.org/r/20210427083046.31620-8-hare@suse.de
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit f2b1e9c6f867ec8f929e96ba4e4010e267587448 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9518 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:41:37 +00:00
Bart Van Assche
53ff3d31e5 qla2x00t-32gbit: Wait for stop_phase1 at WWN removal
Target de-configuration panics at high CPU load because TPGT and WWPN can
be removed on separate threads.

TPGT removal requests a reset HBA on a separate thread and waits for reset
complete (phase1). Due to high CPU load that HBA reset can be delayed for
some time.

WWPN removal does qlt_stop_phase2(). There it is believed that phase1 has
already completed and thus tgt.tgt_ops is subsequently cleared. However,
tgt.tgt_ops is needed to process incoming traffic and therefore this will
cause one of the following panics:

NIP qlt_reset+0x7c/0x220 [qla2xxx]
LR  qlt_reset+0x68/0x220 [qla2xxx]
Call Trace:
0xc000003ffff63a78 (unreliable)
qlt_handle_imm_notify+0x800/0x10c0 [qla2xxx]
qlt_24xx_atio_pkt+0x208/0x590 [qla2xxx]
qlt_24xx_process_atio_queue+0x33c/0x7a0 [qla2xxx]
qla83xx_msix_atio_q+0x54/0x90 [qla2xxx]

or

NIP qlt_24xx_handle_abts+0xd0/0x2a0 [qla2xxx]
LR  qlt_24xx_handle_abts+0xb4/0x2a0 [qla2xxx]
Call Trace:
qlt_24xx_handle_abts+0x90/0x2a0 [qla2xxx] (unreliable)
qlt_24xx_process_atio_queue+0x500/0x7a0 [qla2xxx]
qla83xx_msix_atio_q+0x54/0x90 [qla2xxx]

or

NIP qlt_create_sess+0x90/0x4e0 [qla2xxx]
LR  qla24xx_do_nack_work+0xa8/0x180 [qla2xxx]
Call Trace:
0xc0000000348fba30 (unreliable)
qla24xx_do_nack_work+0xa8/0x180 [qla2xxx]
qla2x00_do_work+0x674/0xbf0 [qla2xxx]
qla2x00_iocb_work_fn

The patch fixes the issue by serializing qlt_stop_phase1() and
qlt_stop_phase2() functions to make WWPN removal wait for phase1
completion.

Link: https://lore.kernel.org/r/20210415203554.27890-1-d.bogdanov@yadro.com
Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com>
Signed-off-by: Dmitry Bogdanov <d.bogdanov@yadro.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 2ef7665dfd88830f15415ba007c7c9a46be7acd8 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9517 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:41:32 +00:00
Bart Van Assche
1c71df72ea qla2x00t-32gbit: Remove redundant assignment to rval
Variable rval is set to QLA_SUCCESS but this value is never read as it is
overwritten later on. Hence it is a redundant assignment and can be
removed.

Clean up the following clang-analyzer warning:

drivers/scsi/qla2xxx/qla_init.c:4359:2: warning: Value stored to 'rval'
is never read [clang-analyzer-deadcode.DeadStores].

Link: https://lore.kernel.org/r/1620643206-127930-1-git-send-email-jiapeng.chong@linux.alibaba.com
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit cb9eb11fd57215020c6649bbe884232fb0f80bdd upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9516 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:41:29 +00:00
Bart Van Assche
d3fa7881a9 qla2x00t-32gbit: Fix error return code in qla82xx_write_flash_dword()
Fix to return a negative error code from the error handling case instead of
0 as done elsewhere in this function.

Link: https://lore.kernel.org/r/20210514090952.6715-1-thunder.leizhen@huawei.com
Fixes: a9083016a531 ("[SCSI] qla2xxx: Add ISP82XX support.")
Reported-by: Hulk Robot <hulkci@huawei.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 5cb289bf2d7c34ca1abd794ce116c4f19185a1d4 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9515 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:41:24 +00:00
Bart Van Assche
12fc79c804 nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9514 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 15:34:07 +00:00
Bart Van Assche
a891d6e9ba scst/include/backport.h: Backport more kernel functions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9513 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 03:29:32 +00:00
Bart Van Assche
db29b3330d qla2x00t-32gbit: Bump the minimum kernel version to v3.18
Patches that will be applied later for this driver require kernel version
v3.18.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9512 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 03:14:00 +00:00
Bart Van Assche
34b4ac48ed qla2x00t: Fix three kernel-doc headers
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9511 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 03:11:34 +00:00
Bart Van Assche
13def89b5f qla2x00t-32gbit: Simplify the backwards compatibility code
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9510 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 03:08:34 +00:00
Bart Van Assche
bd5b6fad83 qla2x00t: Simplify the backwards compatibility code
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9509 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 03:08:01 +00:00
Bart Van Assche
a0e65bb9c9 scst/include/backport.h: Improve the kernel backports that add support for v5.14
Unbreak the build against kernels v4.10 and older.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9508 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 02:57:50 +00:00
Bart Van Assche
a32cbdfdf4 nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9507 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-04 02:33:39 +00:00
Bart Van Assche
a88053adf5 scst: Port to Linux kernel v5.14
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9506 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-03 05:09:57 +00:00
Bart Van Assche
3624c1baaf scst: Open-code the status_byte() macro
The status_byte() macro and also the SAM_STAT_* macros shifted right by one
bit have been removed from kernel v5.14. Hence open-code status_byte() and
change GOOD into SAM_STAT_GOOD etc.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9505 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-03 05:05:13 +00:00
Bart Van Assche
6edaec0d40 scst: Make msg_byte() and driver_byte() available when building against v5.14
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9504 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-03 05:01:43 +00:00
Bart Van Assche
cb74f66766 scst_local: Port to Linux kernel v5.15
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9503 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-03 04:59:06 +00:00
Bart Van Assche
bdf56c04b6 qla2x00t: Use scsi_build_sense()
This patch fixes a bug by changing SAM_STAT_CHECK_CONDITION << 1 into
SAM_STAT_CHECK_CONDITION in the SCSI result code.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9502 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-03 04:57:38 +00:00
Bart Van Assche
16f0eb9177 scst: Backport the SCSI functions that are new in kernels v5.14 and v5.15
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9501 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-03 04:56:13 +00:00
Bart Van Assche
309d11589a qla2x00t: Use the fallthrough keyword to annotate switch/case fallthrough
This patch prevents that a compiler warning is reported when building this
driver against kernel v5.14.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9500 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-03 02:35:53 +00:00
Bart Van Assche
078e1b774c qla2x00t/qla_bsg: Fix error codes
Use the proper error codes when reporting a BSG error. The DID_* codes are
the codes that are shifted left 16 bits while the DRIVER_* codes must be
shifted left 24 bits.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9499 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-03 02:34:47 +00:00
Bart Van Assche
5e90abb64a scst_copy_mgr: Implement a workaround for non-compliant initiator systems
Reported-by: Eitan Cohen <eitancohen456@gmail.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9498 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-01 04:33:22 +00:00
Bart Van Assche
3a1763bc73 isert-scst: Fix typo in the PRINT_INFO statement for sockaddr output
Fixes: 5d808c54 ("isert-scst: Introduce the function isert_setup_id()")
Signed-off-by: Chesnokov Gleb <Chesnokov.G@raidix.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9497 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-08-31 02:00:40 +00:00
Bart Van Assche
d5cee6ebf4 Makefile: Make sure that $(KVER) and $(KDIR) are set
These variables are needed for building Debian packages.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9496 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-08-27 17:58:27 +00:00
Bart Van Assche
27a74601a5 Makefile, dpkg: Show $(KVER) and $(KDIR) while building a Debian package
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9495 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-08-27 17:57:47 +00:00
Bart Van Assche
8042466117 scstadmin/init.d/scst: Remove the 'which' invocation
Remove the invocation of the 'which' command since that command has been
deprecated in Debian 11 and since I am not aware of any other portable
approach for querying the path of a command.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9494 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-08-27 17:56:28 +00:00
Bart Van Assche
5dd069d3d6 scst: Do not affect weak updates during installation
The code for removing weak updates did not fix the reported issue.
Additionally, that code can remove weak updates that are not related to
SCST. Hence remove the code again that removes weak updates.

Reported-by: Tu, Rongqing <rongqing.tu@hpe.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9493 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-08-20 03:36:16 +00:00
Bart Van Assche
c11f216fed scst_copy_mgr: Fix support for auto_cm_assignment=0
Only check whether a LUN has already been registered with the copy manager
for the auto_cm_assignment=1 case since with auto CM assignment disabled
scst_cm_dev_register() is called after the LUN has been registered.

Reported-by: Eitan Cohen <eitancohen456@gmail.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9492 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-08-19 04:15:16 +00:00
Bart Van Assche
6691b60c39 scst: Fix copy manager LUN assignment for auto_cm_assignment=0
The INQUIRY command sent by the copy manager can only succeed if the LUN it
is submitted to exists before the INQUIRY command is sent. Hence this patch
that swaps the order of the scst_cm_on_add_lun() and scst_alloc_add_tgt_dev()
calls in scst_acg_add_lun(). This patch prevents that the INQUIRY commands
submitted by the copy manager fail as follows:

Not supported dev type 7f, ignoring

Reported-by: Eitan Cohen <eitancohen456@gmail.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9491 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-08-19 04:12:36 +00:00
Bart Van Assche
df8d3d223a Debian: Fix Makefile syntax for 'make dpkg'
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9490 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-08-19 04:11:11 +00:00
Bart Van Assche
0e43a7eb8f nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9489 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-08-15 18:35:08 +00:00
Bart Van Assche
84d335f131 scst_local: Make the SCSI host number available in sysfs
An example for the following SCST configuration:

TARGET_DRIVER scst_local {
	TARGET scst_local_tgt {
		session_name scst_local_host

		LUN 0 dummy
		LUN 1 test1
		LUN 2 test2
	}
}
    
$ cat /sys/kernel/scst_tgt/targets/scst_local/scst_local_tgt/sessions/scst_local_host/host_no
9


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9488 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-08-14 03:24:11 +00:00