diff options
author | Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> | 2018-12-12 15:11:39 -0800 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2018-12-13 09:59:02 +0100 |
commit | e4a976254ec5ebdcdb3e1e1b40e795b3db6b6dab (patch) | |
tree | 2f8137e6d7953324185ec62e83dcf5ba0467dbe3 /drivers/nvme/target/nvmet.h | |
parent | b34de7cee0a65f2557bb05447fbe2cc7a9c46750 (diff) | |
download | linux-e4a976254ec5ebdcdb3e1e1b40e795b3db6b6dab.tar.bz2 |
nvmet: add error-log definitions
This patch adds necessary fields in the target data structures to
support error log page. For a target controller, we add a new error log
field to maintain the error log, at any given point we maintain error
entries equal to NVMET_ERROR_LOG_SLOTS for each controller. In the
following patch, we also update the error log page entry in the I/O
completion path so we introduce a spinlock for synchronization of the
log.
For nvmet_req, we add a new field error_loc to hold the location of
the error in the command when the actual error occurs for each request
and a starting LBA if applicable.
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme/target/nvmet.h')
-rw-r--r-- | drivers/nvme/target/nvmet.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/nvme/target/nvmet.h b/drivers/nvme/target/nvmet.h index dafee1af4829..61b3cc415905 100644 --- a/drivers/nvme/target/nvmet.h +++ b/drivers/nvme/target/nvmet.h @@ -202,6 +202,10 @@ struct nvmet_ctrl { struct device *p2p_client; struct radix_tree_root p2p_ns_map; + + spinlock_t error_lock; + u64 err_counter; + struct nvme_error_slot slots[NVMET_ERROR_LOG_SLOTS]; }; struct nvmet_subsys { @@ -317,6 +321,8 @@ struct nvmet_req { struct pci_dev *p2p_dev; struct device *p2p_client; + u16 error_loc; + u64 error_slba; }; extern struct workqueue_struct *buffered_io_wq; |