[dpdk-stable] patch 'test/memzone: fix wrong test' has been queued to LTS release 17.11.1
Yuanhan Liu
yliu at fridaylinux.org
Wed Jan 24 16:33:11 CET 2018
Hi,
FYI, your patch has been queued to LTS release 17.11.1
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 01/26/18. So please
shout if anyone has objections.
Thanks.
--yliu
---
>From 58b4dcdf7d6b6a10686ff681773059cae373b5d7 Mon Sep 17 00:00:00 2001
From: Anatoly Burakov <anatoly.burakov at intel.com>
Date: Thu, 21 Dec 2017 18:19:44 +0000
Subject: [PATCH] test/memzone: fix wrong test
[ upstream commit 82da6af3ca4ad9aa1316792f90b2f88cd3020456 ]
When reserving memzones in autotest, it makes no sense to expect a
failed memzone reserve when we specify both size flags - instead,
we should expect a memzone reserved with one of the two sizes.
Fixes: af75078fece3 ("first public release")
Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
---
test/test/test_memzone.c | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/test/test/test_memzone.c b/test/test/test_memzone.c
index 1cf235a..49b6b68 100644
--- a/test/test/test_memzone.c
+++ b/test/test/test_memzone.c
@@ -289,10 +289,19 @@ test_memzone_reserve_flags(void)
if (hugepage_2MB_avail && hugepage_1GB_avail) {
mz = rte_memzone_reserve("flag_zone_2M_HINT", size, SOCKET_ID_ANY,
RTE_MEMZONE_2MB|RTE_MEMZONE_1GB);
- if (mz != NULL) {
+ if (mz == NULL) {
printf("BOTH SIZES SET\n");
return -1;
}
+ if (mz->hugepage_sz != RTE_PGSIZE_1G &&
+ mz->hugepage_sz != RTE_PGSIZE_2M) {
+ printf("Wrong size when both sizes set\n");
+ return -1;
+ }
+ if (rte_memzone_free(mz)) {
+ printf("Fail memzone free\n");
+ return -1;
+ }
}
}
/*
@@ -424,10 +433,19 @@ test_memzone_reserve_flags(void)
mz = rte_memzone_reserve("flag_zone_16M_HINT", size,
SOCKET_ID_ANY,
RTE_MEMZONE_16MB|RTE_MEMZONE_16GB);
- if (mz != NULL) {
+ if (mz == NULL) {
printf("BOTH SIZES SET\n");
return -1;
}
+ if (mz->hugepage_sz != RTE_PGSIZE_16G &&
+ mz->hugepage_sz != RTE_PGSIZE_16M) {
+ printf("Wrong size when both sizes set\n");
+ return -1;
+ }
+ if (rte_memzone_free(mz)) {
+ printf("Fail memzone free\n");
+ return -1;
+ }
}
}
return 0;
--
2.7.4
More information about the stable
mailing list