patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] bus/pci: assign driver's pointer before mapping
@ 2022-01-19 14:50 Michal Krawczyk
  2022-02-24 14:17 ` Michał Krawczyk
  2022-02-27 19:14 ` Thomas Monjalon
  0 siblings, 2 replies; 3+ messages in thread
From: Michal Krawczyk @ 2022-01-19 14:50 UTC (permalink / raw)
  To: dev; +Cc: upstream, shaibran, Michal Krawczyk, hkalra, stable

Patch changing the way of accessing interrupt handle also changed order
of the rte_pci_map_device() call and rte_pci_device:driver assignment.
It was causing issues with Write Combine mapping on the Linux platform
if it was used with the igb_uio module.

Linux implementation of pci_uio_map_resource_by_index(), which is called
by rte_pci_map_device(), needs access to the device's driver. Otherwise
it won't be able to check the driver's flags and won't respect them.

Fixes: d61138d4f0e2 ("drivers: remove direct access to interrupt handle")
Cc: hkalra@marvell.com
Cc: stable@dpdk.org

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
---
 drivers/bus/pci/pci_common.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c
index 4a3a87f24f..def372b67e 100644
--- a/drivers/bus/pci/pci_common.c
+++ b/drivers/bus/pci/pci_common.c
@@ -247,9 +247,12 @@ rte_pci_probe_one_driver(struct rte_pci_driver *dr,
 			return -ENOMEM;
 		}
 
+		dev->driver = dr;
+
 		if (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING) {
 			ret = rte_pci_map_device(dev);
 			if (ret != 0) {
+				dev->driver = NULL;
 				rte_intr_instance_free(dev->vfio_req_intr_handle);
 				dev->vfio_req_intr_handle = NULL;
 				rte_intr_instance_free(dev->intr_handle);
@@ -257,8 +260,6 @@ rte_pci_probe_one_driver(struct rte_pci_driver *dr,
 				return ret;
 			}
 		}
-
-		dev->driver = dr;
 	}
 
 	RTE_LOG(INFO, EAL, "Probe PCI driver: %s (%x:%x) device: "PCI_PRI_FMT" (socket %i)\n",
-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] bus/pci: assign driver's pointer before mapping
  2022-01-19 14:50 [PATCH] bus/pci: assign driver's pointer before mapping Michal Krawczyk
@ 2022-02-24 14:17 ` Michał Krawczyk
  2022-02-27 19:14 ` Thomas Monjalon
  1 sibling, 0 replies; 3+ messages in thread
From: Michał Krawczyk @ 2022-02-24 14:17 UTC (permalink / raw)
  To: dev
  Cc: upstream, Brandes, Shai, Harman Kalra, stable, Ferruh Yigit,
	Thomas Monjalon

śr., 19 sty 2022 o 15:50 Michal Krawczyk <mk@semihalf.com> napisał(a):
>
> Patch changing the way of accessing interrupt handle also changed order
> of the rte_pci_map_device() call and rte_pci_device:driver assignment.
> It was causing issues with Write Combine mapping on the Linux platform
> if it was used with the igb_uio module.
>
> Linux implementation of pci_uio_map_resource_by_index(), which is called
> by rte_pci_map_device(), needs access to the device's driver. Otherwise
> it won't be able to check the driver's flags and won't respect them.
>
> Fixes: d61138d4f0e2 ("drivers: remove direct access to interrupt handle")
> Cc: hkalra@marvell.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Michal Krawczyk <mk@semihalf.com>
> ---

Hi,
is there any chance that this fix will land for v22.03-rc2? Without
that, we suffer a huge performance impact for the ENA PMD.

Thanks,
Michal

>  drivers/bus/pci/pci_common.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c
> index 4a3a87f24f..def372b67e 100644
> --- a/drivers/bus/pci/pci_common.c
> +++ b/drivers/bus/pci/pci_common.c
> @@ -247,9 +247,12 @@ rte_pci_probe_one_driver(struct rte_pci_driver *dr,
>                         return -ENOMEM;
>                 }
>
> +               dev->driver = dr;
> +
>                 if (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING) {
>                         ret = rte_pci_map_device(dev);
>                         if (ret != 0) {
> +                               dev->driver = NULL;
>                                 rte_intr_instance_free(dev->vfio_req_intr_handle);
>                                 dev->vfio_req_intr_handle = NULL;
>                                 rte_intr_instance_free(dev->intr_handle);
> @@ -257,8 +260,6 @@ rte_pci_probe_one_driver(struct rte_pci_driver *dr,
>                                 return ret;
>                         }
>                 }
> -
> -               dev->driver = dr;
>         }
>
>         RTE_LOG(INFO, EAL, "Probe PCI driver: %s (%x:%x) device: "PCI_PRI_FMT" (socket %i)\n",
> --
> 2.25.1
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] bus/pci: assign driver's pointer before mapping
  2022-01-19 14:50 [PATCH] bus/pci: assign driver's pointer before mapping Michal Krawczyk
  2022-02-24 14:17 ` Michał Krawczyk
@ 2022-02-27 19:14 ` Thomas Monjalon
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2022-02-27 19:14 UTC (permalink / raw)
  To: Michal Krawczyk; +Cc: dev, stable, upstream, shaibran, hkalra

19/01/2022 15:50, Michal Krawczyk:
> Patch changing the way of accessing interrupt handle also changed order
> of the rte_pci_map_device() call and rte_pci_device:driver assignment.
> It was causing issues with Write Combine mapping on the Linux platform
> if it was used with the igb_uio module.
> 
> Linux implementation of pci_uio_map_resource_by_index(), which is called
> by rte_pci_map_device(), needs access to the device's driver. Otherwise
> it won't be able to check the driver's flags and won't respect them.
> 
> Fixes: d61138d4f0e2 ("drivers: remove direct access to interrupt handle")
> Cc: hkalra@marvell.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Michal Krawczyk <mk@semihalf.com>

Looks to be a simple change. I hope there is no side effect.
Applied, thanks.




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-27 19:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-19 14:50 [PATCH] bus/pci: assign driver's pointer before mapping Michal Krawczyk
2022-02-24 14:17 ` Michał Krawczyk
2022-02-27 19:14 ` 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).