[dpdk-dev] [PATCH v1 07/28] eal/soc: add rte_eal_soc_register/unregister logic

Jan Viktorin viktorin at rehivetech.com
Mon Jun 13 16:25:33 CEST 2016


On Mon, 13 Jun 2016 14:19:39 +0000
Shreyansh Jain <shreyansh.jain at nxp.com> wrote:

> Another trivial comment inlined:
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Jan Viktorin
> > Sent: Friday, May 06, 2016 7:18 PM
> > To: dev at dpdk.org
> > Cc: Jan Viktorin <viktorin at rehivetech.com>; David Marchand
> > <david.marchand at 6wind.com>; Thomas Monjalon <thomas.monjalon at 6wind.com>;
> > Bruce Richardson <bruce.richardson at intel.com>; Declan Doherty
> > <declan.doherty at intel.com>; jianbo.liu at linaro.org;
> > jerin.jacob at caviumnetworks.com; Keith Wiles <keith.wiles at intel.com>; Stephen
> > Hemminger <stephen at networkplumber.org>
> > Subject: [dpdk-dev] [PATCH v1 07/28] eal/soc: add
> > rte_eal_soc_register/unregister logic
> > 
> > Signed-off-by: Jan Viktorin <viktorin at rehivetech.com>
> > ---
> >  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.

> 
[...]


More information about the dev mailing list