* [dpdk-dev] [PATCH] bus/pci: fix Windows kernel driver categories
@ 2021-03-16 23:11 Thomas Monjalon
2021-03-17 22:43 ` Dmitry Kozlyuk
` (3 more replies)
0 siblings, 4 replies; 12+ messages in thread
From: Thomas Monjalon @ 2021-03-16 23:11 UTC (permalink / raw)
To: dev
Cc: dmitry.kozliuk, stable, Tal Shnaiderman, Narcisa Vasile,
Ranjit Menon, John Alexander, Pallavi Kadam
In Windows probing, the value RTE_PCI_KDRV_NONE was used
instead of RTE_PCI_KDRV_UNKNOWN (mlx case),
and RTE_PCI_KDRV_NIC_UIO (FreeBSD) was re-used
instead of having a new RTE_PCI_KDRV_NET_UIO for Windows NetUIO.
While adding the new value RTE_PCI_KDRV_NET_UIO,
the enum of kernel driver categories is annotated.
Fixes: b762221ac24f ("bus/pci: support Windows with bifurcated drivers")
Fixes: c76ec01b4591 ("bus/pci: support netuio on Windows")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
drivers/bus/pci/rte_bus_pci.h | 13 +++++++------
drivers/bus/pci/windows/pci.c | 14 +++++++-------
2 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/drivers/bus/pci/rte_bus_pci.h b/drivers/bus/pci/rte_bus_pci.h
index fdda046515..3d009cc74b 100644
--- a/drivers/bus/pci/rte_bus_pci.h
+++ b/drivers/bus/pci/rte_bus_pci.h
@@ -52,12 +52,13 @@ TAILQ_HEAD(rte_pci_driver_list, rte_pci_driver);
struct rte_devargs;
enum rte_pci_kernel_driver {
- RTE_PCI_KDRV_UNKNOWN = 0,
- RTE_PCI_KDRV_IGB_UIO,
- RTE_PCI_KDRV_VFIO,
- RTE_PCI_KDRV_UIO_GENERIC,
- RTE_PCI_KDRV_NIC_UIO,
- RTE_PCI_KDRV_NONE,
+ RTE_PCI_KDRV_UNKNOWN = 0, /* not listed - may be a bifurcated driver */
+ RTE_PCI_KDRV_IGB_UIO, /* igb_uio for Linux */
+ RTE_PCI_KDRV_VFIO, /* VFIO for Linux */
+ RTE_PCI_KDRV_UIO_GENERIC, /* uio_generic for Linux */
+ RTE_PCI_KDRV_NIC_UIO, /* nic_uio for FreeBSD */
+ RTE_PCI_KDRV_NONE, /* error */
+ RTE_PCI_KDRV_NET_UIO, /* NetUIO for Windows */
};
/**
diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c
index 8f906097f4..3f0ce1fb83 100644
--- a/drivers/bus/pci/windows/pci.c
+++ b/drivers/bus/pci/windows/pci.c
@@ -38,7 +38,7 @@ rte_pci_map_device(struct rte_pci_device *dev)
* Devices that are bound to netuio are mapped at
* the bus probing stage.
*/
- if (dev->kdrv == RTE_PCI_KDRV_NIC_UIO)
+ if (dev->kdrv == RTE_PCI_KDRV_NET_UIO)
return 0;
else
return -1;
@@ -207,14 +207,14 @@ get_device_resource_info(HDEVINFO dev_info,
int ret;
switch (dev->kdrv) {
- case RTE_PCI_KDRV_NONE:
- /* mem_resource - Unneeded for RTE_PCI_KDRV_NONE */
+ case RTE_PCI_KDRV_UNKNOWN:
+ /* mem_resource is unneeded */
dev->mem_resource[0].phys_addr = 0;
dev->mem_resource[0].len = 0;
dev->mem_resource[0].addr = NULL;
break;
- case RTE_PCI_KDRV_NIC_UIO:
- /* get device info from netuio kernel driver */
+ case RTE_PCI_KDRV_NET_UIO:
+ /* get device info from NetUIO kernel driver */
ret = get_netuio_device_info(dev_info, dev_info_data, dev);
if (ret != 0) {
RTE_LOG(DEBUG, EAL,
@@ -323,9 +323,9 @@ set_kernel_driver_type(PSP_DEVINFO_DATA device_info_data,
{
/* set kernel driver type based on device class */
if (IsEqualGUID(&(device_info_data->ClassGuid), &GUID_DEVCLASS_NETUIO))
- dev->kdrv = RTE_PCI_KDRV_NIC_UIO;
+ dev->kdrv = RTE_PCI_KDRV_NET_UIO;
else
- dev->kdrv = RTE_PCI_KDRV_NONE;
+ dev->kdrv = RTE_PCI_KDRV_UNKNOWN;
}
static int
--
2.30.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH] bus/pci: fix Windows kernel driver categories
2021-03-16 23:11 [dpdk-dev] [PATCH] bus/pci: fix Windows kernel driver categories Thomas Monjalon
@ 2021-03-17 22:43 ` Dmitry Kozlyuk
2021-03-18 7:43 ` Thomas Monjalon
2021-03-17 23:17 ` Ranjit Menon
` (2 subsequent siblings)
3 siblings, 1 reply; 12+ messages in thread
From: Dmitry Kozlyuk @ 2021-03-17 22:43 UTC (permalink / raw)
To: Thomas Monjalon
Cc: dev, stable, Tal Shnaiderman, Narcisa Vasile, Ranjit Menon,
John Alexander, Pallavi Kadam
2021-03-17 00:11 (UTC+0100), Thomas Monjalon:
[...]
> diff --git a/drivers/bus/pci/rte_bus_pci.h b/drivers/bus/pci/rte_bus_pci.h
> index fdda046515..3d009cc74b 100644
> --- a/drivers/bus/pci/rte_bus_pci.h
> +++ b/drivers/bus/pci/rte_bus_pci.h
> @@ -52,12 +52,13 @@ TAILQ_HEAD(rte_pci_driver_list, rte_pci_driver);
> struct rte_devargs;
>
> enum rte_pci_kernel_driver {
> - RTE_PCI_KDRV_UNKNOWN = 0,
> - RTE_PCI_KDRV_IGB_UIO,
> - RTE_PCI_KDRV_VFIO,
> - RTE_PCI_KDRV_UIO_GENERIC,
> - RTE_PCI_KDRV_NIC_UIO,
> - RTE_PCI_KDRV_NONE,
> + RTE_PCI_KDRV_UNKNOWN = 0, /* not listed - may be a bifurcated driver */
> + RTE_PCI_KDRV_IGB_UIO, /* igb_uio for Linux */
> + RTE_PCI_KDRV_VFIO, /* VFIO for Linux */
> + RTE_PCI_KDRV_UIO_GENERIC, /* uio_generic for Linux */
Module name is "uio_pci_generic", otherwise
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH] bus/pci: fix Windows kernel driver categories
2021-03-16 23:11 [dpdk-dev] [PATCH] bus/pci: fix Windows kernel driver categories Thomas Monjalon
2021-03-17 22:43 ` Dmitry Kozlyuk
@ 2021-03-17 23:17 ` Ranjit Menon
2021-03-18 7:49 ` Thomas Monjalon
2021-03-18 8:36 ` Slava Ovsiienko
2021-03-18 10:48 ` [dpdk-dev] [PATCH v2] " Thomas Monjalon
3 siblings, 1 reply; 12+ messages in thread
From: Ranjit Menon @ 2021-03-17 23:17 UTC (permalink / raw)
To: Thomas Monjalon, dev
Cc: dmitry.kozliuk, stable, Tal Shnaiderman, Narcisa Vasile,
John Alexander, Pallavi Kadam
Hi Thomas,
On 3/16/2021 4:11 PM, Thomas Monjalon wrote:
> In Windows probing, the value RTE_PCI_KDRV_NONE was used
> instead of RTE_PCI_KDRV_UNKNOWN (mlx case),
> and RTE_PCI_KDRV_NIC_UIO (FreeBSD) was re-used
> instead of having a new RTE_PCI_KDRV_NET_UIO for Windows NetUIO.
Shouldn't the mlx case actually remain RTE_PCI_KDRV_NONE?
mlx does not require a UIO-like kernel driver...No? And NONE implies that no kernel driver is used/required.
Not sure what is correct here.
> While adding the new value RTE_PCI_KDRV_NET_UIO,
> the enum of kernel driver categories is annotated.
>
> Fixes: b762221ac24f ("bus/pci: support Windows with bifurcated drivers")
> Fixes: c76ec01b4591 ("bus/pci: support netuio on Windows")
> Cc: stable@dpdk.org
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
> drivers/bus/pci/rte_bus_pci.h | 13 +++++++------
> drivers/bus/pci/windows/pci.c | 14 +++++++-------
> 2 files changed, 14 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/bus/pci/rte_bus_pci.h b/drivers/bus/pci/rte_bus_pci.h
> index fdda046515..3d009cc74b 100644
> --- a/drivers/bus/pci/rte_bus_pci.h
> +++ b/drivers/bus/pci/rte_bus_pci.h
> @@ -52,12 +52,13 @@ TAILQ_HEAD(rte_pci_driver_list, rte_pci_driver);
> struct rte_devargs;
>
> enum rte_pci_kernel_driver {
> - RTE_PCI_KDRV_UNKNOWN = 0,
> - RTE_PCI_KDRV_IGB_UIO,
> - RTE_PCI_KDRV_VFIO,
> - RTE_PCI_KDRV_UIO_GENERIC,
> - RTE_PCI_KDRV_NIC_UIO,
> - RTE_PCI_KDRV_NONE,
> + RTE_PCI_KDRV_UNKNOWN = 0, /* not listed - may be a bifurcated driver */
> + RTE_PCI_KDRV_IGB_UIO, /* igb_uio for Linux */
> + RTE_PCI_KDRV_VFIO, /* VFIO for Linux */
> + RTE_PCI_KDRV_UIO_GENERIC, /* uio_generic for Linux */
> + RTE_PCI_KDRV_NIC_UIO, /* nic_uio for FreeBSD */
> + RTE_PCI_KDRV_NONE, /* error */
> + RTE_PCI_KDRV_NET_UIO, /* NetUIO for Windows */
> };
>
Any chance we can re-order the enums, so that _NONE and _UNKNOWN are at
the top?
This will change the value, and break code where this value was
hard-coded. But how likely is that...?
ranjit m.
> /**
> diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c
> index 8f906097f4..3f0ce1fb83 100644
> --- a/drivers/bus/pci/windows/pci.c
> +++ b/drivers/bus/pci/windows/pci.c
> @@ -38,7 +38,7 @@ rte_pci_map_device(struct rte_pci_device *dev)
> * Devices that are bound to netuio are mapped at
> * the bus probing stage.
> */
> - if (dev->kdrv == RTE_PCI_KDRV_NIC_UIO)
> + if (dev->kdrv == RTE_PCI_KDRV_NET_UIO)
> return 0;
> else
> return -1;
> @@ -207,14 +207,14 @@ get_device_resource_info(HDEVINFO dev_info,
> int ret;
>
> switch (dev->kdrv) {
> - case RTE_PCI_KDRV_NONE:
> - /* mem_resource - Unneeded for RTE_PCI_KDRV_NONE */
> + case RTE_PCI_KDRV_UNKNOWN:
> + /* mem_resource is unneeded */
> dev->mem_resource[0].phys_addr = 0;
> dev->mem_resource[0].len = 0;
> dev->mem_resource[0].addr = NULL;
> break;
> - case RTE_PCI_KDRV_NIC_UIO:
> - /* get device info from netuio kernel driver */
> + case RTE_PCI_KDRV_NET_UIO:
> + /* get device info from NetUIO kernel driver */
> ret = get_netuio_device_info(dev_info, dev_info_data, dev);
> if (ret != 0) {
> RTE_LOG(DEBUG, EAL,
> @@ -323,9 +323,9 @@ set_kernel_driver_type(PSP_DEVINFO_DATA device_info_data,
> {
> /* set kernel driver type based on device class */
> if (IsEqualGUID(&(device_info_data->ClassGuid), &GUID_DEVCLASS_NETUIO))
> - dev->kdrv = RTE_PCI_KDRV_NIC_UIO;
> + dev->kdrv = RTE_PCI_KDRV_NET_UIO;
> else
> - dev->kdrv = RTE_PCI_KDRV_NONE;
> + dev->kdrv = RTE_PCI_KDRV_UNKNOWN;
> }
>
> static int
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH] bus/pci: fix Windows kernel driver categories
2021-03-17 22:43 ` Dmitry Kozlyuk
@ 2021-03-18 7:43 ` Thomas Monjalon
0 siblings, 0 replies; 12+ messages in thread
From: Thomas Monjalon @ 2021-03-18 7:43 UTC (permalink / raw)
To: Dmitry Kozlyuk
Cc: dev, stable, Tal Shnaiderman, Narcisa Vasile, Ranjit Menon,
John Alexander, Pallavi Kadam
17/03/2021 23:43, Dmitry Kozlyuk:
> 2021-03-17 00:11 (UTC+0100), Thomas Monjalon:
> [...]
> > diff --git a/drivers/bus/pci/rte_bus_pci.h b/drivers/bus/pci/rte_bus_pci.h
> > index fdda046515..3d009cc74b 100644
> > --- a/drivers/bus/pci/rte_bus_pci.h
> > +++ b/drivers/bus/pci/rte_bus_pci.h
> > @@ -52,12 +52,13 @@ TAILQ_HEAD(rte_pci_driver_list, rte_pci_driver);
> > struct rte_devargs;
> >
> > enum rte_pci_kernel_driver {
> > - RTE_PCI_KDRV_UNKNOWN = 0,
> > - RTE_PCI_KDRV_IGB_UIO,
> > - RTE_PCI_KDRV_VFIO,
> > - RTE_PCI_KDRV_UIO_GENERIC,
> > - RTE_PCI_KDRV_NIC_UIO,
> > - RTE_PCI_KDRV_NONE,
> > + RTE_PCI_KDRV_UNKNOWN = 0, /* not listed - may be a bifurcated driver */
> > + RTE_PCI_KDRV_IGB_UIO, /* igb_uio for Linux */
> > + RTE_PCI_KDRV_VFIO, /* VFIO for Linux */
> > + RTE_PCI_KDRV_UIO_GENERIC, /* uio_generic for Linux */
>
> Module name is "uio_pci_generic", otherwise
Oops, yes I will fix.
> Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH] bus/pci: fix Windows kernel driver categories
2021-03-17 23:17 ` Ranjit Menon
@ 2021-03-18 7:49 ` Thomas Monjalon
2021-03-18 22:00 ` Ranjit Menon
0 siblings, 1 reply; 12+ messages in thread
From: Thomas Monjalon @ 2021-03-18 7:49 UTC (permalink / raw)
To: Ranjit Menon
Cc: dev, dmitry.kozliuk, stable, Tal Shnaiderman, Narcisa Vasile,
John Alexander, Pallavi Kadam, matan, viacheslavo
18/03/2021 00:17, Ranjit Menon:
> Hi Thomas,
>
> On 3/16/2021 4:11 PM, Thomas Monjalon wrote:
> > In Windows probing, the value RTE_PCI_KDRV_NONE was used
> > instead of RTE_PCI_KDRV_UNKNOWN (mlx case),
> > and RTE_PCI_KDRV_NIC_UIO (FreeBSD) was re-used
> > instead of having a new RTE_PCI_KDRV_NET_UIO for Windows NetUIO.
> Shouldn't the mlx case actually remain RTE_PCI_KDRV_NONE?
>
> mlx does not require a UIO-like kernel driver...No? And NONE implies that no kernel driver is used/required.
> Not sure what is correct here.
No this is a bifurcated model, meaning kernel and userland
work together. The PCI device is bound to the kernel driver,
but the driver is not listed because no special treatment is required.
> > While adding the new value RTE_PCI_KDRV_NET_UIO,
> > the enum of kernel driver categories is annotated.
> >
> > Fixes: b762221ac24f ("bus/pci: support Windows with bifurcated drivers")
> > Fixes: c76ec01b4591 ("bus/pci: support netuio on Windows")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> > ---
> > drivers/bus/pci/rte_bus_pci.h | 13 +++++++------
> > drivers/bus/pci/windows/pci.c | 14 +++++++-------
> > 2 files changed, 14 insertions(+), 13 deletions(-)
> >
> > diff --git a/drivers/bus/pci/rte_bus_pci.h b/drivers/bus/pci/rte_bus_pci.h
> > index fdda046515..3d009cc74b 100644
> > --- a/drivers/bus/pci/rte_bus_pci.h
> > +++ b/drivers/bus/pci/rte_bus_pci.h
> > @@ -52,12 +52,13 @@ TAILQ_HEAD(rte_pci_driver_list, rte_pci_driver);
> > struct rte_devargs;
> >
> > enum rte_pci_kernel_driver {
> > - RTE_PCI_KDRV_UNKNOWN = 0,
> > - RTE_PCI_KDRV_IGB_UIO,
> > - RTE_PCI_KDRV_VFIO,
> > - RTE_PCI_KDRV_UIO_GENERIC,
> > - RTE_PCI_KDRV_NIC_UIO,
> > - RTE_PCI_KDRV_NONE,
> > + RTE_PCI_KDRV_UNKNOWN = 0, /* not listed - may be a bifurcated driver */
> > + RTE_PCI_KDRV_IGB_UIO, /* igb_uio for Linux */
> > + RTE_PCI_KDRV_VFIO, /* VFIO for Linux */
> > + RTE_PCI_KDRV_UIO_GENERIC, /* uio_generic for Linux */
> > + RTE_PCI_KDRV_NIC_UIO, /* nic_uio for FreeBSD */
> > + RTE_PCI_KDRV_NONE, /* error */
> > + RTE_PCI_KDRV_NET_UIO, /* NetUIO for Windows */
> > };
> >
>
> Any chance we can re-order the enums, so that _NONE and _UNKNOWN are at
> the top?
No, it would break the ABI.
> This will change the value, and break code where this value was
> hard-coded. But how likely is that...?
The problem is when loading the new PCI bus driver with an old device driver.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH] bus/pci: fix Windows kernel driver categories
2021-03-16 23:11 [dpdk-dev] [PATCH] bus/pci: fix Windows kernel driver categories Thomas Monjalon
2021-03-17 22:43 ` Dmitry Kozlyuk
2021-03-17 23:17 ` Ranjit Menon
@ 2021-03-18 8:36 ` Slava Ovsiienko
2021-03-18 10:45 ` Thomas Monjalon
2021-03-18 10:48 ` [dpdk-dev] [PATCH v2] " Thomas Monjalon
3 siblings, 1 reply; 12+ messages in thread
From: Slava Ovsiienko @ 2021-03-18 8:36 UTC (permalink / raw)
To: NBU-Contact-Thomas Monjalon, dev
Cc: dmitry.kozliuk, stable, Tal Shnaiderman, Narcisa Vasile,
Ranjit Menon, John Alexander, Pallavi Kadam
Hi, Thomas
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Thomas Monjalon
> Sent: Wednesday, March 17, 2021 1:12
> To: dev@dpdk.org
> Cc: dmitry.kozliuk@gmail.com; stable@dpdk.org; Tal Shnaiderman
> <talshn@nvidia.com>; Narcisa Vasile <navasile@linux.microsoft.com>; Ranjit
> Menon <ranjit.menon@intel.com>; John Alexander
> <john.alexander@datapath.co.uk>; Pallavi Kadam
> <pallavi.kadam@intel.com>
> Subject: [dpdk-dev] [PATCH] bus/pci: fix Windows kernel driver categories
>
> In Windows probing, the value RTE_PCI_KDRV_NONE was used instead of
> RTE_PCI_KDRV_UNKNOWN (mlx case), and RTE_PCI_KDRV_NIC_UIO
> (FreeBSD) was re-used instead of having a new RTE_PCI_KDRV_NET_UIO for
> Windows NetUIO.
As far as I understand - under Windows there is always some kernel driver
backing the device, hence, RTE_PCI_KDRV_NONE is not an option and
RTE_PCI_KDRV_UNKNOWN is more appropriate. I would add this extra
explanation in commit message.
With best regards,
Slava
>
> While adding the new value RTE_PCI_KDRV_NET_UIO, the enum of kernel
> driver categories is annotated.
>
> Fixes: b762221ac24f ("bus/pci: support Windows with bifurcated drivers")
> Fixes: c76ec01b4591 ("bus/pci: support netuio on Windows")
> Cc: stable@dpdk.org
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
> drivers/bus/pci/rte_bus_pci.h | 13 +++++++------
> drivers/bus/pci/windows/pci.c | 14 +++++++-------
> 2 files changed, 14 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/bus/pci/rte_bus_pci.h b/drivers/bus/pci/rte_bus_pci.h
> index fdda046515..3d009cc74b 100644
> --- a/drivers/bus/pci/rte_bus_pci.h
> +++ b/drivers/bus/pci/rte_bus_pci.h
> @@ -52,12 +52,13 @@ TAILQ_HEAD(rte_pci_driver_list, rte_pci_driver);
> struct rte_devargs;
>
> enum rte_pci_kernel_driver {
> - RTE_PCI_KDRV_UNKNOWN = 0,
> - RTE_PCI_KDRV_IGB_UIO,
> - RTE_PCI_KDRV_VFIO,
> - RTE_PCI_KDRV_UIO_GENERIC,
> - RTE_PCI_KDRV_NIC_UIO,
> - RTE_PCI_KDRV_NONE,
> + RTE_PCI_KDRV_UNKNOWN = 0, /* not listed - may be a bifurcated
> driver */
> + RTE_PCI_KDRV_IGB_UIO, /* igb_uio for Linux */
> + RTE_PCI_KDRV_VFIO, /* VFIO for Linux */
> + RTE_PCI_KDRV_UIO_GENERIC, /* uio_generic for Linux */
> + RTE_PCI_KDRV_NIC_UIO, /* nic_uio for FreeBSD */
> + RTE_PCI_KDRV_NONE, /* error */
> + RTE_PCI_KDRV_NET_UIO, /* NetUIO for Windows */
> };
>
> /**
> diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c
> index 8f906097f4..3f0ce1fb83 100644
> --- a/drivers/bus/pci/windows/pci.c
> +++ b/drivers/bus/pci/windows/pci.c
> @@ -38,7 +38,7 @@ rte_pci_map_device(struct rte_pci_device *dev)
> * Devices that are bound to netuio are mapped at
> * the bus probing stage.
> */
> - if (dev->kdrv == RTE_PCI_KDRV_NIC_UIO)
> + if (dev->kdrv == RTE_PCI_KDRV_NET_UIO)
> return 0;
> else
> return -1;
> @@ -207,14 +207,14 @@ get_device_resource_info(HDEVINFO dev_info,
> int ret;
>
> switch (dev->kdrv) {
> - case RTE_PCI_KDRV_NONE:
> - /* mem_resource - Unneeded for RTE_PCI_KDRV_NONE */
> + case RTE_PCI_KDRV_UNKNOWN:
> + /* mem_resource is unneeded */
> dev->mem_resource[0].phys_addr = 0;
> dev->mem_resource[0].len = 0;
> dev->mem_resource[0].addr = NULL;
> break;
> - case RTE_PCI_KDRV_NIC_UIO:
> - /* get device info from netuio kernel driver */
> + case RTE_PCI_KDRV_NET_UIO:
> + /* get device info from NetUIO kernel driver */
> ret = get_netuio_device_info(dev_info, dev_info_data,
> dev);
> if (ret != 0) {
> RTE_LOG(DEBUG, EAL,
> @@ -323,9 +323,9 @@ set_kernel_driver_type(PSP_DEVINFO_DATA
> device_info_data, {
> /* set kernel driver type based on device class */
> if (IsEqualGUID(&(device_info_data->ClassGuid),
> &GUID_DEVCLASS_NETUIO))
> - dev->kdrv = RTE_PCI_KDRV_NIC_UIO;
> + dev->kdrv = RTE_PCI_KDRV_NET_UIO;
> else
> - dev->kdrv = RTE_PCI_KDRV_NONE;
> + dev->kdrv = RTE_PCI_KDRV_UNKNOWN;
> }
>
> static int
> --
> 2.30.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH] bus/pci: fix Windows kernel driver categories
2021-03-18 8:36 ` Slava Ovsiienko
@ 2021-03-18 10:45 ` Thomas Monjalon
0 siblings, 0 replies; 12+ messages in thread
From: Thomas Monjalon @ 2021-03-18 10:45 UTC (permalink / raw)
To: Slava Ovsiienko
Cc: dev, dmitry.kozliuk, stable, Tal Shnaiderman, Narcisa Vasile,
Ranjit Menon, John Alexander, Pallavi Kadam
18/03/2021 09:36, Slava Ovsiienko:
> From: Thomas Monjalon
> > In Windows probing, the value RTE_PCI_KDRV_NONE was used instead of
> > RTE_PCI_KDRV_UNKNOWN (mlx case), and RTE_PCI_KDRV_NIC_UIO
> > (FreeBSD) was re-used instead of having a new RTE_PCI_KDRV_NET_UIO for
> > Windows NetUIO.
>
> As far as I understand - under Windows there is always some kernel driver
> backing the device, hence, RTE_PCI_KDRV_NONE is not an option and
> RTE_PCI_KDRV_UNKNOWN is more appropriate. I would add this extra
> explanation in commit message.
The reason is that NONE is not appropriate because there *is* a kernel
driver backing the device in mlx case.
And it is aligning with Linux.
I will improve the message and comments.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [dpdk-dev] [PATCH v2] bus/pci: fix Windows kernel driver categories
2021-03-16 23:11 [dpdk-dev] [PATCH] bus/pci: fix Windows kernel driver categories Thomas Monjalon
` (2 preceding siblings ...)
2021-03-18 8:36 ` Slava Ovsiienko
@ 2021-03-18 10:48 ` Thomas Monjalon
2021-03-18 12:00 ` Tal Shnaiderman
2021-03-18 22:07 ` Ranjit Menon
3 siblings, 2 replies; 12+ messages in thread
From: Thomas Monjalon @ 2021-03-18 10:48 UTC (permalink / raw)
To: dev
Cc: dmitry.kozliuk, stable, Tal Shnaiderman, Ranjit Menon,
Narcisa Vasile, Pallavi Kadam, John Alexander
In Windows probing, the value RTE_PCI_KDRV_NONE was used
instead of RTE_PCI_KDRV_UNKNOWN.
This value covers the mlx case where the kernel driver is in place,
offering a bifurcated mode to the userspace driver.
When the kernel driver is listed as unknown,
there is no special treatment in DPDK probing, contrary to UIO modes.
The value RTE_PCI_KDRV_NIC_UIO (FreeBSD) was re-used
instead of having a new RTE_PCI_KDRV_NET_UIO for Windows NetUIO.
While adding the new value RTE_PCI_KDRV_NET_UIO
(at the end for ABI compatibility),
the enum of kernel driver categories is annotated.
Fixes: b762221ac24f ("bus/pci: support Windows with bifurcated drivers")
Fixes: c76ec01b4591 ("bus/pci: support netuio on Windows")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
---
v2: improve comments and commit message
---
drivers/bus/pci/rte_bus_pci.h | 13 +++++++------
drivers/bus/pci/windows/pci.c | 14 +++++++-------
2 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/drivers/bus/pci/rte_bus_pci.h b/drivers/bus/pci/rte_bus_pci.h
index fdda046515..876abddefb 100644
--- a/drivers/bus/pci/rte_bus_pci.h
+++ b/drivers/bus/pci/rte_bus_pci.h
@@ -52,12 +52,13 @@ TAILQ_HEAD(rte_pci_driver_list, rte_pci_driver);
struct rte_devargs;
enum rte_pci_kernel_driver {
- RTE_PCI_KDRV_UNKNOWN = 0,
- RTE_PCI_KDRV_IGB_UIO,
- RTE_PCI_KDRV_VFIO,
- RTE_PCI_KDRV_UIO_GENERIC,
- RTE_PCI_KDRV_NIC_UIO,
- RTE_PCI_KDRV_NONE,
+ RTE_PCI_KDRV_UNKNOWN = 0, /* may be misc UIO or bifurcated driver */
+ RTE_PCI_KDRV_IGB_UIO, /* igb_uio for Linux */
+ RTE_PCI_KDRV_VFIO, /* VFIO for Linux */
+ RTE_PCI_KDRV_UIO_GENERIC, /* uio_pci_generic for Linux */
+ RTE_PCI_KDRV_NIC_UIO, /* nic_uio for FreeBSD */
+ RTE_PCI_KDRV_NONE, /* no attached driver */
+ RTE_PCI_KDRV_NET_UIO, /* NetUIO for Windows */
};
/**
diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c
index 8f906097f4..d39a7748b8 100644
--- a/drivers/bus/pci/windows/pci.c
+++ b/drivers/bus/pci/windows/pci.c
@@ -38,7 +38,7 @@ rte_pci_map_device(struct rte_pci_device *dev)
* Devices that are bound to netuio are mapped at
* the bus probing stage.
*/
- if (dev->kdrv == RTE_PCI_KDRV_NIC_UIO)
+ if (dev->kdrv == RTE_PCI_KDRV_NET_UIO)
return 0;
else
return -1;
@@ -207,14 +207,14 @@ get_device_resource_info(HDEVINFO dev_info,
int ret;
switch (dev->kdrv) {
- case RTE_PCI_KDRV_NONE:
- /* mem_resource - Unneeded for RTE_PCI_KDRV_NONE */
+ case RTE_PCI_KDRV_UNKNOWN:
+ /* bifurcated driver case - mem_resource is unneeded */
dev->mem_resource[0].phys_addr = 0;
dev->mem_resource[0].len = 0;
dev->mem_resource[0].addr = NULL;
break;
- case RTE_PCI_KDRV_NIC_UIO:
- /* get device info from netuio kernel driver */
+ case RTE_PCI_KDRV_NET_UIO:
+ /* get device info from NetUIO kernel driver */
ret = get_netuio_device_info(dev_info, dev_info_data, dev);
if (ret != 0) {
RTE_LOG(DEBUG, EAL,
@@ -323,9 +323,9 @@ set_kernel_driver_type(PSP_DEVINFO_DATA device_info_data,
{
/* set kernel driver type based on device class */
if (IsEqualGUID(&(device_info_data->ClassGuid), &GUID_DEVCLASS_NETUIO))
- dev->kdrv = RTE_PCI_KDRV_NIC_UIO;
+ dev->kdrv = RTE_PCI_KDRV_NET_UIO;
else
- dev->kdrv = RTE_PCI_KDRV_NONE;
+ dev->kdrv = RTE_PCI_KDRV_UNKNOWN;
}
static int
--
2.30.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH v2] bus/pci: fix Windows kernel driver categories
2021-03-18 10:48 ` [dpdk-dev] [PATCH v2] " Thomas Monjalon
@ 2021-03-18 12:00 ` Tal Shnaiderman
2021-03-18 22:07 ` Ranjit Menon
1 sibling, 0 replies; 12+ messages in thread
From: Tal Shnaiderman @ 2021-03-18 12:00 UTC (permalink / raw)
To: NBU-Contact-Thomas Monjalon, dev
Cc: dmitry.kozliuk, stable, Ranjit Menon, Narcisa Vasile,
Pallavi Kadam, John Alexander
> Subject: [PATCH v2] bus/pci: fix Windows kernel driver categories
>
> In Windows probing, the value RTE_PCI_KDRV_NONE was used instead of
> RTE_PCI_KDRV_UNKNOWN.
> This value covers the mlx case where the kernel driver is in place, offering a
> bifurcated mode to the userspace driver.
> When the kernel driver is listed as unknown, there is no special treatment in
> DPDK probing, contrary to UIO modes.
>
> The value RTE_PCI_KDRV_NIC_UIO (FreeBSD) was re-used instead of having
> a new RTE_PCI_KDRV_NET_UIO for Windows NetUIO.
> While adding the new value RTE_PCI_KDRV_NET_UIO (at the end for ABI
> compatibility), the enum of kernel driver categories is annotated.
>
> Fixes: b762221ac24f ("bus/pci: support Windows with bifurcated drivers")
> Fixes: c76ec01b4591 ("bus/pci: support netuio on Windows")
> Cc: stable@dpdk.org
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
> ---
> v2: improve comments and commit message
> ---
> drivers/bus/pci/rte_bus_pci.h | 13 +++++++------
> drivers/bus/pci/windows/pci.c | 14 +++++++-------
> 2 files changed, 14 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/bus/pci/rte_bus_pci.h b/drivers/bus/pci/rte_bus_pci.h
> index fdda046515..876abddefb 100644
> --- a/drivers/bus/pci/rte_bus_pci.h
> +++ b/drivers/bus/pci/rte_bus_pci.h
> @@ -52,12 +52,13 @@ TAILQ_HEAD(rte_pci_driver_list, rte_pci_driver);
> struct rte_devargs;
>
> enum rte_pci_kernel_driver {
> - RTE_PCI_KDRV_UNKNOWN = 0,
> - RTE_PCI_KDRV_IGB_UIO,
> - RTE_PCI_KDRV_VFIO,
> - RTE_PCI_KDRV_UIO_GENERIC,
> - RTE_PCI_KDRV_NIC_UIO,
> - RTE_PCI_KDRV_NONE,
> + RTE_PCI_KDRV_UNKNOWN = 0, /* may be misc UIO or bifurcated
> driver */
> + RTE_PCI_KDRV_IGB_UIO, /* igb_uio for Linux */
> + RTE_PCI_KDRV_VFIO, /* VFIO for Linux */
> + RTE_PCI_KDRV_UIO_GENERIC, /* uio_pci_generic for Linux */
> + RTE_PCI_KDRV_NIC_UIO, /* nic_uio for FreeBSD */
> + RTE_PCI_KDRV_NONE, /* no attached driver */
> + RTE_PCI_KDRV_NET_UIO, /* NetUIO for Windows */
> };
>
> /**
> diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c
> index 8f906097f4..d39a7748b8 100644
> --- a/drivers/bus/pci/windows/pci.c
> +++ b/drivers/bus/pci/windows/pci.c
> @@ -38,7 +38,7 @@ rte_pci_map_device(struct rte_pci_device *dev)
> * Devices that are bound to netuio are mapped at
> * the bus probing stage.
> */
> - if (dev->kdrv == RTE_PCI_KDRV_NIC_UIO)
> + if (dev->kdrv == RTE_PCI_KDRV_NET_UIO)
> return 0;
> else
> return -1;
> @@ -207,14 +207,14 @@ get_device_resource_info(HDEVINFO dev_info,
> int ret;
>
> switch (dev->kdrv) {
> - case RTE_PCI_KDRV_NONE:
> - /* mem_resource - Unneeded for RTE_PCI_KDRV_NONE */
> + case RTE_PCI_KDRV_UNKNOWN:
> + /* bifurcated driver case - mem_resource is unneeded */
> dev->mem_resource[0].phys_addr = 0;
> dev->mem_resource[0].len = 0;
> dev->mem_resource[0].addr = NULL;
> break;
> - case RTE_PCI_KDRV_NIC_UIO:
> - /* get device info from netuio kernel driver */
> + case RTE_PCI_KDRV_NET_UIO:
> + /* get device info from NetUIO kernel driver */
> ret = get_netuio_device_info(dev_info, dev_info_data,
> dev);
> if (ret != 0) {
> RTE_LOG(DEBUG, EAL,
> @@ -323,9 +323,9 @@ set_kernel_driver_type(PSP_DEVINFO_DATA
> device_info_data, {
> /* set kernel driver type based on device class */
> if (IsEqualGUID(&(device_info_data->ClassGuid),
> &GUID_DEVCLASS_NETUIO))
> - dev->kdrv = RTE_PCI_KDRV_NIC_UIO;
> + dev->kdrv = RTE_PCI_KDRV_NET_UIO;
> else
> - dev->kdrv = RTE_PCI_KDRV_NONE;
> + dev->kdrv = RTE_PCI_KDRV_UNKNOWN;
> }
>
> static int
> --
> 2.30.1
Acked-by: Tal Shnaiderman <talshn@nvidia.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH] bus/pci: fix Windows kernel driver categories
2021-03-18 7:49 ` Thomas Monjalon
@ 2021-03-18 22:00 ` Ranjit Menon
0 siblings, 0 replies; 12+ messages in thread
From: Ranjit Menon @ 2021-03-18 22:00 UTC (permalink / raw)
To: Thomas Monjalon
Cc: dev, dmitry.kozliuk, stable, Tal Shnaiderman, Narcisa Vasile,
John Alexander, Pallavi Kadam, matan, viacheslavo
On 3/18/2021 12:49 AM, Thomas Monjalon wrote:
> 18/03/2021 00:17, Ranjit Menon:
>> Hi Thomas,
>>
>> On 3/16/2021 4:11 PM, Thomas Monjalon wrote:
>>> In Windows probing, the value RTE_PCI_KDRV_NONE was used
>>> instead of RTE_PCI_KDRV_UNKNOWN (mlx case),
>>> and RTE_PCI_KDRV_NIC_UIO (FreeBSD) was re-used
>>> instead of having a new RTE_PCI_KDRV_NET_UIO for Windows NetUIO.
>> Shouldn't the mlx case actually remain RTE_PCI_KDRV_NONE?
>>
>> mlx does not require a UIO-like kernel driver...No? And NONE implies that no kernel driver is used/required.
>> Not sure what is correct here.
> No this is a bifurcated model, meaning kernel and userland
> work together. The PCI device is bound to the kernel driver,
> but the driver is not listed because no special treatment is required.
>
>>> While adding the new value RTE_PCI_KDRV_NET_UIO,
>>> the enum of kernel driver categories is annotated.
>>>
>>> Fixes: b762221ac24f ("bus/pci: support Windows with bifurcated drivers")
>>> Fixes: c76ec01b4591 ("bus/pci: support netuio on Windows")
>>> Cc: stable@dpdk.org
>>>
>>> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
>>> ---
>>> drivers/bus/pci/rte_bus_pci.h | 13 +++++++------
>>> drivers/bus/pci/windows/pci.c | 14 +++++++-------
>>> 2 files changed, 14 insertions(+), 13 deletions(-)
>>>
>>> diff --git a/drivers/bus/pci/rte_bus_pci.h b/drivers/bus/pci/rte_bus_pci.h
>>> index fdda046515..3d009cc74b 100644
>>> --- a/drivers/bus/pci/rte_bus_pci.h
>>> +++ b/drivers/bus/pci/rte_bus_pci.h
>>> @@ -52,12 +52,13 @@ TAILQ_HEAD(rte_pci_driver_list, rte_pci_driver);
>>> struct rte_devargs;
>>>
>>> enum rte_pci_kernel_driver {
>>> - RTE_PCI_KDRV_UNKNOWN = 0,
>>> - RTE_PCI_KDRV_IGB_UIO,
>>> - RTE_PCI_KDRV_VFIO,
>>> - RTE_PCI_KDRV_UIO_GENERIC,
>>> - RTE_PCI_KDRV_NIC_UIO,
>>> - RTE_PCI_KDRV_NONE,
>>> + RTE_PCI_KDRV_UNKNOWN = 0, /* not listed - may be a bifurcated driver */
>>> + RTE_PCI_KDRV_IGB_UIO, /* igb_uio for Linux */
>>> + RTE_PCI_KDRV_VFIO, /* VFIO for Linux */
>>> + RTE_PCI_KDRV_UIO_GENERIC, /* uio_generic for Linux */
>>> + RTE_PCI_KDRV_NIC_UIO, /* nic_uio for FreeBSD */
>>> + RTE_PCI_KDRV_NONE, /* error */
>>> + RTE_PCI_KDRV_NET_UIO, /* NetUIO for Windows */
>>> };
>>>
>> Any chance we can re-order the enums, so that _NONE and _UNKNOWN are at
>> the top?
> No, it would break the ABI.
>
>> This will change the value, and break code where this value was
>> hard-coded. But how likely is that...?
> The problem is when loading the new PCI bus driver with an old device driver.
>
>
>
OK. Thanks for the explanation, Thomas.
ranjit m.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH v2] bus/pci: fix Windows kernel driver categories
2021-03-18 10:48 ` [dpdk-dev] [PATCH v2] " Thomas Monjalon
2021-03-18 12:00 ` Tal Shnaiderman
@ 2021-03-18 22:07 ` Ranjit Menon
2021-03-19 15:24 ` Thomas Monjalon
1 sibling, 1 reply; 12+ messages in thread
From: Ranjit Menon @ 2021-03-18 22:07 UTC (permalink / raw)
To: Thomas Monjalon, dev
Cc: dmitry.kozliuk, stable, Tal Shnaiderman, Narcisa Vasile,
Pallavi Kadam, John Alexander
On 3/18/2021 3:48 AM, Thomas Monjalon wrote:
> In Windows probing, the value RTE_PCI_KDRV_NONE was used
> instead of RTE_PCI_KDRV_UNKNOWN.
> This value covers the mlx case where the kernel driver is in place,
> offering a bifurcated mode to the userspace driver.
> When the kernel driver is listed as unknown,
> there is no special treatment in DPDK probing, contrary to UIO modes.
>
> The value RTE_PCI_KDRV_NIC_UIO (FreeBSD) was re-used
> instead of having a new RTE_PCI_KDRV_NET_UIO for Windows NetUIO.
> While adding the new value RTE_PCI_KDRV_NET_UIO
> (at the end for ABI compatibility),
> the enum of kernel driver categories is annotated.
>
> Fixes: b762221ac24f ("bus/pci: support Windows with bifurcated drivers")
> Fixes: c76ec01b4591 ("bus/pci: support netuio on Windows")
> Cc: stable@dpdk.org
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
> ---
> v2: improve comments and commit message
> ---
> drivers/bus/pci/rte_bus_pci.h | 13 +++++++------
> drivers/bus/pci/windows/pci.c | 14 +++++++-------
> 2 files changed, 14 insertions(+), 13 deletions(-)
>
Acked-by: Ranjit Menon <ranjit.menon@intel.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH v2] bus/pci: fix Windows kernel driver categories
2021-03-18 22:07 ` Ranjit Menon
@ 2021-03-19 15:24 ` Thomas Monjalon
0 siblings, 0 replies; 12+ messages in thread
From: Thomas Monjalon @ 2021-03-19 15:24 UTC (permalink / raw)
To: dev
Cc: dmitry.kozliuk, stable, Tal Shnaiderman, Narcisa Vasile,
Pallavi Kadam, John Alexander, Ranjit Menon
18/03/2021 23:07, Ranjit Menon:
> On 3/18/2021 3:48 AM, Thomas Monjalon wrote:
> > In Windows probing, the value RTE_PCI_KDRV_NONE was used
> > instead of RTE_PCI_KDRV_UNKNOWN.
> > This value covers the mlx case where the kernel driver is in place,
> > offering a bifurcated mode to the userspace driver.
> > When the kernel driver is listed as unknown,
> > there is no special treatment in DPDK probing, contrary to UIO modes.
> >
> > The value RTE_PCI_KDRV_NIC_UIO (FreeBSD) was re-used
> > instead of having a new RTE_PCI_KDRV_NET_UIO for Windows NetUIO.
> > While adding the new value RTE_PCI_KDRV_NET_UIO
> > (at the end for ABI compatibility),
> > the enum of kernel driver categories is annotated.
> >
> > Fixes: b762221ac24f ("bus/pci: support Windows with bifurcated drivers")
> > Fixes: c76ec01b4591 ("bus/pci: support netuio on Windows")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> > Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
> Acked-by: Tal Shnaiderman <talshn@nvidia.com>
> Acked-by: Ranjit Menon <ranjit.menon@intel.com>
Applied
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2021-03-19 15:24 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-16 23:11 [dpdk-dev] [PATCH] bus/pci: fix Windows kernel driver categories Thomas Monjalon
2021-03-17 22:43 ` Dmitry Kozlyuk
2021-03-18 7:43 ` Thomas Monjalon
2021-03-17 23:17 ` Ranjit Menon
2021-03-18 7:49 ` Thomas Monjalon
2021-03-18 22:00 ` Ranjit Menon
2021-03-18 8:36 ` Slava Ovsiienko
2021-03-18 10:45 ` Thomas Monjalon
2021-03-18 10:48 ` [dpdk-dev] [PATCH v2] " Thomas Monjalon
2021-03-18 12:00 ` Tal Shnaiderman
2021-03-18 22:07 ` Ranjit Menon
2021-03-19 15:24 ` Thomas Monjalon
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).