diff options
author | Keith Busch <keith.busch@intel.com> | 2018-06-29 16:50:01 -0600 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2018-07-23 09:35:19 +0200 |
commit | 5d87eb94d9ba13e5e2d5ceb56ac6fe0948259ffa (patch) | |
tree | 06ce6e09f965fd881cce0614053d9015e2fd09e5 /drivers/nvme/host/nvme.h | |
parent | 59e29ce66bc52ebd6d0cb450f13079c7e913430d (diff) | |
download | linux-5d87eb94d9ba13e5e2d5ceb56ac6fe0948259ffa.tar.bz2 |
nvme: use hw qid in trace events
We can not match a command to its completion based on the command
id alone. We need the submitting queue identifier to pair with the
completion, so this patch adds that to the trace buffer.
This patch is also collapsing the admin and IO submission traces into a
single one so we don't need to duplicate this and creating unnecessary
code branches: we know if the command is an admin vs IO based on the qid.
And since we're here, the patch fixes code formatting in the area.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
[hch: move the qid helper to nvme.h and made it an inline function]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme/host/nvme.h')
-rw-r--r-- | drivers/nvme/host/nvme.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h index f2249387b60d..4ad0c8ad2a27 100644 --- a/drivers/nvme/host/nvme.h +++ b/drivers/nvme/host/nvme.h @@ -120,6 +120,13 @@ static inline struct nvme_request *nvme_req(struct request *req) return blk_mq_rq_to_pdu(req); } +static inline u16 nvme_req_qid(struct request *req) +{ + if (!req->rq_disk) + return 0; + return blk_mq_unique_tag_to_hwq(blk_mq_unique_tag(req)) + 1; +} + /* The below value is the specific amount of delay needed before checking * readiness in case of the PCI_DEVICE(0x1c58, 0x0003), which needs the * NVME_QUIRK_DELAY_BEFORE_CHK_RDY quirk enabled. The value (in ms) was |