From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw0-f174.google.com (mail-yw0-f174.google.com [209.85.161.174]) by dpdk.org (Postfix) with ESMTP id E0420A10 for ; Thu, 10 Nov 2016 04:06:30 +0100 (CET) Received: by mail-yw0-f174.google.com with SMTP id t125so227702066ywc.1 for ; Wed, 09 Nov 2016 19:06:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=WqdYUNGf13ljnLW533icSoeux4LZn+sZJ5RaNMfKa8w=; b=gQu3K+95EXPC1qqE2x1NteZyF/OaUtHIEIJD5H1hu3ettZgyty4E4p2twAk1nKPZ7i U7j5ak6+tLKrPldfWBxtjwmxMAw5Js81ceWzn7pRuQohtyXGUN2SVlMW/xipsjjt1bU7 sAEaN3sNiPRAZbDVM57Ae/KExjjF7lZO1+6MU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=WqdYUNGf13ljnLW533icSoeux4LZn+sZJ5RaNMfKa8w=; b=Rl3uBsDbD2jSzbLcvit62oDBEGjF3dks2bLKPeyA1rxJYVTpI+HUDJsjoT8VYBOims xIpTFKcpPjZsgdefy9NyiwlQFUgQUb3M3GUXsrWqSdkEt9db5+BAspapfqGWy1kZ4f55 X97DCQxNxiFB7aTIyl53F/67Hz7MtiJdkfKgqsNP7aE+lP/hCxAipWya2L89Rs7H9Hp+ B1MT3SUsTgyKL0A+6KbW72vWRkNgz6qeZOjTR0VqUmr9QyEjfnCBm90KidSkTRhnkvBk gHCGpquECZGqd8XlhPzqPkj3x1+6KtN3BuAE7BU6bTjA3DlvBvCYmG1eZh63xBEqoufj rdUQ== X-Gm-Message-State: ABUngves/U7D+2RXagVIccRuKiVQhUT7yrXxe1YtUTth1o3y/1ucpepb3mskrp1072IdK6pVVgFXOR6IamxNa7CT X-Received: by 10.129.72.147 with SMTP id v141mr3370895ywa.236.1478747190073; Wed, 09 Nov 2016 19:06:30 -0800 (PST) MIME-Version: 1.0 Received: by 10.37.171.48 with HTTP; Wed, 9 Nov 2016 19:06:29 -0800 (PST) In-Reply-To: <1477657598-826-9-git-send-email-shreyansh.jain@nxp.com> References: <1477581467-12588-1-git-send-email-shreyansh.jain@nxp.com> <1477657598-826-1-git-send-email-shreyansh.jain@nxp.com> <1477657598-826-9-git-send-email-shreyansh.jain@nxp.com> From: Jianbo Liu Date: Thu, 10 Nov 2016 11:06:29 +0800 Message-ID: To: Shreyansh Jain Cc: dev@dpdk.org, Thomas Monjalon , Jan Viktorin Content-Type: text/plain; charset=UTF-8 Subject: Re: [dpdk-dev] [PATCH v7 08/21] eal/soc: implement SoC device list and dump X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2016 03:06:31 -0000 On 28 October 2016 at 20:26, Shreyansh Jain wrote: > From: Jan Viktorin > > SoC devices would be linked in a separate list (from PCI). This is used for > probe function. > A helper for dumping the device list is added. > > Signed-off-by: Jan Viktorin > Signed-off-by: Shreyansh Jain > Signed-off-by: Hemant Agrawal > --- > lib/librte_eal/bsdapp/eal/rte_eal_version.map | 2 ++ > lib/librte_eal/common/eal_common_soc.c | 34 +++++++++++++++++++++++++ > lib/librte_eal/common/include/rte_soc.h | 9 +++++++ > lib/librte_eal/linuxapp/eal/rte_eal_version.map | 2 ++ > 4 files changed, 47 insertions(+) > > diff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map > index cf6fb8e..86e3cfd 100644 > --- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map > +++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map > @@ -171,11 +171,13 @@ DPDK_16.11 { > rte_eal_dev_attach; > rte_eal_dev_detach; > rte_eal_map_resource; > + rte_eal_soc_dump; > rte_eal_soc_register; > rte_eal_soc_unregister; > rte_eal_unmap_resource; > rte_eal_vdrv_register; > rte_eal_vdrv_unregister; > + soc_device_list; > soc_driver_list; > > } DPDK_16.07; > diff --git a/lib/librte_eal/common/eal_common_soc.c b/lib/librte_eal/common/eal_common_soc.c > index 56135ed..5dcddc5 100644 > --- a/lib/librte_eal/common/eal_common_soc.c > +++ b/lib/librte_eal/common/eal_common_soc.c > @@ -31,6 +31,8 @@ > * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > */ > > +#include > +#include > #include > > #include > @@ -40,6 +42,38 @@ > /* Global SoC driver list */ > struct soc_driver_list soc_driver_list = > TAILQ_HEAD_INITIALIZER(soc_driver_list); > +struct soc_device_list soc_device_list = > + TAILQ_HEAD_INITIALIZER(soc_device_list); > + > +/* dump one device */ > +static int > +soc_dump_one_device(FILE *f, struct rte_soc_device *dev) > +{ > + int i; > + > + fprintf(f, "%s", dev->addr.name); > + fprintf(f, " - fdt_path: %s\n", > + dev->addr.fdt_path ? dev->addr.fdt_path : "(none)"); > + > + for (i = 0; dev->id && dev->id[i].compatible; ++i) > + fprintf(f, " %s\n", dev->id[i].compatible); > + > + return 0; > +} > + > +/* dump devices on the bus to an output stream */ > +void > +rte_eal_soc_dump(FILE *f) > +{ > + struct rte_soc_device *dev = NULL; > + > + if (!f) > + return; > + > + TAILQ_FOREACH(dev, &soc_device_list, next) { > + soc_dump_one_device(f, dev); > + } > +} > > /* register a driver */ > void > diff --git a/lib/librte_eal/common/include/rte_soc.h b/lib/librte_eal/common/include/rte_soc.h > index 23b06a9..347e611 100644 > --- a/lib/librte_eal/common/include/rte_soc.h > +++ b/lib/librte_eal/common/include/rte_soc.h > @@ -56,8 +56,12 @@ extern "C" { > > extern struct soc_driver_list soc_driver_list; > /**< Global list of SoC Drivers */ > +extern struct soc_device_list soc_device_list; > +/**< Global list of SoC Devices */ > > TAILQ_HEAD(soc_driver_list, rte_soc_driver); /**< SoC drivers in D-linked Q. */ > +TAILQ_HEAD(soc_device_list, rte_soc_device); /**< SoC devices in D-linked Q. */ > + > > struct rte_soc_id { > const char *compatible; /**< OF compatible specification */ > @@ -142,6 +146,11 @@ rte_eal_compare_soc_addr(const struct rte_soc_addr *a0, > } > > /** > + * Dump discovered SoC devices. > + */ > +void rte_eal_soc_dump(FILE *f); If it is to dump device information (not driver), is it proper to rename it rte_eal_soc_device_dump()? > + > +/** > * Register a SoC driver. > */ > void rte_eal_soc_register(struct rte_soc_driver *driver); > diff --git a/lib/librte_eal/linuxapp/eal/rte_eal_version.map b/lib/librte_eal/linuxapp/eal/rte_eal_version.map > index ab6b985..0155025 100644 > --- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map > +++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map > @@ -175,11 +175,13 @@ DPDK_16.11 { > rte_eal_dev_attach; > rte_eal_dev_detach; > rte_eal_map_resource; > + rte_eal_soc_dump; > rte_eal_soc_register; > rte_eal_soc_unregister; > rte_eal_unmap_resource; > rte_eal_vdrv_register; > rte_eal_vdrv_unregister; > + soc_device_list; > soc_driver_list; > > } DPDK_16.07; > -- > 2.7.4 >