From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2783AA00BE; Tue, 28 Apr 2020 11:35:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 06CE71D5CC; Tue, 28 Apr 2020 11:35:08 +0200 (CEST) Received: from mail-io1-f65.google.com (mail-io1-f65.google.com [209.85.166.65]) by dpdk.org (Postfix) with ESMTP id 4F87F1D5C9 for ; Tue, 28 Apr 2020 11:35:07 +0200 (CEST) Received: by mail-io1-f65.google.com with SMTP id u11so22168187iow.4 for ; Tue, 28 Apr 2020 02:35:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Tb0Pq/aQDNOiFh7XwpaPw6Cf0tq+OSZkF6WevB4BlVE=; b=gerWEEZJz/V0S/If/hD5C1hU7gfSKqGVTjxFnlGLH3SXpHxtV4XKtzPUmrnOTXSdKV F/kX1d5ZBlVZMMUAoldNtmyu1JbV2yjvAl0UMszpB0RPzpd7EtaKqXETyUpd//p5e/gS m9sNLQVE8DAbc3s+EcoEnZTVLAlmv9F0lXnC7sWnQjKQLrZWV9p/6TRr86tnvcU+QNnF 3VG0SrDreOfb07CZ8bzzeq4580LMv+I4/R1+yeXWb9ov2fEEoXVpBgywV3bTqL5St1Sk gezpNAb/Xbt5bEXQNoRypKkxTkVjtOIGdMY7i4TKzEY/xdyyZCru3WFfIfxgbk6e5Sh4 watQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Tb0Pq/aQDNOiFh7XwpaPw6Cf0tq+OSZkF6WevB4BlVE=; b=s9z32PZ56MVzRb/bQ3yxiJ0/VLaxCKCgehVHc2A9jZ1hZteacjfMfSZ55zHtAy3UP2 YxWas9PaJKjMzoJkPIzK2U+8BUlcBPm3c9lVXIX2//fPWs8Q2JKDf/3GpfnUVvvn+Tot BnlTa8Rn0ak0cs1LUf9Emu45BLkyp8ALvtxihITx2a4CZSCE3b1eXnoVF0ZAggISyhxh oqeQS5wwZPQABWtISlfoTd7YVGDeFptm3bP7Jl7lEojgw5UE0S9coUe3PwLKMqJivwyD fqMqdBvLJLxU6NttH8GCaNg+LmtKecxvWXzntlJ4CqS6od2Evn6LPxoX3Ck0y1eAd86O Caeg== X-Gm-Message-State: AGi0PuYnb4X1z7pjs6spOT6l4AyAONC7VnBbKj/apGhsttlX5lfLIjKZ 5+vKFz0qLcyM5ZFxjux7SuA986kYbIcNiJ3Yksk= X-Google-Smtp-Source: APiQypKTiKM5zoQ6BE1KhVAPxVb7BLbXpNb7HcnFW7TTeFmg11DCsZwP3dpfQOJs3wY1J72Vs3njU8P4lS6/+/NnvHA= X-Received: by 2002:a6b:b8d6:: with SMTP id i205mr25926279iof.123.1588066506437; Tue, 28 Apr 2020 02:35:06 -0700 (PDT) MIME-Version: 1.0 References: <20200426173811.49788-1-jerinj@marvell.com> <3102527.CAdn2TfLgq@thomas> <6277521.uz5P2jW1tq@thomas> In-Reply-To: From: Jerin Jacob Date: Tue, 28 Apr 2020 15:04:50 +0530 Message-ID: To: David Marchand Cc: Thomas Monjalon , Jerin Jacob , dpdk-dev , Maxime Coquelin , Zhihong Wang , "Ye, Xiaolong" , Harman Kalra Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH] bus/pci: optimize pci device probe X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, Apr 28, 2020 at 2:21 PM David Marchand wrote: > > On Sun, Apr 26, 2020 at 10:06 PM Thomas Monjalon wrote: > > > > 26/04/2020 20:41, Jerin Jacob: > > > On Sun, Apr 26, 2020 at 11:38 PM Thomas Monjalon wrote: > > > > > > > > 26/04/2020 19:38, jerinj@marvell.com: > > > > > From: Jerin Jacob > > > > > > > > > > If the PCI device is not attached to any driver then there is no > > > > > point in probing it. As an optimization, skip the PCI device probe if > > > > > the PCI device driver of type RTE_KDRV_NONE. > > > > > > > > > > Signed-off-by: Jerin Jacob > > > > > --- > > > > > Notes: > > > > > ------ > > > > > - virtio drivers does special treatment based on RTE_KDRV_UNKNOWN, That is > > > > > the reason allowing RTE_KDRV_UNKNOWN in this patch. > > > > > - virio devices uses RTE_KDRV_UNKNOWN for some special meaning, IMO, if it would > > > > > be better, if > > > > > a) Introduce the KDRV for virio > > > > > b) If the PCIe device of driver type NONE or UNKNOWN then not even add in pci > > > > > list > > > > > in the scan, It will improve the boot time by avoiding operation on > > > > > unwanted device like sorting the PCI devices, scanning it, probe it, managing > > > > > it etc. > > > > > > > > mlx4/mlx4 uses RTE_KDRV_UNKNOWN. > > > > > > OK. > > > > > > > > - Initial problem reported at http://patches.dpdk.org/patch/64999/ as > > > > > boot time printf clutter on octeontx2 devices with a lot PCI devices which are > > > > > of type RTE_KDRV_NONE. > > > > > > > > Add a logtype for PCI driver and adjust log level accordingly > > > > to your preferences. > > > > > > > > > @@ -271,6 +271,8 @@ pci_probe_all_drivers(struct rte_pci_device *dev) > > > > > FOREACH_DRIVER_ON_PCIBUS(dr) { > > > > > + if (dev->kdrv == RTE_KDRV_NONE) > > > > > + continue; > > > > > rc = rte_pci_probe_one_driver(dr, dev); > > > > > > > > Nack > > > > > > I understand mlx4/mlx5 is using RTE_KDRV_UNKNOWN, Here we are skipping > > > the RTE_KDRV_NONE, > > > What is the use case for probing the devices with RTE_KDRV_NONE? > > > > Maybe you are right. I don't remember the use case. > > I think I remember these virtio and vmxnet3 PMD were not using UIO: > > http://git.dpdk.org/old/virtio-net-pmd/tree/virtio_user.c > > http://git.dpdk.org/old/vmxnet3-usermap/tree/pmd/vmxnet3.c > > > > We need to know which case is using following code: > > > > case RTE_KDRV_NONE: > > #if defined(RTE_ARCH_X86) > > ret = pci_ioport_map(dev, bar, p); > > #endif > > break; > > > > David, please could you refresh our memory? > > The in-tree virtio-net driver directly calls rte_pci_map_device / > rte_pci_ioport_map depending on virtio legacy/modern modes. > This is why the virtio pci driver does not ask for > RTE_PCI_DRV_NEED_MAPPING to the pci bus. > > > In ioport mode, there were two options for historical reasons because > of the virtio driver you mention. > This driver did not rely on uio, and this behavior was later merged to > the current in-tree driver. > It ended up (not clean) in the pci bus driver because virtio was the > only user of this code. > > > Removing this special case could break x86 applications running with > legacy virtio. > > > On the plus side, we have been announcing for some time in virtio: > RTE_PMD_REGISTER_KMOD_DEP(net_virtio, "* igb_uio | uio_pci_generic | vfio-pci"); What is to conclude? # The In-tree virtio driver uses ""* igb_uio | uio_pci_generic | vfio-pci"" driver as backend and it does not need RTE_KDRV_NONE? OR # The in-tree, legacy virtio(const struct virtio_pci_ops legacy_op) can work without any kernel driver in the backend. So RTE_KDRV_NONE need? > > > -- > David Marchand >