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 293B7A04B8; Tue, 5 May 2020 17:50:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 071961D628; Tue, 5 May 2020 17:50:28 +0200 (CEST) Received: from mail-il1-f195.google.com (mail-il1-f195.google.com [209.85.166.195]) by dpdk.org (Postfix) with ESMTP id 2D3201D614 for ; Tue, 5 May 2020 17:50:26 +0200 (CEST) Received: by mail-il1-f195.google.com with SMTP id i16so2686606ils.12 for ; Tue, 05 May 2020 08:50:26 -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=P2viHm1+e4vGh1vS46WEgTTTFHnEKYl0/dsx1lCP/qE=; b=VKGgLIG+Pm48xYHeCCcCapkL1MNlkZQVqHKx7rRKiDrL86WVaNLxQvGRpdbQADqHwb vjGfoef5u3gjNvvUb5T0dAXOgfVtiiN0V1No7Hkh6vlCOornc+v4hWM1X1W18jamed0B tXYLMFAmghBWf7+ly5f58PiNEodV2hjfljXpmyvYEIGJ9JLvfI+hWvCv8hKyXFzP5reQ sIiIUxm2U4Xjl/LFjuz5n4RvpTjpRcvDG7Y7ABs8ggHjVl+C9TViuHGlOoHJvl1wDdCb ySr2TPL4SjwuXrAx53WUQPwl9U08iE8C61zNwmThA75LGMMNPVbMITiGgzoGYD8WMPuy 2vBA== 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=P2viHm1+e4vGh1vS46WEgTTTFHnEKYl0/dsx1lCP/qE=; b=h3AerzEHCyAzGxc2Jp09T15TFvqHXFFa2UmQOwnJbRT9Scuckr8lA4XppJ7l74wIe5 64EZQNSWQcrMTqTfTf8Kys/riwzQaWmvuYDtrvKx7lvYZQ9tvTUDoG/xRDIcO4Wij27J D8XcciQymJk1R5Ti+4qGGHR2oshXOTYqH4ARJeLTP4MIj48bl+0JYcEefV03wIk7kbNd qZsd/7NnQCsMg9u+uFjqxoU3DkxWfdnZXPmPoyaemx0VwQnYOeXqHFKv3Yah9Dal0p80 NzrZdDMXqyyrx6cFODzw8oZgnzhotanKvM5SVxbRU8H/GTVQSzq31vH9ocKmPnwZato9 JD1w== X-Gm-Message-State: AGi0PubqeUi05/7jmtsPYJuqqe6QV4WwRagTU64cBADfH48mLcqu3x48 lKuK12xpgbQBSLjLOH8aKu+KHkPP2PfGxoivi+8= X-Google-Smtp-Source: APiQypIIvXuWCx0u+WQj9SazkBYxbMBZKCW3+hHoJOIRgs/oLVj4mK6sF48+qBSD6hFlYNrJIkKGTQo2VF6kEPd6V/4= X-Received: by 2002:a92:8b45:: with SMTP id i66mr4356999ild.162.1588693825323; Tue, 05 May 2020 08:50:25 -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, 5 May 2020 21:20:09 +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 3:04 PM Jerin Jacob wrote: > > 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? Ping. What is the conclusion? If it is former then this patch is valid. > > > > > > > > > > -- > > David Marchand > >