DPDK patches and discussions
 help / color / mirror / Atom feed
From: Santosh Shukla <santosh.shukla@caviumnetworks.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: "anatoly.burakov@intel.com" <anatoly.burakov@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [bug] dpdk-vfio: Invalid region/index assumption
Date: Thu, 28 Jul 2016 13:36:24 +0530	[thread overview]
Message-ID: <20160728080609.GA5736@santosh-Latitude-E5530-non-vPro> (raw)
In-Reply-To: <20160727161457.7992c756@t450s.home>

On Thu, Jul 28, 2016 at 03:44:57AM +0530, Alex Williamson wrote:
> Hi,
> 
> I took a quick look at the dpdk vfio code and spotted an invalid
> assumption that should probably be corrected ASAP.  That is:
> 
> lib/librte_eal/linuxapp/eal/eal_vfio.h:
> #define VFIO_GET_REGION_ADDR(x) ((uint64_t) x << 40ULL)
> #define VFIO_GET_REGION_IDX(x) (x >> 40)

Yes. I agree. We need some way to carry essential vfio region info in pci_dev,
needed for pread/pwrite. currently, rte_intr_handle only has vfio_dev_fd but
thats not sufficient information. I stumbled while adding ioport support in vfio
and took a short path to define region_idx thatway. To get-rid of this, Possible
approach could be;
- add essential vfio region specific info (ie.. offset, idx, flag) in
  rte_intr_handle. 
- or pull dev_fd to rte_pci_device{}; and define region specific details.

Thanks.

> Region offset to index is an implementation detail of the kernel, the
> vfio API defines that the offset of a given region (BAR) is found via
> the offset field of struct vfio_region_info returned via the
> VFIO_DEVICE_GET_REGION_INFO ioctl.  You're free to cache the offset
> into any sort of local variable you like, but the kernel may change the
> implementation of region index to offset at any point in time.  This is
> explicitly not part of the ABI.  Is there a place to file a bug, or is
> this sufficient?  Thanks,
> 
> Alex

      parent reply	other threads:[~2016-07-28  8:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-27 22:14 Alex Williamson
2016-07-28  6:54 ` Thomas Monjalon
2016-07-28  9:42   ` Burakov, Anatoly
2016-07-28 14:54     ` Alex Williamson
2016-07-28  8:06 ` Santosh Shukla [this message]

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=20160728080609.GA5736@santosh-Latitude-E5530-non-vPro \
    --to=santosh.shukla@caviumnetworks.com \
    --cc=alex.williamson@redhat.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    /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).