DPDK patches and discussions
 help / color / mirror / Atom feed
From: Alejandro Lucero <alejandro.lucero@netronome.com>
To: "Burakov, Anatoly" <anatoly.burakov@intel.com>
Cc: Thomas Monjalon <thomas@monjalon.net>, dev <dev@dpdk.org>,
	 Gaetan Rivet <gaetan.rivet@6wind.com>
Subject: Re: [dpdk-dev] [PATCH] bus/pci: use device driver name instead of handler type
Date: Thu, 25 Oct 2018 10:45:01 +0100	[thread overview]
Message-ID: <CAD+H993tVgPaw-FZjwKgbOL1Ynxy+wWB0_neOTVS=eDDXExhNA@mail.gmail.com> (raw)
In-Reply-To: <4f2c94c7-8999-80ba-62a0-024551c15e6e@intel.com>

On Thu, Oct 25, 2018 at 10:29 AM Burakov, Anatoly <anatoly.burakov@intel.com>
wrote:

> On 25-Oct-18 7:00 AM, Alejandro Lucero wrote:
> > On Thu, Oct 25, 2018 at 6:30 AM Alejandro Lucero <
> > alejandro.lucero@netronome.com> wrote:
> >
> >>
> >>
> >> On Thu, Oct 25, 2018 at 12:11 AM Thomas Monjalon <thomas@monjalon.net>
> >> wrote:
> >>
> >>> Hi,
> >>>
> >>> 19/10/2018 18:43, Alejandro Lucero:
> >>>> --- a/drivers/bus/pci/linux/pci.c
> >>>> +++ b/drivers/bus/pci/linux/pci.c
> >>>> +     char devname[RTE_DEV_NAME_MAX_LEN] = {0};
> >>>
> >>> I think "" would be more appropriate than {0}.
> >>>
> >>>>        const struct rte_intr_handle *intr_handle =
> &device->intr_handle;
> >>>>
> >>>> -     switch (intr_handle->type) {
> >>>> -     case RTE_INTR_HANDLE_UIO:
> >>>> -     case RTE_INTR_HANDLE_UIO_INTX:
> >>>> +     switch (device->kdrv) {
> >>>> +     case RTE_KDRV_IGB_UIO:
> >>>>                return pci_uio_read_config(intr_handle, buf, len,
> offset);
> >>>> -
> >>>> -#ifdef VFIO_PRESENT
> >>>
> >>> Why this #ifdef is removed?
> >>>
> >>>
> >> Because it is not needed. VFIO is present if the kdrv field tells us so.
> >>
> >
> > And at this point it is clear VFIO is present if that is the case.
> > Otherwise this code is not executed.
>
> Actually, i think Thomas is right here. The #ifdef shouldn't be removed,
> because if this is not defined, the function is simply not present - see
> pci_init.h, VFIO-related functions are only declared if VFIO_PRESENT is
> defined.
>
>
Right. I did not try to compile without VFIO, but I have just done this and
it fails.
I will send another version using the #ifdef for VFIO.

Thanks


> >
> >
> >>
> >>
> >>>> -     case RTE_INTR_HANDLE_VFIO_MSIX:
> >>>> -     case RTE_INTR_HANDLE_VFIO_MSI:
> >>>> -     case RTE_INTR_HANDLE_VFIO_LEGACY:
> >>>> +     case RTE_KDRV_VFIO:
> >>>>                return pci_vfio_read_config(intr_handle, buf, len,
> >>> offset);
> >>>> -#endif
> >>>>        default:
> >>>> +             rte_pci_device_name(&device->addr, devname,
> >>>> +                                 RTE_DEV_NAME_MAX_LEN);
> >>>>                RTE_LOG(ERR, EAL,
> >>>> -                     "Unknown handle type of fd %d\n",
> >>>> -                                     intr_handle->fd);
> >>>> +                     "Unknown driver type for %s\n", devname);
> >>>>                return -1;
> >>>>        }
> >>>
> >>>
> >>>
> >>>
> >
>
>
> --
> Thanks,
> Anatoly
>

      reply	other threads:[~2018-10-25  9:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-19 16:43 Alejandro Lucero
2018-10-22  8:58 ` Burakov, Anatoly
2018-10-24 23:11 ` Thomas Monjalon
2018-10-25  5:30   ` Alejandro Lucero
2018-10-25  6:00     ` Alejandro Lucero
2018-10-25  9:29       ` Burakov, Anatoly
2018-10-25  9:45         ` Alejandro Lucero [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='CAD+H993tVgPaw-FZjwKgbOL1Ynxy+wWB0_neOTVS=eDDXExhNA@mail.gmail.com' \
    --to=alejandro.lucero@netronome.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=gaetan.rivet@6wind.com \
    --cc=thomas@monjalon.net \
    /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).