public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] nvmet: use PAGE_SECTORS_SHIFT
@ 2023-07-07  0:32 Damien Le Moal
  2023-07-07 12:46 ` Christoph Hellwig
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Damien Le Moal @ 2023-07-07  0:32 UTC (permalink / raw)
  To: linux-nvme, Keith Busch, Christoph Hellwig, Sagi Grimberg

Replace occurences of the pattern "PAGE_SHIFT - 9" in the passthru and
loop targets with PAGE_SECTORS_SHIFT.

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
---
 drivers/nvme/target/loop.c     | 2 +-
 drivers/nvme/target/passthru.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c
index f2d24b2d992f..48d5df054cd0 100644
--- a/drivers/nvme/target/loop.c
+++ b/drivers/nvme/target/loop.c
@@ -373,7 +373,7 @@ static int nvme_loop_configure_admin_queue(struct nvme_loop_ctrl *ctrl)
 		goto out_cleanup_tagset;
 
 	ctrl->ctrl.max_hw_sectors =
-		(NVME_LOOP_MAX_SEGMENTS - 1) << (PAGE_SHIFT - 9);
+		(NVME_LOOP_MAX_SEGMENTS - 1) << PAGE_SECTORS_SHIFT;
 
 	nvme_unquiesce_admin_queue(&ctrl->ctrl);
 
diff --git a/drivers/nvme/target/passthru.c b/drivers/nvme/target/passthru.c
index 71a9c1cc57f5..9fe07d7efa96 100644
--- a/drivers/nvme/target/passthru.c
+++ b/drivers/nvme/target/passthru.c
@@ -102,14 +102,14 @@ static u16 nvmet_passthru_override_id_ctrl(struct nvmet_req *req)
 	 * which depends on the host's memory fragementation. To solve this,
 	 * ensure mdts is limited to the pages equal to the number of segments.
 	 */
-	max_hw_sectors = min_not_zero(pctrl->max_segments << (PAGE_SHIFT - 9),
+	max_hw_sectors = min_not_zero(pctrl->max_segments << PAGE_SECTORS_SHIFT,
 				      pctrl->max_hw_sectors);
 
 	/*
 	 * nvmet_passthru_map_sg is limitted to using a single bio so limit
 	 * the mdts based on BIO_MAX_VECS as well
 	 */
-	max_hw_sectors = min_not_zero(BIO_MAX_VECS << (PAGE_SHIFT - 9),
+	max_hw_sectors = min_not_zero(BIO_MAX_VECS << PAGE_SECTORS_SHIFT,
 				      max_hw_sectors);
 
 	page_shift = NVME_CAP_MPSMIN(ctrl->cap) + 12;
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] nvmet: use PAGE_SECTORS_SHIFT
  2023-07-07  0:32 [PATCH] nvmet: use PAGE_SECTORS_SHIFT Damien Le Moal
@ 2023-07-07 12:46 ` Christoph Hellwig
  2023-07-09  7:34 ` Sagi Grimberg
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2023-07-07 12:46 UTC (permalink / raw)
  To: Damien Le Moal; +Cc: linux-nvme, Keith Busch, Christoph Hellwig, Sagi Grimberg

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] nvmet: use PAGE_SECTORS_SHIFT
  2023-07-07  0:32 [PATCH] nvmet: use PAGE_SECTORS_SHIFT Damien Le Moal
  2023-07-07 12:46 ` Christoph Hellwig
@ 2023-07-09  7:34 ` Sagi Grimberg
  2023-07-10  4:57 ` Chaitanya Kulkarni
  2023-07-10 15:46 ` Keith Busch
  3 siblings, 0 replies; 5+ messages in thread
From: Sagi Grimberg @ 2023-07-09  7:34 UTC (permalink / raw)
  To: Damien Le Moal, linux-nvme, Keith Busch, Christoph Hellwig

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] nvmet: use PAGE_SECTORS_SHIFT
  2023-07-07  0:32 [PATCH] nvmet: use PAGE_SECTORS_SHIFT Damien Le Moal
  2023-07-07 12:46 ` Christoph Hellwig
  2023-07-09  7:34 ` Sagi Grimberg
@ 2023-07-10  4:57 ` Chaitanya Kulkarni
  2023-07-10 15:46 ` Keith Busch
  3 siblings, 0 replies; 5+ messages in thread
From: Chaitanya Kulkarni @ 2023-07-10  4:57 UTC (permalink / raw)
  To: Damien Le Moal, linux-nvme@lists.infradead.org, Keith Busch,
	Christoph Hellwig, Sagi Grimberg

On 7/6/2023 5:32 PM, Damien Le Moal wrote:
> Replace occurences of the pattern "PAGE_SHIFT - 9" in the passthru and
> loop targets with PAGE_SECTORS_SHIFT.
> 
> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
> ---

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>

-ck



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] nvmet: use PAGE_SECTORS_SHIFT
  2023-07-07  0:32 [PATCH] nvmet: use PAGE_SECTORS_SHIFT Damien Le Moal
                   ` (2 preceding siblings ...)
  2023-07-10  4:57 ` Chaitanya Kulkarni
@ 2023-07-10 15:46 ` Keith Busch
  3 siblings, 0 replies; 5+ messages in thread
From: Keith Busch @ 2023-07-10 15:46 UTC (permalink / raw)
  To: Damien Le Moal; +Cc: linux-nvme, Christoph Hellwig, Sagi Grimberg

Applied, thanks!


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-07-10 15:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-07  0:32 [PATCH] nvmet: use PAGE_SECTORS_SHIFT Damien Le Moal
2023-07-07 12:46 ` Christoph Hellwig
2023-07-09  7:34 ` Sagi Grimberg
2023-07-10  4:57 ` Chaitanya Kulkarni
2023-07-10 15:46 ` Keith Busch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox