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 62DAF45E92; Fri, 13 Dec 2024 18:05:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EA4C140B8F; Fri, 13 Dec 2024 18:05:52 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 3A279409FA for ; Fri, 13 Dec 2024 18:05:51 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1213) id 5C807204BAA9; Fri, 13 Dec 2024 09:05:50 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 5C807204BAA9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1734109550; bh=V/wfqz3c+fvNJWZaG9fudHyXc0ji4YSgg0FXSx2prKk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kBBF2UgtzAJB9XYGNLObBAYkoNMybG2nTLNF7NaU6q604/6symm9AXNZztO7ef6jI 2zZS7L/zSsFhXbg7tw+eFqjkeC0f/2mmdlik6ahgKGZTQqpmt1lsJodDoIH74snN+i sHHkOSY9RCkVruvdyG3pYUjWwYGmL4wvseJM9qIw= Date: Fri, 13 Dec 2024 09:05:50 -0800 From: Andre Muezerie To: "Medvedkin, Vladimir" Cc: Bruce Richardson , dev@dpdk.org Subject: Re: [PATCH] app/test: fix stack overflow in lpm6_perf_autotest Message-ID: <20241213170550.GA2941@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1734057571-20367-1-git-send-email-andremue@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) 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 On Fri, Dec 13, 2024 at 10:22:20AM +0000, Medvedkin, Vladimir wrote: > Hi Andre, > > On 13/12/2024 02:39, Andre Muezerie wrote: > >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 | 11 +++++++++-- > > 1 file changed, 9 insertions(+), 2 deletions(-) > > > >diff --git a/app/test/test_lpm6_perf.c b/app/test/test_lpm6_perf.c > >index 1860a99ed6..8231ad825d 100644 > >--- a/app/test/test_lpm6_perf.c > >+++ b/app/test/test_lpm6_perf.c > >@@ -117,8 +117,12 @@ 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 *)malloc( > why not rte_malloc? For no good reason :-) I'll update the patch. Thanks for the suggestion. Andre Muezerie > >+ sizeof(struct rte_ipv6_addr) * NUM_IPS_ENTRIES); > >+ TEST_LPM_ASSERT(ip_batch != NULL); > >+ > >+ int32_t *next_hops = (int32_t *)malloc(sizeof(int32_t) * NUM_IPS_ENTRIES); > >+ TEST_LPM_ASSERT(next_hops != NULL); > > for (i = 0; i < NUM_IPS_ENTRIES; i++) > > ip_batch[i] = large_ips_table[i].ip; > >@@ -153,6 +157,9 @@ test_lpm6_perf(void) > > printf("Average LPM Delete: %g cycles\n", > > (double)total_time / NUM_ROUTE_ENTRIES); > >+ free(next_hops); > >+ free(ip_batch); > >+ > > rte_lpm6_delete_all(lpm); > > rte_lpm6_free(lpm); > > -- > Regards, > Vladimir