linux-stable/drivers/nvme/host
Alan Adamson 9f079dda14 nvme: allow passthru cmd error logging
Commit d7ac8dca93 ("nvme: quiet user passthrough command errors")
disabled error logging for user passthrough commands.  This commit
adds the ability to opt-in to passthrough admin error logging. IO
commands initiated as passthrough will always be logged.

The logging output for passthrough commands (Admin and IO) has been
changed to include CDWXX fields.

nvme0n1: Read(0x2), LBA Out of Range (sct 0x0 / sc 0x80) DNR cdw10=0x0 cdw11=0x1
        cdw12=0x70000 cdw13=0x0 cdw14=0x0 cdw15=0x0

Add a helper function nvme_log_err_passthru() which allows us to log
error for passthru commands by decoding cdw10-cdw15 values of nvme
command.

Add a new sysfs attr passthru_err_log_enabled that allows user to conditionally
enable passthrough command logging for either passthrough Admin commands sent to
the controller or passthrough IO commands sent to a namespace.

By default, passthrough error logging is disabled.

To enable passthrough admin error logging:
        echo 1 > /sys/class/nvme/nvme0/passthru_err_log_enabled

To disable passthrough admin error logging:
        echo 0 > /sys/class/nvme/nvme0/passthru_err_log_enabled

To enable passthrough io error logging:
        echo 1 > /sys/class/nvme/nvme0/nvme0n1/passthru_err_log_enabled

To disable passthrough io error logging:
        echo 0 > /sys/class/nvme/nvme0/nvme0n1/passthru_err_log_enabled

Signed-off-by: Alan Adamson <alan.adamson@oracle.com>
Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
2024-02-01 07:44:53 -08:00
..
apple.c nvme: use ctrl state accessor 2024-01-29 07:02:50 -08:00
auth.c nvme: enable retries for authentication commands 2024-01-31 15:59:48 -08:00
constants.c nvme: remove redundant status mask 2024-01-31 16:06:12 -08:00
core.c nvme: allow passthru cmd error logging 2024-02-01 07:44:53 -08:00
fabrics.c nvme: change __nvme_submit_sync_cmd() calling conventions 2024-01-31 15:59:48 -08:00
fabrics.h nvme: use ctrl state accessor 2024-01-29 07:02:50 -08:00
fault_inject.c nvme: fix parameter check in nvme_fault_inject_init() 2023-07-12 08:48:33 -07:00
fc.c nvme-fc: show hostnqn when connecting to fc target 2024-02-01 07:44:52 -08:00
fc.h
hwmon.c nvme: host: hwmon: constify pointers to hwmon_channel_info 2023-08-21 12:54:02 -07:00
ioctl.c for-6.8/io_uring-2024-01-08 2024-01-11 14:19:23 -08:00
Kconfig nvme: improve NVME_HOST_AUTH and NVME_TARGET_AUTH config descriptions 2023-12-04 08:39:03 -08:00
Makefile nvme: rework NVME_AUTH Kconfig selection 2023-10-12 08:04:49 -07:00
multipath.c nvme: use ctrl state accessor 2024-01-29 07:02:50 -08:00
nvme.h nvme: allow passthru cmd error logging 2024-02-01 07:44:53 -08:00
pci.c nvme: split out fabrics version of nvme_opcode_str() 2024-01-31 17:00:45 -08:00
pr.c nvme: introduce nvme_disk_is_ns_head helper 2024-01-05 13:15:41 -08:00
rdma.c nvme-rdma: show hostnqn when connecting to rdma target 2024-02-01 07:44:52 -08:00
sysfs.c nvme: allow passthru cmd error logging 2024-02-01 07:44:53 -08:00
tcp.c nvme-tcp: show hostnqn when connecting to tcp target 2024-02-01 07:44:52 -08:00
trace.c nvme: implement In-Band authentication 2022-08-02 17:14:49 -06:00
trace.h nvme: fix async event trace event 2023-04-13 08:59:04 +02:00
zns.c nvme udpates for Linux 6.8 2023-12-21 14:44:17 -07:00