From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <stable-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 92CA0A034E
	for <public@inbox.dpdk.org>; Thu, 24 Feb 2022 15:17:41 +0100 (CET)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 87D4C4114D;
	Thu, 24 Feb 2022 15:17:41 +0100 (CET)
Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com
 [209.85.219.42]) by mails.dpdk.org (Postfix) with ESMTP id 9E9994114D
 for <stable@dpdk.org>; Thu, 24 Feb 2022 15:17:39 +0100 (CET)
Received: by mail-qv1-f42.google.com with SMTP id bu6so3692088qvb.10
 for <stable@dpdk.org>; Thu, 24 Feb 2022 06:17:39 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=semihalf-com.20210112.gappssmtp.com; s=20210112;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc:content-transfer-encoding;
 bh=WViP2cInWhi6qcQvSz+Nyiq5PWcvM///YcpZTQTJmjs=;
 b=Mi/1ZDnIPGzAEY5nbP6m3DruBe2J/LtmcTwo/r4vV6O6RRyZNjdo2LWx8ivHeHPvPJ
 9HuyBKgMFux6KiM12/awXMIBE+qS7Yol2WDyrzM08p5woeFAa3mvR+6lY2VVy7W9m37G
 IVoqrdUsWtP0QahQ7MUgBau2h/sZsi5qNex8QXFDtacmB7qcR+Hs48CEcfL6Mpsuxfeo
 KPZ1YswSK/yP0zHtb6mWHq5PwA/sF71W0hHSdIa5LKcSIo0W+XbhU1kU0gZ26DQX73PR
 ETkm7mCIckuNhziu5Mb3FfS2pUB3sLtAB4sKY+cGk7+Jxhj8tJFALjqsSWLNDXjDDS/1
 4kTQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc:content-transfer-encoding;
 bh=WViP2cInWhi6qcQvSz+Nyiq5PWcvM///YcpZTQTJmjs=;
 b=frjB7S4MEhDBv/DdT/BQJ5htZt+hveJEHWmvsf3/d0z576NfNM7gI5sfS2l40FlmQd
 dIzehaEKKGwe2vuhcto2USD4PO0iSYsRrP1B7IZuj68nZsCA6qdxUzqWUlBKMTCiKsjh
 QN22gjcu566LyavjXDX/lnIJoqYVn2sENS8NG8Ho/UrloXVWdfuY4WFBMSN23PYM5qBC
 m31W50b669F6avwp4ku4ZXIVOmItUgSph/NaqwTZxOtHfrY/sWrto/Y7JnDTnHlijPo2
 /OBzllapQ7UV3ySOrEB6wEPNETn5R/T6Wjb1KWoV5B+AoIipbg3DMwMFDybMfmuxHG8p
 pDfw==
X-Gm-Message-State: AOAM531eAqajuccL9Gbo/Cs73l0yRAxhNDmbjWJApI38ueUlVNy7ID7/
 Oz9esaT6dk+MLAdwTWwrH2UlXMVex4PBVvRz/LyKhGMsY5Y=
X-Google-Smtp-Source: ABdhPJy+Qi4Ayxn9P5PErn58uL+MyVhXJTsaHpnT3qw+sNmRDqR3N5lWI4my5+MNFxB+egP6wb3aQGm2XYAXisEHNE4=
X-Received: by 2002:a05:622a:4d1:b0:2de:676:d2bd with SMTP id
 q17-20020a05622a04d100b002de0676d2bdmr2494623qtx.565.1645712258814; Thu, 24
 Feb 2022 06:17:38 -0800 (PST)
MIME-Version: 1.0
References: <20220119145037.28125-1-mk@semihalf.com>
In-Reply-To: <20220119145037.28125-1-mk@semihalf.com>
From: =?UTF-8?Q?Micha=C5=82_Krawczyk?= <mk@semihalf.com>
Date: Thu, 24 Feb 2022 15:17:27 +0100
Message-ID: <CAJMMOfPgaY91Kd_hKtSYWb+H+bKU3qjC1eA+twDrbKq04bYCeg@mail.gmail.com>
Subject: Re: [PATCH] bus/pci: assign driver's pointer before mapping
To: dev <dev@dpdk.org>
Cc: upstream@semihalf.com, "Brandes, Shai" <shaibran@amazon.com>, 
 Harman Kalra <hkalra@marvell.com>, stable@dpdk.org,
 Ferruh Yigit <ferruh.yigit@intel.com>, 
 Thomas Monjalon <thomas@monjalon.net>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-BeenThere: stable@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: patches for DPDK stable branches <stable.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/stable>,
 <mailto:stable-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/stable/>
List-Post: <mailto:stable@dpdk.org>
List-Help: <mailto:stable-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/stable>,
 <mailto:stable-request@dpdk.org?subject=subscribe>
Errors-To: stable-bounces@dpdk.org

=C5=9Br., 19 sty 2022 o 15:50 Michal Krawczyk <mk@semihalf.com> napisa=C5=
=82(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 =3D dr;
> +
>                 if (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING) {
>                         ret =3D rte_pci_map_device(dev);
>                         if (ret !=3D 0) {
> +                               dev->driver =3D NULL;
>                                 rte_intr_instance_free(dev->vfio_req_intr=
_handle);
>                                 dev->vfio_req_intr_handle =3D 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 =3D dr;
>         }
>
>         RTE_LOG(INFO, EAL, "Probe PCI driver: %s (%x:%x) device: "PCI_PRI=
_FMT" (socket %i)\n",
> --
> 2.25.1
>