From: Keith Busch <kbusch@kernel.org>
To: Robert Beckett <bob.beckett@collabora.com>
Cc: "\"Pawel Anikiel\"" <panikiel@google.com>,
axboe <axboe@kernel.dk>, hch <hch@lst.de>,
kernel <kernel@collabora.com>,
linux-kernel <linux-kernel@vger.kernel.org>,
linux-nvme <linux-nvme@lists.infradead.org>,
sagi <sagi@grimberg.me>
Subject: Re: [PATCH] nvme-pci: 512 byte aligned dma pool segment quirk
Date: Fri, 22 Nov 2024 12:36:51 -0700 [thread overview]
Message-ID: <Z0DdU9K9QMFxBIL8@kbusch-mbp.dhcp.thefacebook.com> (raw)
In-Reply-To: <1932b818328.ad02576784895.6204301822664878956@collabora.com>
On Thu, Nov 14, 2024 at 04:28:48PM +0000, Robert Beckett wrote:
> ---- On Thu, 14 Nov 2024 14:13:52 +0000 Paweł Anikiel wrote ---
> > On Thu, Nov 14, 2024 at 2:24 PM Robert Beckett
> > bob.beckett@collabora.com> wrote:
> > > This is interesting.
> > > I had the same idea previously. I initially just changed the hard coded 256 / 8 to use 31 instead, which should have ensured the last entry of each segment never gets used.
> > > When I tested that, it not longer failed, which was a good sign. So then I modified it to only do that on the last 256 byte segment of a page, but then is started failing again.
> >
> > Could you elaborate the "only do that on the last 256 byte segment of
> > a page" part? How did you check which chunk of the page would be
> > allocated before choosing the dma pool?
> >
> > > I never saw any bus error during my testing, just wrong data
> > > read, which then fails image verification. I was expecting iommu
> > > error logs if it was trying to access a chain in to nowhere if it
> > > always interpreted last entry in page as a link. I never saw any
> > > iommu errors.
> >
> > Maybe I misspoke, the "bus error" part was just my speculation, I
> > didn't look at the IOMMU logs or anything like that.
> >
> > > I'd be glad to if you could share your testing method.
> >
> > I dumped all the nvme transfers before the crash happened (using
> > tracefs), and I saw a read of size 264 = 8 + 256, which led me to the
> > chaining theory. To test this claim, I wrote a simple pci device
> > driver which creates one IO queue and submits a read command where the
> > PRP list is set up in a way that tests if the controller treats it as
> > a chained list or not. I ran it, and it indeed treated the last PRP
> > entry as a chained pointer.
> hmm, I guess a simple debugfs trigger file could be used to construct
> specially formulated requests. Would work as a debug tool.
>
> Though at this point, the simple dmapool alignment param usage fixes
> both of these scenarios, so it will be kind of academic to continue
> putting effort in to understand this. I am trying to get answers out
> of the vendor to confirm any of these theories, which I hope will be
> more conclusive than our combined inference from testing.
Any updates on this? I'm satisfied with the quirk patch, so we can move
this forward if you're okay with the current understanding.
next prev parent reply other threads:[~2024-11-22 19:37 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-12 19:50 [PATCH] nvme-pci: 512 byte aligned dma pool segment quirk Bob Beckett
2024-11-12 20:47 ` Keith Busch
2024-11-13 4:31 ` Christoph Hellwig
2024-11-13 18:05 ` Keith Busch
2024-11-13 20:08 ` Robert Beckett
2024-11-14 5:55 ` Christoph Hellwig
2024-11-14 13:10 ` Robert Beckett
2024-11-14 11:38 ` Paweł Anikiel
2024-11-14 12:17 ` Christoph Hellwig
2024-11-14 15:37 ` Keith Busch
2024-11-14 13:24 ` Robert Beckett
2024-11-14 14:13 ` Paweł Anikiel
2024-11-14 16:28 ` Robert Beckett
2024-11-22 19:36 ` Keith Busch [this message]
2024-12-09 12:32 ` Robert Beckett
2024-12-09 15:33 ` Paweł Anikiel
2024-12-10 21:36 ` Keith Busch
2024-12-11 10:55 ` Robert Beckett
2024-12-17 11:18 ` Paweł Anikiel
2024-11-14 15:46 ` Keith Busch
2024-11-14 16:47 ` Robert Beckett
2024-11-14 18:00 ` Keith Busch
2024-11-14 18:01 ` Jens Axboe
2024-11-25 11:01 ` Niklas Cassel
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=Z0DdU9K9QMFxBIL8@kbusch-mbp.dhcp.thefacebook.com \
--to=kbusch@kernel.org \
--cc=axboe@kernel.dk \
--cc=bob.beckett@collabora.com \
--cc=hch@lst.de \
--cc=kernel@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=panikiel@google.com \
--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