linux/drivers/s390
Steffen Maier 8221211863 scsi: zfcp: decouple SCSI traces for scsi_eh / TMF from scsi_cmnd
The SCSI command pointer passed to scsi_eh callbacks is just one arbitrary
command of potentially many that are in the eh queue to be processed.  The
command is only used to indirectly pass the TMF scope in terms of SCSI
ID/target and SCSI LUN for LUN reset.

Hence, zfcp had filled in SCSI trace record fields which do not really
belong to the TMF. This was confusing.

Therefore, refactor the TMF tracing to work without SCSI command.  Since the
FCP channel always requires a valid LUN handle, we use SCSI device as common
context for any TMF (even target reset).  To make it even clearer, we set
all bits to 1 for the fields, which do not belong to the TMF, to indicate
that these fields are invalid.

The old zfcp_dbf_scsi() became zfcp_dbf_scsi_common() to now handle both
SCSI commands and TMFs. The old argument scsi_cmnd is now optional and can
be NULL with TMFs. The new argument scsi_device is mandatory to carry
context, as well as SCSI ID/target and SCSI LUN in case of TMFs.

New example trace record formatted with zfcpdbf from s390-tools:

Timestamp      : ...
Area           : SCSI
Subarea        : 00
Level          : 1
Exception      : -
CPU ID         : ..
Caller         : 0x...
Record ID      : 1
Tag            : [lt]r_....
Request ID     : 0x<reqid>              ID of FSF FCP request with TM flag
                 For cases without FSF request: 0x0 for none (invalid)
SCSI ID        : 0x<scsi_id>            SCSI ID/target denoting scope
SCSI LUN       : 0x<scsi_lun>           SCSI LUN denoting scope
SCSI LUN high  : 0x<scsi_lun_high>      SCSI LUN denoting scope
SCSI result    : 0xffffffff                             none (invalid)
SCSI retries   : 0xff                                   none (invalid)
SCSI allowed   : 0xff                                   none (invalid)
SCSI scribble  : 0xffffffffffffffff                     none (invalid)
SCSI opcode    : ffffffff ffffffff ffffffff ffffffff    none (invalid)
FCP rsp inf cod: 0x00                   FCP_RSP info code of TMF
FCP rsp IU     : 00000000 00000000 00000100 00000000 ext FCP_RSP IU
                 00000000 00000008                   ext FCP_RSP IU
FCP rsp IU len : 32                                  FCP_RSP IU length
Payload time   : ...
FCP rsp IU all : 00000000 00000000 00000100 00000000 full FCP_RSP IU
                 00000000 00000008 00000000 00000000 full FCP_RSP IU

Signed-off-by: Steffen Maier <maier@linux.ibm.com>
Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-05-18 11:22:11 -04:00
..
block libnvdimm for 4.17 2018-04-10 10:25:57 -07:00
char s390/defkeymap: fix global init to zero 2018-03-18 23:02:02 -07:00
cio s390: assume diag308 set always works 2018-04-10 07:38:59 +02:00
crypto s390/zcrypt: Support up to 256 crypto adapters. 2018-04-11 10:36:27 +02:00
net Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2018-04-09 09:04:10 -07:00
scsi scsi: zfcp: decouple SCSI traces for scsi_eh / TMF from scsi_cmnd 2018-05-18 11:22:11 -04:00
virtio virtio/s390: implement PM operations for virtio_ccw 2018-02-14 14:34:09 +02:00
Makefile kbuild: rename built-in.o to built-in.a 2018-03-26 02:01:19 +09:00