From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 98AF745E92; Fri, 13 Dec 2024 18:08:36 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 88BC440DD8; Fri, 13 Dec 2024 18:08:36 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id B3B3840DDA for ; Fri, 13 Dec 2024 18:08:34 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1213) id 175A520BCAD0; Fri, 13 Dec 2024 09:08:34 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 175A520BCAD0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1734109714; bh=JtnqdyYZVTh13dx9QCi+ohov9wDfAn4QdNvQH1vkpEo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tOAFQ9oAXH0fsSG/hRbXUp2bRTU1brymNHzOtF5CNsbYq39GuPiPJ/4s6hORPEu2G szi+qlrGn1qFCdWMy2QAJUkS63tXfa/DoNUn+TegSq5puxJz5WPj0V2AkkL5mWw77J CPAuNytMhnnORiTzOHBqsG5RX62TJKE+Yj4CXGK8= From: Andre Muezerie To: andremue@linux.microsoft.com Cc: bruce.richardson@intel.com, dev@dpdk.org, vladimir.medvedkin@intel.com Subject: [PATCH v2] app/test: fix stack overflow in lpm6_perf_autotest Date: Fri, 13 Dec 2024 09:08:22 -0800 Message-Id: <1734109702-3647-1-git-send-email-andremue@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1734057571-20367-1-git-send-email-andremue@linux.microsoft.com> References: <1734057571-20367-1-git-send-email-andremue@linux.microsoft.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Test lpm6_perf_autotest was hitting a stack overflow on Windows with both MSVC and Clang. The fix is to move some of the data from the stack to the heap. Signed-off-by: Andre Muezerie --- app/test/test_lpm6_perf.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/app/test/test_lpm6_perf.c b/app/test/test_lpm6_perf.c index 1860a99ed6..a09e8611ce 100644 --- a/app/test/test_lpm6_perf.c +++ b/app/test/test_lpm6_perf.c @@ -10,6 +10,7 @@ #include #include +#include #include #include @@ -117,8 +118,14 @@ test_lpm6_perf(void) total_time = 0; count = 0; - struct rte_ipv6_addr ip_batch[NUM_IPS_ENTRIES]; - int32_t next_hops[NUM_IPS_ENTRIES]; + struct rte_ipv6_addr *ip_batch = + (struct rte_ipv6_addr *)rte_malloc("ip_batch", + sizeof(struct rte_ipv6_addr) * NUM_IPS_ENTRIES, 0); + TEST_LPM_ASSERT(ip_batch != NULL); + + int32_t *next_hops = (int32_t *)rte_malloc("next_hops", + sizeof(int32_t) * NUM_IPS_ENTRIES, 0); + TEST_LPM_ASSERT(next_hops != NULL); for (i = 0; i < NUM_IPS_ENTRIES; i++) ip_batch[i] = large_ips_table[i].ip; @@ -153,6 +160,9 @@ test_lpm6_perf(void) printf("Average LPM Delete: %g cycles\n", (double)total_time / NUM_ROUTE_ENTRIES); + rte_free(next_hops); + rte_free(ip_batch); + rte_lpm6_delete_all(lpm); rte_lpm6_free(lpm); -- 2.47.0.vfs.0.3