[dpdk-stable] patch 'bus/pci: compare kernel driver instead of interrupt handler' has been queued to LTS release 16.11.9

Alejandro Lucero alejandro.lucero at netronome.com
Wed Nov 14 11:02:20 CET 2018


Hi Luca,

On Mon, Nov 12, 2018 at 6:35 PM Luca Boccassi <bluca at debian.org> wrote:

> On Thu, 2018-11-08 at 18:01 +0000, Luca Boccassi wrote:
> > Hi,
> >
> > FYI, your patch has been queued to LTS release 16.11.9
> >
> > Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
> > It will be pushed if I get no objections before 11/10/18. So please
> > shout if anyone has objections.
> >
> > Also note that after the patch there's a diff of the upstream commit
> > vs the patch applied
> > to the branch. If the code is different (ie: not only metadata
> > diffs), due for example to
> > a change in context or macro names, please double check it.
> >
> > Thanks.
> >
> > Luca Boccassi
> >
> > ---
> > From 0df09603d47c1e38140b747baa8b712e70f5df51 Mon Sep 17 00:00:00
> > 2001
> > From: Alejandro Lucero <alejandro.lucero at netronome.com>
> > Date: Thu, 25 Oct 2018 11:49:28 +0100
> > Subject: [PATCH] bus/pci: compare kernel driver instead of interrupt
> > handler
> >
> > [ upstream commit 630deed612ca382f48a3ef4b65dfc74b7cd09cf9 ]
> >
> > Invoking the right pci read/write functions is based on interrupt
> > handler type. However, this is not configured for secondary processes
> > precluding to use those functions.
> >
> > This patch fixes the issue using the driver name the device is bound
> > to instead.
> >
> > Fixes: 632b2d1deeed ("eal: provide functions to access PCI config")
> >
> > Signed-off-by: Alejandro Lucero <alejandro.lucero at netronome.com>
> > Acked-by: Anatoly Burakov <anatoly.burakov at intel.com>
> > ---
> >  lib/librte_eal/linuxapp/eal/eal_pci.c | 33 ++++++++++++-------------
> > --
> >  1 file changed, 15 insertions(+), 18 deletions(-)
> >
> > diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c
> > b/lib/librte_eal/linuxapp/eal/eal_pci.c
> > index 02ec24150..85c7b3139 100644
> > --- a/lib/librte_eal/linuxapp/eal/eal_pci.c
> > +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c
> > @@ -36,6 +36,7 @@
> >
> >  #include <rte_log.h>
> >  #include <rte_pci.h>
> > +#include <rte_ethdev.h>
>
> Self-facepalm: this cannot work, as ethdev depends on eal. v2 inlined
> below.
>
> Alejandro and Anatoly, please have a quick look. Thanks!
>
>
This patch is only necessary for PMDs which secondary support requires
these pci read/write accesses.
AFAIK, it is just NFP PMD having this need, and multiprocess support will
be added in 19.02, so it is not a big problem to not apply this patch.


> --
> Kind regards,
> Luca Boccassi
>
>
> From 1090520032150e778b6f2088f16c13e8b02fce3e Mon Sep 17 00:00:00 2001
> From: Alejandro Lucero <alejandro.lucero at netronome.com>
> Date: Thu, 25 Oct 2018 11:49:28 +0100
> Subject: [PATCH] bus/pci: compare kernel driver instead of interrupt
> handler
>
> [ upstream commit 630deed612ca382f48a3ef4b65dfc74b7cd09cf9 ]
>
> Invoking the right pci read/write functions is based on interrupt
> handler type. However, this is not configured for secondary processes
> precluding to use those functions.
>
> This patch fixes the issue using the driver name the device is bound
> to instead.
>
> Fixes: 632b2d1deeed ("eal: provide functions to access PCI config")
>
> Signed-off-by: Alejandro Lucero <alejandro.lucero at netronome.com>
> Acked-by: Anatoly Burakov <anatoly.burakov at intel.com>
> ---
>  lib/librte_eal/linuxapp/eal/eal_pci.c | 35 +++++++++++++--------------
>  1 file changed, 17 insertions(+), 18 deletions(-)
>
> diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c
> b/lib/librte_eal/linuxapp/eal/eal_pci.c
> index 02ec24150..2d498d543 100644
> --- a/lib/librte_eal/linuxapp/eal/eal_pci.c
> +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c
> @@ -522,27 +522,27 @@ rte_eal_pci_scan(void)
>         return -1;
>  }
>
> +/* from rte_ethdev, but rte_eal can't depend on it, so redefine it */
> +#define ETH_NAME_MAX_LEN (32)
>  /* Read PCI config space. */
>  int rte_eal_pci_read_config(const struct rte_pci_device *device,
>                             void *buf, size_t len, off_t offset)
>  {
> +       char devname[ETH_NAME_MAX_LEN] = "";
>         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
> -       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_eal_pci_device_name(&device->addr, devname,
> +                                   ETH_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;
>         }
>  }
> @@ -551,26 +551,25 @@ int rte_eal_pci_read_config(const struct
> rte_pci_device *device,
>  int rte_eal_pci_write_config(const struct rte_pci_device *device,
>                              const void *buf, size_t len, off_t offset)
>  {
> +       char devname[ETH_NAME_MAX_LEN] = "";
>         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_write_config(intr_handle, buf, len, offset);
> -
>  #ifdef VFIO_PRESENT
> -       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_write_config(intr_handle, buf, len,
> offset);
>  #endif
>         default:
> +               rte_eal_pci_device_name(&device->addr, devname,
> +                                   ETH_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;
>         }
>  }
> +#undef ETH_NAME_MAX_LEN
>
>  #if defined(RTE_ARCH_X86)
>  static int
> --
> 2.19.1
>


More information about the stable mailing list