From: Keith Busch <kbusch@fb.com>
To: <linux-nvme@lists.infradead.org>
Cc: <hch@lst.de>, <sagi@grimberg.me>, Keith Busch <kbusch@kernel.org>
Subject: [PATCH 3/5] nvme-pci: iod npages fits in s8
Date: Thu, 28 Jul 2022 15:11:49 -0700 [thread overview]
Message-ID: <20220728221152.538648-4-kbusch@fb.com> (raw)
In-Reply-To: <20220728221152.538648-1-kbusch@fb.com>
From: Keith Busch <kbusch@kernel.org>
The largest allowed transfer is 4MB, which can use at most 1025 PRPs.
Each PRP is 8 bytes, so the maximum number of 4k nvme pages needed for
the iod_list is 3, which fits in an 's8'.
Signed-off-by: Keith Busch <kbusch@kernel.org>
---
drivers/nvme/host/pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index a8ae043e33de..9e5bbf4e3e07 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -228,7 +228,7 @@ struct nvme_iod {
struct nvme_command cmd;
bool use_sgl;
bool aborted;
- int npages; /* In the PRP list. 0 means small pool in use */
+ s8 npages; /* In the PRP list. 0 means small pool in use */
int nents; /* Used in scatterlist */
dma_addr_t first_dma;
unsigned int dma_len; /* length of single DMA segment mapping */
--
2.30.2
next prev parent reply other threads:[~2022-07-28 22:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-28 22:11 [PATCH 0/5] nvme-pci: iod optimisations Keith Busch
2022-07-28 22:11 ` [PATCH 1/5] nvme-pci: remove nvme_queue from nvme_iod Keith Busch
2022-07-28 22:11 ` [PATCH 2/5] nvme-pci: iod's 'aborted' is a bool Keith Busch
2022-07-28 23:13 ` Chaitanya Kulkarni
2022-07-28 22:11 ` Keith Busch [this message]
2022-07-28 23:14 ` [PATCH 3/5] nvme-pci: iod npages fits in s8 Chaitanya Kulkarni
2022-07-29 13:19 ` Christoph Hellwig
2022-07-28 22:11 ` [PATCH 4/5] nvme-pci: iod nents " Keith Busch
2022-07-28 23:15 ` Chaitanya Kulkarni
2022-07-29 13:21 ` Christoph Hellwig
2022-07-29 15:24 ` Keith Busch
2022-07-28 22:11 ` [PATCH 5/5] nvme-pci: move iod dma_len to better pack Keith Busch
2022-07-28 23:15 ` Chaitanya Kulkarni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220728221152.538648-4-kbusch@fb.com \
--to=kbusch@fb.com \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox