[dpdk-dev] [PATCH] test/table: skip when not enough memory is available
Dumitrescu, Cristian
cristian.dumitrescu at intel.com
Fri Jul 5 19:54:39 CEST 2019
Hi David,
> -----Original Message-----
> From: David Marchand [mailto:david.marchand at redhat.com]
> Sent: Friday, July 5, 2019 10:19 AM
> To: dev at dpdk.org
> Cc: Dumitrescu, Cristian <cristian.dumitrescu at intel.com>
> Subject: [PATCH] test/table: skip when not enough memory is available
>
> Following empirical tries, this test wants at least 3300M of memory to
> run.
>
> Signed-off-by: David Marchand <david.marchand at redhat.com>
> ---
> app/test/test_table.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/app/test/test_table.c b/app/test/test_table.c
> index a4b0ed6..dca1b33 100644
> --- a/app/test/test_table.c
> +++ b/app/test/test_table.c
> @@ -134,6 +134,13 @@ uint32_t pipeline_test_hash_cuckoo(const void
> *key,
> {
> int status, ret;
> unsigned i;
> + void *p;
> +
> + /* empirical value, please refine when updating this test */
> + p = rte_malloc("enough_memory_for_test", (size_t)3300 << 20, 0);
> + if (!p)
> + return TEST_SKIPPED;
> + rte_free(p);
>
> ret = TEST_SUCCESS;
>
> --
> 1.8.3.1
Yes, some tests need large amounts of memory.
I understand your proposal, but it feels a bit like a hack for this test. Could we create a more generic fix?
Expanding on your idea, could we wrap this code into a macro such as TEST_CHECK_FOR_LARGE_MEMORY(memsize_in_gb) that could live in test.h and call it for this test (and potentially others that have the same requirements)?
Or maybe people have a better idea?
Thanks,
Cristian
More information about the dev
mailing list