DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: Changpeng Liu <changpeng.liu@intel.com>, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] pci/uio: enable prefetchable resources mapping
Date: Thu, 5 Oct 2017 09:28:34 +0100	[thread overview]
Message-ID: <20171005082834.GA20768@bricha3-MOBL3.ger.corp.intel.com> (raw)
In-Reply-To: <c401d10c-523a-bb44-6003-3415c0f3ede4@intel.com>

On Thu, Oct 05, 2017 at 01:06:41AM +0100, Ferruh Yigit wrote:
> On 6/3/2017 11:57 PM, 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.
> 
> Hi Changpeng,
> 
> Code part looks OK, but can you please describe more why we should try
> write combined resource file first, what is the benefit of using it _wc
> file?
> 
> Thanks,
> ferruh
> 
Also, if we use a write combining resource file, I believe we will use
correct ordering of instructions within our drivers. Does applying this
patch not also mean that we would need memory barriers inside all the
drivers, so as to ensure that we don't have a queue doorbell write
reordered with the descriptor writes? I don't think it's safe to apply
this change on it's own, without driver changes, since all PMDs assume
strong ordering on IA.

Regards,
/Bruce

> 
> > 
> > Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
> > ---
> >  lib/librte_eal/linuxapp/eal/eal_pci_uio.c | 19 ++++++++++++++-----
> >  1 file changed, 14 insertions(+), 5 deletions(-)
> > 
> > diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c
> > index fa10329..d9fc20a 100644
> > --- a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c
> > +++ b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c
> > @@ -321,7 +321,7 @@
> >  
> >  	/* update devname for mmap  */
> >  	snprintf(devname, sizeof(devname),
> > -			"%s/" PCI_PRI_FMT "/resource%d",
> > +			"%s/" PCI_PRI_FMT "/resource%d_wc",
> >  			pci_get_sysfs_path(),
> >  			loc->domain, loc->bus, loc->devid,
> >  			loc->function, res_idx);
> > @@ -335,13 +335,22 @@
> >  	}
> >  
> >  	/*
> > -	 * open resource file, to mmap it
> > +	 * open prefetchable resource file first, try to mmap it
> >  	 */
> >  	fd = open(devname, O_RDWR);
> >  	if (fd < 0) {
> > -		RTE_LOG(ERR, EAL, "Cannot open %s: %s\n",
> > -				devname, strerror(errno));
> > -		goto error;
> > +		snprintf(devname, sizeof(devname),
> > +				"%s/" PCI_PRI_FMT "/resource%d",
> > +				pci_get_sysfs_path(),
> > +				loc->domain, loc->bus, loc->devid,
> > +				loc->function, res_idx);
> > +		/* then try to map resource file */
> > +		fd = open(devname, O_RDWR);
> > +		if (fd < 0) {
> > +			RTE_LOG(ERR, EAL, "Cannot open %s: %s\n",
> > +					devname, strerror(errno));
> > +			goto error;
> > +		}
> >  	}
> >  
> >  	/* try mapping somewhere close to the end of hugepages */
> > 
> 

  reply	other threads:[~2017-10-05  8:28 UTC|newest]

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

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=20171005082834.GA20768@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).