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 5AD8145F1B; Tue, 24 Dec 2024 02:47:36 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F3A5A4029C; Tue, 24 Dec 2024 02:47:35 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 7480840263 for ; Tue, 24 Dec 2024 02:47:34 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1213) id 9E54F206ADD2; Mon, 23 Dec 2024 17:47:33 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 9E54F206ADD2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1735004853; bh=LIRl2E2cQQMVyRLwmruJHN1JRqy5+TH/4Lo9eItwoqc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=G6DL8Of+qZbS0FIjJxNrEg3W0y2HLabv5xrp1W5setFKlxCmjypj7IUI1Gs/mprT3 is0EcdnFce7rdorKGvBe3hZ/o17uLkAMYPFcQJWjrNGFwZe1ZBsnujAjgU5p5n1ZQZ TpluZv5a+D1R35U6t5ZcFoj7tFCzhMEp66OEvsMg= Date: Mon, 23 Dec 2024 17:47:33 -0800 From: Andre Muezerie To: Stephen Hemminger Cc: Vladimir Medvedkin , dev@dpdk.org Subject: Re: [PATCH] app/test: fix stack overflow in fib6_perf_autotest Message-ID: <20241224014733.GA19006@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1734988233-20208-1-git-send-email-andremue@linux.microsoft.com> <20241223133000.0a761f5a@fedora> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20241223133000.0a761f5a@fedora> 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 Mon, Dec 23, 2024 at 01:30:00PM -0800, Stephen Hemminger wrote: > On Mon, 23 Dec 2024 13:10:33 -0800 > Andre Muezerie wrote: > > > From: Andre Muezerie > > To: Vladimir Medvedkin > > Cc: dev@dpdk.org, Andre Muezerie > > Subject: [PATCH] app/test: fix stack overflow in fib6_perf_autotest > > Date: Mon, 23 Dec 2024 13:10:33 -0800 > > X-Mailer: git-send-email 1.8.3.1 > > > > Test fib6_perf_autotest was hitting a stack overflow on Windows > > with MSVC. > > > > The fix is to move some of the data from the stack to the heap. > > > > Signed-off-by: Andre Muezerie > > Use regular malloc please. > rte_malloc comes from hugepages which are more limited and slower to manipulate. I recently submitted a patch for a test with a very similar issue and during review one of the reviewers encouraged me to use rte_calloc to allocate memory for the arrays, which I think makes sense (I had used malloc initially): https://inbox.dpdk.org/dev/20241218151206.GA25758@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net/ Even though this is a perf test, the code responsible for the memory allocations is not in the path for which time measurements are being taken (points between rte_rdtsc calls), so perf for the memory allocation code is probably not so critical. That being said, if you still feel strongly that malloc should be used instead let me know and I can make that change. Thanks, Andre Muezerie