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 E4E9EA00C5; Sun, 26 Apr 2020 19:37:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7A6921C0DA; Sun, 26 Apr 2020 19:37:00 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 53AF91BF46 for ; Sun, 26 Apr 2020 19:36:59 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03QHaaaU017971; Sun, 26 Apr 2020 10:36:58 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=PK4CsprRzRjIE/HKupBPEDiPVXeEo6aXmbGZdLsNEas=; b=oKr63/AcWQfqftedaL9Hua2HXbsUSIXppnYJ/uxCLJyaZH/SCeoEaMLX8ah6d4W8Vh66 DuqMV1YAzqXQIi6UAFMoLE1f5KBhhXYRTuTJmM3fdxVHnVTtHOtw7Pqg/XgkF0sMlw9k IAo8sR5Sgbg7oKW+RUQd3DeHhFPWcUT6T+w9oEkdlplu0sIDjb1raGk3I5fqrI2176R3 r6ZcBDxyKsQplZBubzeUyTh0bNkHcmLGWK51spmmw8IRAfMNjYNhd0qzm+RRI25Ia2yB erLb+17pMU9IciCPJNZB04/LvRng84CneWI2A8wmBkeiGHG8XkrflSM7MqFfcLh2Eenu RA== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 30mjjq4ut0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sun, 26 Apr 2020 10:36:58 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 26 Apr 2020 10:36:56 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sun, 26 Apr 2020 10:36:56 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id 6E8BD3F703F; Sun, 26 Apr 2020 10:36:54 -0700 (PDT) From: To: CC: , , , , , , , Jerin Jacob Date: Sun, 26 Apr 2020 23:08:10 +0530 Message-ID: <20200426173811.49788-1-jerinj@marvell.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-26_07:2020-04-24, 2020-04-26 signatures=0 Subject: [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" 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. - 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. drivers/bus/pci/pci_common.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c index 3f5542076..2fa3d85ae 100644 --- a/drivers/bus/pci/pci_common.c +++ b/drivers/bus/pci/pci_common.c @@ -271,6 +271,8 @@ pci_probe_all_drivers(struct rte_pci_device *dev) return -EINVAL; FOREACH_DRIVER_ON_PCIBUS(dr) { + if (dev->kdrv == RTE_KDRV_NONE) + continue; rc = rte_pci_probe_one_driver(dr, dev); if (rc < 0) /* negative value is an error */ -- 2.26.2