Linux PCI Non-Transparent Bridge framework and drivers
 help / color / mirror / Atom feed
From: "Allen Hubbe" <Allen.Hubbe@emc.com>
To: "'Yu, Xiangliang'" <Xiangliang.Yu@amd.com>, linux-ntb@googlegroups.com
Cc: 'Jon Mason' <jdmason@kudzu.us>, 'Dave Jiang' <dave.jiang@intel.com>
Subject: RE: [PATCH 2/2] NTB: Remove _addr functions from ntb_hw_amd
Date: Tue, 22 Mar 2016 10:00:45 -0400	[thread overview]
Message-ID: <000001d18443$3bb6dc50$b32494f0$@emc.com> (raw)
In-Reply-To: <BLUPR12MB04207A01BAAA208E33D1E745EB800@BLUPR12MB0420.namprd12.prod.outlook.com>

> From: Yu, Xiangliang
> > From: Allen Hubbe
> > Kernel zero day testing warned about address space confusion.  A virtual
> > iomem address was used where a physical address is expected.  The
> > offending functions implement an optional part of the api, so they are
> > removed.  They can be added later, after testing.
> 
> Ntb_dev_ops_is_valid will check the related implement and AMD ntb driver can't
> Register ntb device if you remove the two functions.

See [PATCH 1/2].

> I think this addr should be is iomem address not physical address as address space
> Is IO space.

The programming interface specifies to return a physical address.  Returning a virtual address is incorrect.

> Do you map IO space again after getting the physical address?
> Please help clarify the usage scenarios.

The use case can be applied in the combination of NTB and a DMA engine to offload memory copy operations.  The physical address enables an optimization for that use case.  The DMA engine operates in the physical address space, without a virtual memory mapping, so there is no need to map the IO space again.

Using the physical address, a dma descriptor can be inserted into the chain of operations to be executed by the dma hardware.  The inserted descriptor would be a write of the appropriate bits to the doorbell register.  The write will have the effect of ringing the doorbell.

The dma hardware processes the chain of descriptors asynchronously, and notifies the dma driver as descriptors are completed.  By inserting the doorbell write operation in the chain, it is executed asynchronously along with other dma operations, and it does not require the round trip and overhead of processing a dma completion to ring the doorbell.


  reply	other threads:[~2016-03-22 14:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-21  8:53 [PATCH 1/2] NTB: Make _addr functions optional in the API Allen Hubbe
2016-03-21  8:53 ` [PATCH 2/2] NTB: Remove _addr functions from ntb_hw_amd Allen Hubbe
2016-03-22  0:00   ` Jon Mason
2016-03-22  6:30   ` Yu, Xiangliang
2016-03-22 14:00     ` Allen Hubbe [this message]
2016-03-23  3:22       ` Yu, Xiangliang
2016-03-23 14:01         ` Allen Hubbe
2016-03-24  6:46           ` Yu, Xiangliang
2016-03-27 15:22             ` Jon Mason

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='000001d18443$3bb6dc50$b32494f0$@emc.com' \
    --to=allen.hubbe@emc.com \
    --cc=Xiangliang.Yu@amd.com \
    --cc=dave.jiang@intel.com \
    --cc=jdmason@kudzu.us \
    --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