Code Review
/
deb_dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
New upstream version 17.11.1
[deb_dpdk.git]
/
test
/
test
/
test_memzone.c
diff --git
a/test/test/test_memzone.c
b/test/test/test_memzone.c
index
1cf235a
..
1115ee0
100644
(file)
--- a/
test/test/test_memzone.c
+++ b/
test/test/test_memzone.c
@@
-280,19
+280,24
@@
test_memzone_reserve_flags(void)
printf("MEMZONE FLAG 2MB\n");
return -1;
}
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) {
mz = rte_memzone_reserve("flag_zone_2M_HINT", size, SOCKET_ID_ANY,
RTE_MEMZONE_2MB|RTE_MEMZONE_1GB);
}
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;
}
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
+429,19
@@
test_memzone_reserve_flags(void)
mz = rte_memzone_reserve("flag_zone_16M_HINT", size,
SOCKET_ID_ANY,
RTE_MEMZONE_16MB|RTE_MEMZONE_16GB);
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;
}
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;
}
}
return 0;
@@
-775,7
+789,7
@@
test_memzone_bounded(void)
static int
test_memzone_free(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];
int i;
char name[20];