DPDK patches and discussions
 help / color / mirror / Atom feed
From: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
To: yipeng1.wang@intel.com, sameh.gobriel@intel.com,
	bruce.richardson@intel.com, pablo.de.lara.guarch@intel.com,
	david.marchand@redhat.com, honnappa.nagarahalli@arm.com
Cc: dharmik.thakkar@arm.com, dev@dpdk.org, nd@arm.com
Subject: [dpdk-dev] [PATCH v3 4/4] test/hash: use array for small amount of memory
Date: Mon,  1 Jul 2019 19:27:24 -0500	[thread overview]
Message-ID: <20190702002724.41400-4-honnappa.nagarahalli@arm.com> (raw)
In-Reply-To: <20190702002724.41400-1-honnappa.nagarahalli@arm.com>

Variables of size 128B can make use of stack instead of dynamically
allocated memory.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
v3
  - Allocated pos on stack as it is just 128B

v2
  - N/A

 app/test/test_hash_readwrite_lf.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/app/test/test_hash_readwrite_lf.c b/app/test/test_hash_readwrite_lf.c
index 792244fd0..f0d6f42c1 100644
--- a/app/test/test_hash_readwrite_lf.c
+++ b/app/test/test_hash_readwrite_lf.c
@@ -567,16 +567,9 @@ test_rwc_reader(__attribute__((unused)) void *arg)
 	uint32_t read_cnt;
 	uint32_t *keys;
 	uint32_t extra_keys;
-	int32_t *pos;
+	int32_t pos[BULK_LOOKUP_SIZE];
 	void *temp_a[BULK_LOOKUP_SIZE];
 
-	/* Used to identify keys not inserted in the hash table */
-	pos = rte_malloc(NULL, sizeof(uint32_t) * BULK_LOOKUP_SIZE, 0);
-	if (pos == NULL) {
-		printf("RTE_MALLOC failed\n");
-		return -1;
-	}
-
 	if (read_type & READ_FAIL) {
 		keys = tbl_rwc_test_param.keys_absent;
 		read_cnt = tbl_rwc_test_param.count_keys_absent;
-- 
2.17.1


  parent reply	other threads:[~2019-07-02  0:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-27  3:24 [dpdk-dev] [PATCH 1/3] test/hash: reset global variable to discard old data Honnappa Nagarahalli
2019-06-27  3:24 ` [dpdk-dev] [PATCH 2/3] test/hash: free allocated memory Honnappa Nagarahalli
2019-06-27  8:07   ` [dpdk-dev] [dpdk-stable] " David Marchand
2019-06-28  4:59     ` Honnappa Nagarahalli
2019-06-28  8:36       ` David Marchand
2019-06-27  3:24 ` [dpdk-dev] [PATCH 3/3] test/hash: init hash parameters in the correct function Honnappa Nagarahalli
2019-06-27  8:07   ` [dpdk-dev] [dpdk-stable] " David Marchand
2019-06-28  4:55     ` Honnappa Nagarahalli
2019-06-28  4:52 ` [dpdk-dev] [PATCH v2 1/3] test/hash: reset global variable to discard old data Honnappa Nagarahalli
2019-06-28  4:52   ` [dpdk-dev] [PATCH v2 2/3] test/hash: init hash parameters in the correct function Honnappa Nagarahalli
2019-06-28  4:52   ` [dpdk-dev] [PATCH v2 3/3] test/hash: free allocated memory Honnappa Nagarahalli
2019-06-28  8:38     ` [dpdk-dev] [dpdk-stable] " David Marchand
2019-07-02  0:27 ` [dpdk-dev] [PATCH v3 1/4] test/hash: reset global variable to discard old data Honnappa Nagarahalli
2019-07-02  0:27   ` [dpdk-dev] [PATCH v3 2/4] test/hash: init hash parameters in the correct function Honnappa Nagarahalli
2019-07-02  0:27   ` [dpdk-dev] [PATCH v3 3/4] test/hash: free allocated memory Honnappa Nagarahalli
2019-07-02  0:27   ` Honnappa Nagarahalli [this message]
2019-07-05  8:46   ` [dpdk-dev] [PATCH v3 1/4] test/hash: reset global variable to discard old data 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=20190702002724.41400-4-honnappa.nagarahalli@arm.com \
    --to=honnappa.nagarahalli@arm.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=dharmik.thakkar@arm.com \
    --cc=nd@arm.com \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=sameh.gobriel@intel.com \
    --cc=yipeng1.wang@intel.com \
    /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).