From patchwork Tue Jul 2 00:27:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honnappa Nagarahalli X-Patchwork-Id: 168252 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp3543482ilk; Mon, 1 Jul 2019 17:28:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqzr5V4ucPkuZVhXGvmKBk1hOGRze57+5fT3xSoDovFYPMDfMzuo1rEUduhljq993aiLCUUf X-Received: by 2002:adf:9425:: with SMTP id 34mr13545578wrq.38.1562027285285; Mon, 01 Jul 2019 17:28:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562027285; cv=none; d=google.com; s=arc-20160816; b=AE8kV9ikSc7xdAWzerCDiiUV51yMjn8k1lYj3es0w9D8EV5gjV4VbhA+K1hSMz40fG mBW8xQuU7jeSdkr9JukpcI4n5sEV5Y2TXVrMV6hmQSC0hz31nAAqE3kAEEtUe0feUWJE szB7fgFXflzfYIlQa3o7TlKwUOt59Ux5w0jpYqzh5WuisWQvi4MCcY6oYgXkNy0VuSHS g1MeMkmd06FwUxxLkrPoAXGwFr42xHyMXS9cotDSt1YTcdHHfwItf8iOQwQubeP5s13h Y4loGf05ZTpjFHXOd41ZqBkQKRVpvgYo2zZ2UwwOwHZ30AJoXSGyf5zNnYaU6vCe3zqx rn8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=EQvDghLWGmpWrdUQgfBa27j0PS713hx6IANRb18sMhg=; b=hspIkryMWzI3bJ0Y4q1xtsMfFmP+wk3WXDgh6/oMjkePhExRHoYRJttLDdQPbGWItv ZX9t8hhXnHEY5AfWnx12GpPvRj5HQRb19XSaqu6zGE+oJSeOe3MwMpTVHq1TT8Z6I5qO R1cuPz/uuctOfK3j8jcNxiWZ4hEDfGGogvjfPTbX/zRhh2IazKFrwvxIQ0a4y8ldlTzy VzoWsbuglMkZxC3qBZyreWWPqs1c/coi+8lVqxLuPNKmDjms/LSg6FXT4PmXv7WFQsvt 232jc4a1s5Og1KzLCbwX3Mhlb3UNRa19bTE/qRRRcfbW3VEVP951Q6u/ZH8y5Bs21OQY kfxw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id l8si584377wmc.137.2019.07.01.17.28.05; Mon, 01 Jul 2019 17:28:05 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0BAA81B9BA; Tue, 2 Jul 2019 02:27:46 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by dpdk.org (Postfix) with ESMTP id 29A3C1B9B2 for ; Tue, 2 Jul 2019 02:27:43 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9B5911424; Mon, 1 Jul 2019 17:27:42 -0700 (PDT) Received: from qc2400f-1.austin.arm.com (qc2400f-1.austin.arm.com [10.118.12.65]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 88FD53F718; Mon, 1 Jul 2019 17:27:42 -0700 (PDT) From: Honnappa Nagarahalli 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 Date: Mon, 1 Jul 2019 19:27:24 -0500 Message-Id: <20190702002724.41400-4-honnappa.nagarahalli@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190702002724.41400-1-honnappa.nagarahalli@arm.com> References: <20190627032420.4730-1-honnappa.nagarahalli@arm.com> <20190702002724.41400-1-honnappa.nagarahalli@arm.com> Subject: [dpdk-dev] [PATCH v3 4/4] test/hash: use array for small amount of memory X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Variables of size 128B can make use of stack instead of dynamically allocated memory. Signed-off-by: Honnappa Nagarahalli --- 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(-) -- 2.17.1 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;