DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Dumitrescu, Cristian" <cristian.dumitrescu@intel.com>
To: David Marchand <david.marchand@redhat.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] test/table: skip when not enough memory is available
Date: Fri, 5 Jul 2019 17:54:39 +0000	[thread overview]
Message-ID: <3EB4FA525960D640B5BDFFD6A3D891268E8EB23B@IRSMSX108.ger.corp.intel.com> (raw)
In-Reply-To: <1562318340-30464-1-git-send-email-david.marchand@redhat.com>

Hi David,

> -----Original Message-----
> From: David Marchand [mailto:david.marchand@redhat.com]
> Sent: Friday, July 5, 2019 10:19 AM
> To: dev@dpdk.org
> Cc: Dumitrescu, Cristian <cristian.dumitrescu@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@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

  reply	other threads:[~2019-07-05 17:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-05  9:19 David Marchand
2019-07-05 17:54 ` Dumitrescu, Cristian [this message]
2019-07-05 20:47   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3EB4FA525960D640B5BDFFD6A3D891268E8EB23B@IRSMSX108.ger.corp.intel.com \
    --to=cristian.dumitrescu@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).