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 50B6FA0350; Mon, 11 May 2020 16:59:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 193241C128; Mon, 11 May 2020 16:59:20 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id 28C3C1C01B for ; Mon, 11 May 2020 16:59:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589209157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/ZLXkfr9MVAf9wv5CGfdYzFzFNc+JdYye9kIGaogoIY=; b=cK+xYndcPjMBxPxU/5WEDPAnhQ04EvMr4lKTscfksS3FgNOEfyYxsJ64PlRsxjnGJzW9DL xiz0BLHDD9TXBkbkTmvBySV+ju5hkuiEVL2GxfZ8iRRxun5dUzhirCtKdcdgQyffEQ7TY6 7U3XdjSIJQyRRXSbf+gtT9VeDIFkNaM= Received: from mail-vs1-f72.google.com (mail-vs1-f72.google.com [209.85.217.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-121-hn6KyEuyM8eSRykmsg8Mzg-1; Mon, 11 May 2020 10:59:13 -0400 X-MC-Unique: hn6KyEuyM8eSRykmsg8Mzg-1 Received: by mail-vs1-f72.google.com with SMTP id j187so1489569vsd.4 for ; Mon, 11 May 2020 07:59:13 -0700 (PDT) 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=/ZLXkfr9MVAf9wv5CGfdYzFzFNc+JdYye9kIGaogoIY=; b=WOU1wF0t3Bh6hiQDPqMnrW4KeA+2liMW9hAKTzKQsK9MhHgNa6CPgSR0oFqgT0ikYi /W8JMKY786TKAq6iWY3w4JU0gC2Nk5Srs4GlAEssBpm59S80qsppKGS3+rh498RzB3on t3E+yki6jNVosK/YXtTKOEMCXZv3K+V4bHKji3FjnF/SYVRDtDkuN5BTldtEj1ve46ZD wcasWwBfaHLdOer+tiH1DFc05sg+B96B0xouVvW5akSR85O3obUoa2LSvAm/6GzHmfff Fco0ApIiThaZFcUY1uO8SOaFw9/m+65TBq5ypINlczXpTfYbTrycoE47Y9Ot54Nd66MN Xbcg== X-Gm-Message-State: AGi0PuY5P5PR1Kluo0jq/jCxR5YFKeX8uVu7+f4T03BIw2xmQ8g3w3N6 a5keJq+yCCcIepBIIe4+VBIzCFAd0fovfrI3XEwP9vyqY9GJaPIa5znS7H62g1cjZ7zQoj1nJKm 1MPIsz3w/knKfqnAyk+k= X-Received: by 2002:a67:d817:: with SMTP id e23mr11735541vsj.39.1589209152270; Mon, 11 May 2020 07:59:12 -0700 (PDT) X-Google-Smtp-Source: APiQypJZkYCZHGA7cKMO+4R9vpE/xP4zX/VKURoD2rPuyTxAa/n8KDecdXEs99Y3jBRCkwAtIbA+4QMXq7O4SsOegn4= X-Received: by 2002:a67:d817:: with SMTP id e23mr11735519vsj.39.1589209151972; Mon, 11 May 2020 07:59:11 -0700 (PDT) MIME-Version: 1.0 References: <20200501113909.26355-1-skori@marvell.com> <20200502074205.29080-1-skori@marvell.com> In-Reply-To: <20200502074205.29080-1-skori@marvell.com> From: David Marchand Date: Mon, 11 May 2020 16:59:00 +0200 Message-ID: To: Sunil Kumar Kori Cc: Stephen Hemminger , Jerin Jacob Kollanukkaran , Gaetan Rivet , dev X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v5 1/1] bus/pci: optimise scanning with whitelist/blacklist 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 Sat, May 2, 2020 at 9:42 AM Sunil Kumar Kori wrote: > > rte_bus_scan API scans all the available PCI devices irrespective of white > or black listing parameters then further devices are probed based on white > or black listing parameters. So unnecessary CPU cycles are wasted during > rte_pci_scan. > > For Octeontx2 platform with core frequency 2.4 Ghz, rte_bus_scan consumes > around 26ms to scan around 90 PCI devices but all may not be used by the > application. So for the application which uses 2 NICs, rte_bus_scan > consumes few microseconds and rest time is saved with this patch. > > Patch restricts devices to be scanned as per below mentioned conditions: > - All devices will be scanned if no parameters are passed. > - Only white listed devices will be scanned if white list is available. > - All devices, except black listed, will be scanned if black list is > available. > > Signed-off-by: Sunil Kumar Kori Acked-by: Gaetan Rivet > diff --git a/drivers/bus/pci/private.h b/drivers/bus/pci/private.h > index a205d4d9f..3a9da7322 100644 > --- a/drivers/bus/pci/private.h > +++ b/drivers/bus/pci/private.h > @@ -42,6 +42,17 @@ int rte_pci_scan(void); > void > pci_name_set(struct rte_pci_device *dev); > > +/** > + * Validate whether a device with given pci address should be ignored or not. PCI address > + * > + * @param pci_addr > + * PCI address of device to be validated > + * @return > + * 1: if device is to be ignored, > + * 0: if device is to be scanned, On Sat, May 2, 2020 at 9:42 AM Sunil Kumar Kori wrote: > diff --git a/drivers/bus/pci/private.h b/drivers/bus/pci/private.h > index a205d4d9f..3a9da7322 100644 > --- a/drivers/bus/pci/private.h > +++ b/drivers/bus/pci/private.h > @@ -42,6 +42,17 @@ int rte_pci_scan(void); > void > pci_name_set(struct rte_pci_device *dev); > > +/** > + * Validate whether a device with given pci address should be ignored or not. > + * > + * @param pci_addr > + * PCI address of device to be validated > + * @return > + * 1: if device is to be ignored, > + * 0: if device is to be scanned, true/false > + */ > +bool rte_pci_ignore_device(const struct rte_pci_addr *pci_addr); > + > /** > * Add a PCI device to the PCI Bus (append to PCI Device list). This function > * also updates the bus references of the PCI Device (and the generic device Applied, thanks. -- David Marchand