From: Keith Busch <kbusch@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: sagi@grimberg.me, linux-nvme@lists.infradead.org
Subject: Re: [PATCH] nvme-pci: derive and better document max segments limits
Date: Fri, 16 May 2025 09:17:26 -0600 [thread overview]
Message-ID: <aCdXBS6wrnXDQKca@kbusch-mbp> (raw)
In-Reply-To: <20250516072152.166131-1-hch@lst.de>
On Fri, May 16, 2025 at 09:21:52AM +0200, Christoph Hellwig wrote:
> Redefine the max segments and max integrity limits based on the limiting
> factors without changing the final values and add comments explaining
> them.
...
> #define NVME_MAX_KB_SZ 8192
> -#define NVME_MAX_SEGS 128
> -#define NVME_MAX_META_SEGS 15
> #define NVME_MAX_NR_DESCRIPTORS 5
>
> +/*
> + * For data SGLs we support a single descriptors worth of SGL entries, but for
> + * now we also limit it to avoid an allocation larger than PAGE_SIZE for the
> + * scatterlist.
> + */
> +#define NVME_MAX_SEGS \
> + min(NVME_CTRL_PAGE_SIZE / sizeof(struct nvme_sgl_desc), \
> + (PAGE_SIZE / sizeof(struct scatterlist)))
If your page size is >=8k, this should change the value of NVME_MAX_SEGS
to 256. I don't think that's a bad thing, but the commit message doesn't
reflect that.
The diff looks good.
Reviewed-by: Keith Busch <kbusch@kernel.org>
next prev parent reply other threads:[~2025-05-16 15:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-16 7:21 [PATCH] nvme-pci: derive and better document max segments limits Christoph Hellwig
2025-05-16 15:17 ` Keith Busch [this message]
2025-05-19 7:23 ` Christoph Hellwig
2025-05-19 23:34 ` 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=aCdXBS6wrnXDQKca@kbusch-mbp \
--to=kbusch@kernel.org \
--cc=hch@lst.de \
--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