public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Max Gurtovoy <mgurtovoy@nvidia.com>
To: Christoph Hellwig <hch@lst.de>
Cc: sagi@grimberg.me, linux-nvme@lists.infradead.org,
	kbusch@kernel.org, kch@nvidia.com, axboe@kernel.dk,
	linux-block@vger.kernel.org
Subject: Re: [PATCH 1/1] nvme-pci: set virt boundary according to capability
Date: Tue, 9 Dec 2025 13:31:21 +0200	[thread overview]
Message-ID: <6649eb8e-ae68-460d-95db-deece134e9d1@nvidia.com> (raw)
In-Reply-To: <20251209064015.GC27728@lst.de>


On 09/12/2025 8:40, Christoph Hellwig wrote:
> On Tue, Dec 09, 2025 at 12:26:20AM +0200, Max Gurtovoy wrote:
>> Some controllers advertise DWORD alignment for SGLs, so configure the
>> virtual boundary correctly for those devices.
>>
>> Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
>> ---
>>   drivers/nvme/host/pci.c | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
>> index e5ca8301bb8b..eacc89cd25eb 100644
>> --- a/drivers/nvme/host/pci.c
>> +++ b/drivers/nvme/host/pci.c
>> @@ -3326,7 +3326,9 @@ static unsigned long nvme_pci_get_virt_boundary(struct nvme_ctrl *ctrl,
>>   {
>>   	if (!nvme_ctrl_sgl_supported(ctrl) || is_admin)
>>   		return NVME_CTRL_PAGE_SIZE - 1;
>> -	return 0;
>> +	else if (ctrl->sgls & NVME_CTRL_SGLS_BYTE_ALIGNED)
>> +		return 0;
>> +	return 3;
> I don't think this is correct.  NVME_CTRL_SGLS_BYTE_ALIGNED requires
> each SGL to be aligned, but is not a virt boundary.  The dma_alignment
> value in the queue_limits already takes care of that.

I see. The virt boundary handles the gaps.

Should we modify:

dma_set_min_align_mask(dev->dev, NVME_CTRL_PAGE_SIZE - 1);

and

lim->dma_alignment = 3;

to ease the restriction for capable devices with 
NVME_CTRL_SGLS_BYTE_ALIGNED support ?

>

  reply	other threads:[~2025-12-09 11:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-08 22:26 [PATCH 1/1] nvme-pci: set virt boundary according to capability Max Gurtovoy
2025-12-09  6:40 ` Christoph Hellwig
2025-12-09 11:31   ` Max Gurtovoy [this message]
2025-12-10 11:28     ` Keith Busch
2025-12-10 11:44       ` Max Gurtovoy

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=6649eb8e-ae68-460d-95db-deece134e9d1@nvidia.com \
    --to=mgurtovoy@nvidia.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=kch@nvidia.com \
    --cc=linux-block@vger.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