From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wes1-so1.wedos.net (wes1-so1.wedos.net [46.28.106.15]) by dpdk.org (Postfix) with ESMTP id 0353237A6 for ; Mon, 13 Jun 2016 16:30:41 +0200 (CEST) Received: from pcviktorin.fit.vutbr.cz (pcviktorin.fit.vutbr.cz [147.229.13.147]) by wes1-so1.wedos.net (Postfix) with ESMTPSA id 3rSwDc3FsdzC9D; Mon, 13 Jun 2016 16:30:40 +0200 (CEST) Date: Mon, 13 Jun 2016 16:25:33 +0200 From: Jan Viktorin To: Shreyansh Jain Cc: David Marchand , Thomas Monjalon , Bruce Richardson , Declan Doherty , "jianbo.liu@linaro.org" , "jerin.jacob@caviumnetworks.com" , Keith Wiles , Stephen Hemminger , "dev@dpdk.org" Message-ID: <20160613162533.29b0daf1@pcviktorin.fit.vutbr.cz> In-Reply-To: References: <1451682326-5834-1-git-send-email-viktorin@rehivetech.com> <1462542490-15556-8-git-send-email-viktorin@rehivetech.com> Organization: RehiveTech MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v1 07/28] eal/soc: add rte_eal_soc_register/unregister logic 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: Mon, 13 Jun 2016 14:30:41 -0000 On Mon, 13 Jun 2016 14:19:39 +0000 Shreyansh Jain wrote: > Another trivial comment inlined: > > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jan Viktorin > > Sent: Friday, May 06, 2016 7:18 PM > > To: dev@dpdk.org > > Cc: Jan Viktorin ; David Marchand > > ; Thomas Monjalon ; > > Bruce Richardson ; Declan Doherty > > ; jianbo.liu@linaro.org; > > jerin.jacob@caviumnetworks.com; Keith Wiles ; Stephen > > Hemminger > > Subject: [dpdk-dev] [PATCH v1 07/28] eal/soc: add > > rte_eal_soc_register/unregister logic > > > > Signed-off-by: Jan Viktorin > > --- > > app/test/test_soc.c | 106 > > ++++++++++++++++++++++++ > > lib/librte_eal/bsdapp/eal/Makefile | 1 + > > lib/librte_eal/bsdapp/eal/rte_eal_version.map | 3 + > > lib/librte_eal/common/eal_common_soc.c | 55 ++++++++++++ > > lib/librte_eal/common/include/rte_soc.h | 23 +++++ > > lib/librte_eal/linuxapp/eal/Makefile | 1 + > > lib/librte_eal/linuxapp/eal/rte_eal_version.map | 4 + > > 7 files changed, 193 insertions(+) > > create mode 100644 lib/librte_eal/common/eal_common_soc.c > > > > diff --git a/app/test/test_soc.c b/app/test/test_soc.c > > index a49fc9b..f6288dc 100644 > > --- a/app/test/test_soc.c > > +++ b/app/test/test_soc.c > > @@ -74,6 +74,103 @@ static int test_compare_addr(void) > > free(a2.name); > > free(a1.name); > > free(a0.name); > > + > > + return 0; > > +} > > + > > +/** > > + * Empty PMD driver based on the SoC infra. > > + * > > + * The rte_soc_device is usually wrapped in some higher-level struct > > + * (eth_driver). We simulate such a wrapper with an anonymous struct here. > > + */ > > +struct test_wrapper { > > + struct rte_soc_driver soc_drv; > > +}; > > + > > +struct test_wrapper empty_pmd0 = { > > + .soc_drv = { > > + .name = "empty_pmd0", > > + }, > > +}; > > + > > +struct test_wrapper empty_pmd1 = { > > + .soc_drv = { > > + .name = "empty_pmd1", > > + }, > > +}; > > + > > +static int > > +count_registered_socdrvs(void) > > +{ > > + int i; > > + struct rte_soc_driver *drv; > > + > > + i = 0; > > + TAILQ_FOREACH(drv, &soc_driver_list, next) > > + i += 1; > > + > > + return i; > > +} > > + > > +static int > > +test_register_unregister(void) > > +{ > > + struct rte_soc_driver *drv; > > + int count; > > + > > + rte_eal_soc_register(&empty_pmd0.soc_drv); > > + > > + TEST_ASSERT(!TAILQ_EMPTY(&soc_driver_list), > > + "No PMD is present but the empty_pmd0 should be there"); > > + drv = TAILQ_FIRST(&soc_driver_list); > > + TEST_ASSERT(!strcmp(drv->name, "empty_pmd0"), > > + "The registered PMD is not empty_pmd but '%s'", drv->name); > > Trivial: TEST_ASSERT Message should be: "... is not empty_pmd0 but..." OK, thanks. > [...]