DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: Changpeng Liu <changpeng.liu@intel.com>
Cc: dev@dpdk.org, ferruh.yigit@intel.com
Subject: Re: [dpdk-dev] [PATCH] pci/uio: enable prefetchable resources mapping
Date: Thu, 1 Feb 2018 09:59:35 +0000	[thread overview]
Message-ID: <20180201095934.GA13452@bricha3-MOBL3.ger.corp.intel.com> (raw)
In-Reply-To: <1517447902-4166-1-git-send-email-changpeng.liu@intel.com>

On Thu, Feb 01, 2018 at 09:18:22AM +0800, Changpeng Liu wrote:
> For PCI prefetchable resources, Linux will create a
> write combined file as well, the library will try
> to map resourceX_wc file first, if the file does
> not exist, then it will map resourceX as usual.
> 
> Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
> ---
>  drivers/bus/pci/linux/pci_uio.c | 19 ++++++++++++++-----
>  1 file changed, 14 insertions(+), 5 deletions(-)
>

Hi,

Given the lack of ordering guarantees with write-combined memory, I
would have thought that this is very risky to do without a complete set
of changes inside the PMDs to add in the necessary memory barriers to
ensure ordering of operations to the BARs.  Therefore, instead of
mapping one file or another, I think the change should be made to map
*both* in DPDK if available. Then each driver can chose whether to write
a given device register using uncacheable memory type or write-combining
memory type + any appropriate barriers.

For example, with many NICs the initialization of the device involves
many register writes in a pretty defined order, so wc operations are
probably to suitable as performance is not a concern. However, for data
path operations, a driver may chose to use wc memory for the occasional
device writes there, for performance reasons.

Regards,
/Bruce

  reply	other threads:[~2018-02-01  9:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-01  1:18 Changpeng Liu
2018-02-01  9:59 ` Bruce Richardson [this message]
2018-02-01 10:08   ` Andrew Rybchenko
  -- strict thread matches above, loose matches on Subject: below --
2017-06-03 22:57 Changpeng Liu
2017-10-05  0:06 ` Ferruh Yigit
2017-10-05  8:28   ` Bruce Richardson
2017-10-05  8:33     ` Bruce Richardson
2018-10-28  1:59       ` Ferruh Yigit
2018-10-29  0:48         ` Liu, Changpeng

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=20180201095934.GA13452@bricha3-MOBL3.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=changpeng.liu@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@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;
as well as URLs for NNTP newsgroup(s).