[dpdk-dev] [PATCH] test/memzone: Fix test_memzone_basic & test_memzone_free issues.

Phil Yang Phil.Yang at arm.com
Mon Jan 15 06:57:25 CET 2018


Hi Anatoly,

Thanks for your comments. Updated. Please review the version 2.

Thanks,
Phil Yang

> -----Original Message-----
> From: Burakov, Anatoly [mailto:anatoly.burakov at intel.com]
> Sent: Saturday, January 13, 2018 1:44 AM
> To: Phil Yang <Phil.Yang at arm.com>; dev at dpdk.org
> Cc: nd <nd at arm.com>; Jianbo Liu <Jianbo.Liu at arm.com>; Herbert Guan
> <Herbert.Guan at arm.com>
> Subject: Re: [dpdk-dev] [PATCH] test/memzone: Fix test_memzone_basic &
> test_memzone_free issues.
> 
> On 11-Jan-18 9:41 AM, Phil Yang wrote:
> > 1. test_memzone_basic: No need to free a NULL memzone. It will cause
> > test termination.
> > 2. test_memzone_free: Out of mz[RTE_MAX_MEMZONE] memory bound
> while
> > reserving memzone for mz. It will flush variable i. Fix by extend to
> > mz[RTE_MAX_MEMZONE + 1].
> >
> > Signed-off-by: Phil Yang <phil.yang at arm.com>
> > ---
> >   test/test/test_memzone.c | 6 +-----
> >   1 file changed, 1 insertion(+), 5 deletions(-)
> >
> > diff --git a/test/test/test_memzone.c b/test/test/test_memzone.c index
> > 6e80977..24e29a7 100644
> > --- a/test/test/test_memzone.c
> > +++ b/test/test/test_memzone.c
> > @@ -251,10 +251,6 @@ test_memzone_reserve_flags(void)
> >   				printf("MEMZONE FLAG 2MB\n");
> >   				return -1;
> >   			}
> > -			if (rte_memzone_free(mz)) {
> > -				printf("Fail memzone free\n");
> > -				return -1;
> > -			}
> >   		}
> >
> >   		if (hugepage_2MB_avail && hugepage_1GB_avail) { @@ -746,7
> +742,7
> > @@ test_memzone_bounded(void)
> >   static int
> >   test_memzone_free(void)
> >   {
> > -	const struct rte_memzone *mz[RTE_MAX_MEMZONE];
> > +	const struct rte_memzone *mz[RTE_MAX_MEMZONE + 1];
> >   	int i;
> >   	char name[20];
> >
> >
> 
> This should be split into two separate patches, as there are two different issues
> being addressed. Provided that's done,
> 
> Acked-by: Anatoly Burakov <anatoly.burakov at intel.com>
> 
> --
> Thanks,
> Anatoly


More information about the dev mailing list