From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by dpdk.org (Postfix) with ESMTP id F27F54CBB for ; Mon, 12 Nov 2018 19:35:11 +0100 (CET) Received: by mail-wm1-f67.google.com with SMTP id z8-v6so2936879wma.5 for ; Mon, 12 Nov 2018 10:35:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:content-transfer-encoding:mime-version; bh=KppumqmhFXyHca3+pS7QG3zSvAx3OabixBQg4hCA+wk=; b=ESoNLjIkdV4IGtgsjx3KNu2CThG0d+rdWb2AYBPa936UegGsZmnbbKJnAhaSh4DWQr NJDNrn2NrPZ+NUhEFAdjx4aEmSESDNXwqYwK899Dlyi9gFDdsBqg3fTbe4qXMVJTAD63 zFmHJ6WDPhMIDuQhKgU3BbVU8O/cclSF0fKvQtTgmTjxZcpfshgMIuOjqVzegqajQuHz RtmsD+SUND2kgF0cHL/jCwRndjWFdrhVLK+0n2bRgJz0ek+h0rqzArp3kw2YY9mxyPtg uW/EjSxJQxUnOnQnL3/diMLMEXiwI9NZ+9+67I+8R32lR3v8zKRCj/M7LmpC3jtvwXAz EHYg== X-Gm-Message-State: AGRZ1gJYRwtexgd8ouHCkk4Q9jAZXOs+EHyqmUDCJlUlWh67FML+ZPwi xMrXuKXPJdLdvmB+uUK37Mh2TWGI X-Google-Smtp-Source: AJdET5duY/2ntKNxnQak8Hn4xbuejHJ3ZX0C31IhHnuPqOqJJlrdcKcCgGv344st2CEkSzF7VyiNLg== X-Received: by 2002:a1c:aacf:: with SMTP id t198-v6mr691342wme.108.1542047711444; Mon, 12 Nov 2018 10:35:11 -0800 (PST) Received: from localhost ([2a01:4b00:f419:6f00:8361:8946:ba2b:d556]) by smtp.gmail.com with ESMTPSA id b14-v6sm5254106wme.34.2018.11.12.10.35.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Nov 2018 10:35:10 -0800 (PST) Message-ID: <1542047709.11515.6.camel@debian.org> From: Luca Boccassi To: Alejandro Lucero Cc: Anatoly Burakov , dpdk stable Date: Mon, 12 Nov 2018 18:35:09 +0000 In-Reply-To: <20181108180111.25873-11-bluca@debian.org> References: <20181029125329.17729-20-bluca@debian.org> <20181108180111.25873-1-bluca@debian.org> <20181108180111.25873-11-bluca@debian.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution 3.22.6-1+deb9u1 Mime-Version: 1.0 Subject: Re: [dpdk-stable] patch 'bus/pci: compare kernel driver instead of interrupt handler' has been queued to LTS release 16.11.9 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 18:35:12 -0000 On Thu, 2018-11-08 at 18:01 +0000, Luca Boccassi wrote: > Hi, >=20 > FYI, your patch has been queued to LTS release 16.11.9 >=20 > 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. >=20 > 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. >=20 > Thanks. >=20 > Luca Boccassi >=20 > --- > From 0df09603d47c1e38140b747baa8b712e70f5df51 Mon Sep 17 00:00:00 > 2001 > From: Alejandro Lucero > Date: Thu, 25 Oct 2018 11:49:28 +0100 > Subject: [PATCH] bus/pci: compare kernel driver instead of interrupt > handler >=20 > [ upstream commit 630deed612ca382f48a3ef4b65dfc74b7cd09cf9 ] >=20 > 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. >=20 > This patch fixes the issue using the driver name the device is bound > to instead. >=20 > Fixes: 632b2d1deeed ("eal: provide functions to access PCI config") >=20 > Signed-off-by: Alejandro Lucero > Acked-by: Anatoly Burakov > --- > =C2=A0lib/librte_eal/linuxapp/eal/eal_pci.c | 33 ++++++++++++------------= - > -- > =C2=A01 file changed, 15 insertions(+), 18 deletions(-) >=20 > 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 @@ > =C2=A0 > =C2=A0#include > =C2=A0#include > +#include Self-facepalm: this cannot work, as ethdev depends on eal. v2 inlined below. Alejandro and Anatoly, please have a quick look. Thanks! --=20 Kind regards, Luca Boccassi >>From 1090520032150e778b6f2088f16c13e8b02fce3e Mon Sep 17 00:00:00 2001 From: Alejandro Lucero Date: Thu, 25 Oct 2018 11:49:28 +0100 Subject: [PATCH] bus/pci: compare kernel driver instead of interrupt handle= r [ 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 Acked-by: Anatoly Burakov --- 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/linuxap= p/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; } =20 +/* 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] =3D ""; const struct rte_intr_handle *intr_handle =3D &device->intr_handle; =20 - 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_devi= ce *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] =3D ""; const struct rte_intr_handle *intr_handle =3D &device->intr_handle; =20 - 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 =20 #if defined(RTE_ARCH_X86) static int --=20 2.19.1