DPDK patches and discussions
 help / color / mirror / Atom feed
From: Dan Aloni <dan@kernelim.com>
To: "Burakov, Anatoly" <anatoly.burakov@intel.com>, r@gmail.com
Cc: Thomas Monjalon <thomas.monjalon@6wind.com>,
	"dev@dpdk.org" <dev@dpdk.org>, Yong Wang <yongwang@vmware.com>,
	Ronghua Zhang <rzhang@vmware.com>
Subject: Re: [dpdk-dev] [PATCH 1/2] vfio: fix pci_vfio_map_resource
Date: Thu, 14 Jul 2016 18:34:15 +0300	[thread overview]
Message-ID: <20160714153415.GA8329@gmail.com> (raw)
In-Reply-To: <C6ECDF3AB251BE4894318F4E45123697821322ED@IRSMSX109.ger.corp.intel.com>

On Thu, Jul 14, 2016 at 02:50:51PM +0000, Burakov, Anatoly wrote:
> > Someone to review this patch please?
> > It can be integrated in RC3 if we are sure it doesn't break anything.
> > 
> > 2016-07-07 15:26, Yong Wang:
> > > The offset of the 2nd mmap when mapping the region after msix_bar
> > > needs to take region address into consideration.  This is exposed when
> > > using vfio-pci to manage vmxnet3 pmd.
> > >
> > > Fixes: 90a1633b2347 ("eal/linux: allow to map BARs with MSI-X tables")
> > >
> > > Signed-off-by: Yong Wang <yongwang@vmware.com>
> > > Signed-off-by: Ronghua Zhang <rzhang@vmware.com>
> 
> Hi Thomas,
> 
> The patch makes sense to me, but I don't have any devices that trigger that particular codepath in my immediate vicinity. The original patch was mentioning an NVMe adapter, so that probably should be tested with this change. I'm CC'ing the original author of that patch just in case. Do we know of any other NICs/devices that might be affected by this? Aside from the obvious example of vmxnet3... 

The patch makes sense. To explain further, the reg.offset is
resource-relative and not bar-relative like table_start and table_end.
The mmap() needs to be resource-relative.

I think it would be cleaner to use 'reg.offset' to substruct,
conveying the fact that bar_addr already accounts for it.

-                               void *second_addr = RTE_PTR_ADD(bar_addr, memreg[1].offset);
+                               void *second_addr = RTE_PTR_ADD(bar_addr,
+                                                               memreg[1].offset - reg.offset);

The work I've done with the Intel NVMe adapter was cut short due to
other tasks I've had to shift to. But it was left in a state where it
almost worked under VFIO, in a sense that the NVME card entered a
fault state and I had not invested enough time to figure out why.

If it's due to this bug, then I would be able to finally close this
one. But that's a bit hopeful, though. Happy to find actual users of
the changes.

-- 
Dan Aloni

  reply	other threads:[~2016-07-14 15:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-07 22:26 Yong Wang
2016-07-07 22:26 ` [dpdk-dev] [PATCH 2/2] vfio: fix coding style Yong Wang
2016-07-14 13:25 ` [dpdk-dev] [PATCH 1/2] vfio: fix pci_vfio_map_resource Thomas Monjalon
2016-07-14 14:50   ` Burakov, Anatoly
2016-07-14 15:34     ` Dan Aloni [this message]
2016-07-15  0:15       ` [dpdk-dev] [PATCH v2] " Yong Wang
2016-07-15 13:05         ` Burakov, Anatoly
2016-07-15 15:32         ` Thomas Monjalon
2016-07-15 16:42           ` Thomas Monjalon
2016-07-15 16:56             ` Thomas Monjalon

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=20160714153415.GA8329@gmail.com \
    --to=dan@kernelim.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=r@gmail.com \
    --cc=rzhang@vmware.com \
    --cc=thomas.monjalon@6wind.com \
    --cc=yongwang@vmware.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).