Linux PCI Non-Transparent Bridge framework and drivers
 help / color / mirror / Atom feed
From: Gary R Hook <gary.hook@amd.com>
To: linux-ntb@googlegroups.com
Subject: Translation registers
Date: Mon, 21 Aug 2017 16:59:37 -0500	[thread overview]
Message-ID: <8f9eda70-cd72-b5b0-aa6b-30022cc96e7a@amd.com> (raw)

Stupid question time.

What is the purpose of the call to dma_alloc_coherent() in ntb_perf and 
ntb_tool? Is is supposed to acquire a chunk of DMA memory that is mapped 
into the device bar? A call to ntb_mw_set_trans() ensues, but I'm not 
seeing what is supposed to happen in that, either. The translation 
registers are accessed, yes, but why?

I'm seeing the memory window this way: On my primary I get the MW 
address through the BAR, it's a certain size, and I can write into it. 
The data should appear in the corresponding memory window of the 
secondary. An application could be notified via a doorbell event to go 
read the data.

Or am I just completely confused?

What I'm trying to get down to is how, during initialization of the 
device driver and tool module, I get a virtual address that I can use 
for memcpy operations. The physical address (for DMA ops) is easy; I've 
got that. What's not clear is how (on Intel hardware) is how 
ioremap_wc()/et. al. are used to get a virtual reference to a physical 
address.

Searching has as yet revealed nothing specific on this detail. Of 
course, I could be making this more complex than it needs to be...


In summary: how is the Intel NTB device getting mapped into the virtual 
address space, via dma_alloc_coherent, ioremap_wc, and ntb_mw_set_trans?

Much thanks to anyone that has illuminating comments.

             reply	other threads:[~2017-08-21 21:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-21 21:59 Gary R Hook [this message]
2017-08-21 22:36 ` Translation registers Dave Jiang
2017-08-21 23:32   ` Gary R Hook
2017-08-21 23:46     ` Dave Jiang
2017-08-24 22:24       ` Gary R Hook

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=8f9eda70-cd72-b5b0-aa6b-30022cc96e7a@amd.com \
    --to=gary.hook@amd.com \
    --cc=linux-ntb@googlegroups.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