From: keith.busch@intel.com (Keith Busch)
Subject: offest calculation from the dma_address
Date: Fri, 14 Apr 2017 10:00:40 -0400 [thread overview]
Message-ID: <20170414140040.GA19243@localhost.localdomain> (raw)
In-Reply-To: <20170414135451.515c3a53134384c388071989@gmail.com>
On Fri, Apr 14, 2017@01:54:51PM +0300, alexnln wrote:
> In pci.c, in nvme_setup_prps() offset is calculated from the dma address:
> int offset = dma_addr & (page_size - 1);
>
> Why not to use sg->offset?
PRP lists are constructed from DMA addresses, so the DMA address offset
is the one to use. Kernel virtual addresses don't necessarilly have the
same page offset as DMA addresses.
> I mean, what if hypothetical dma allocator returns non-page aligned addresses?
> In such case offset would be wrong.
I don't follow. If the DMA address isn't page aligned, we need to
account for that when constructing the PRP.
prev parent reply other threads:[~2017-04-14 14:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-14 10:54 offest calculation from the dma_address alexnln
2017-04-14 14:00 ` Keith Busch [this message]
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=20170414140040.GA19243@localhost.localdomain \
--to=keith.busch@intel.com \
/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