DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@6wind.com>
To: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] virtio PMD is not working with master version
Date: Fri, 26 Feb 2016 09:28:48 +0100	[thread overview]
Message-ID: <CALwxeUv5H6UxkZ3n--y1M7RQBivveC9=cw9cMGnUK=K+YbimxA@mail.gmail.com> (raw)
In-Reply-To: <20160226022358.GG14300@yliu-dev.sh.intel.com>

On Fri, Feb 26, 2016 at 3:23 AM, Yuanhan Liu
<yuanhan.liu@linux.intel.com> wrote:
> Mauricio, thanks for the testing and report.
>
> On Thu, Feb 25, 2016 at 02:30:18PM +0100, David Marchand wrote:
>> >From the logs, I would say I broke uio_pci_generic since we are in
>> "uio" case, but uio portio sysfs does not exist.
>> virtio pmd fell back to ioports discovery before my change.
>
> Maybe we can do same?

I suppose, but see below.

>
> ---
> diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c
> index 4346973..579731c 100644
> --- a/lib/librte_eal/linuxapp/eal/eal_pci.c
> +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c
> @@ -685,12 +685,11 @@ int
>  rte_eal_pci_ioport_map(struct rte_pci_device *dev, int bar,
>                        struct rte_pci_ioport *p)
>  {
> -       int ret;
> +       int ret = -1;
>
>         switch (dev->kdrv) {
>  #ifdef VFIO_PRESENT
>         case RTE_KDRV_VFIO:
> -               ret = -1;
>                 if (pci_vfio_is_enabled())
>                         ret = pci_vfio_ioport_map(dev, bar, p);
>                 break;
> @@ -700,14 +699,14 @@ rte_eal_pci_ioport_map(struct rte_pci_device *dev, int bar,
>                 ret = pci_uio_ioport_map(dev, bar, p);
>                 break;
>         default:
> +               break;
> +       }
> +
>  #if defined(RTE_ARCH_X86_64) || defined(RTE_ARCH_I686)
> -               /* special case for x86 ... */
> +       /* special case for x86 ... */
> +       if (ret)
>                 ret = pci_ioport_map(dev, bar, p);
> -#else
> -               ret = -1;
>  #endif
> -               break;
> -       }

What if we are supposed to do vfio here, but for some reason init failed ?
Next thing, we will call ioport_read in vfio context, but init went
through the ioports parsing => boom ?

Another issue is that when device is bound to a kernel driver (let's
say virtio-pci here), then init will succeed and pmd will kick in the
device registers.

This special case should really be narrowed down to "uio" and "none"
driver cases.


-- 
David Marchand

  reply	other threads:[~2016-02-26  8:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-25 11:30 Mauricio Vásquez
2016-02-25 13:08 ` Santosh Shukla
2016-02-25 13:30 ` David Marchand
2016-02-26  2:23   ` Yuanhan Liu
2016-02-26  8:28     ` David Marchand [this message]
2016-02-26  8:44       ` Xie, Huawei
2016-02-26  9:04         ` Santosh Shukla
2016-03-16 20:27 ` 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='CALwxeUv5H6UxkZ3n--y1M7RQBivveC9=cw9cMGnUK=K+YbimxA@mail.gmail.com' \
    --to=david.marchand@6wind.com \
    --cc=dev@dpdk.org \
    --cc=yuanhan.liu@linux.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).