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 C5E0845E92; Fri, 13 Dec 2024 18:08:27 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5F1C04068E; Fri, 13 Dec 2024 18:08:27 +0100 (CET) Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by mails.dpdk.org (Postfix) with ESMTP id 93AF6400D5 for ; Fri, 13 Dec 2024 18:08:25 +0100 (CET) Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-2164b662090so17612025ad.1 for ; Fri, 13 Dec 2024 09:08:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1734109705; x=1734714505; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=fUr/l1Pdf78RbDbf6VMtD2cqieSyCHYDIkk4joiQiGw=; b=wQ9+XBGI6iyGlY4Binrt1FdJsa2H+NMQ0pRO3EH5h+62hfTj/a6sgkcoIlAeLg9T9B VHpBZV0HCp5UeuuBvPttNRRT9If6qcCOpcWFSWJcEf8I/lHcjyUMn5kTyjYEVNdHkryP AhJUfWbLwwjpHsOXGZF/MGHCvSvaU7mkwdDsHC1Lm0N63LvDa52m7ABtsTCuuplIhMoY ZZkFapDbwvIPvx7Mclbh8eMscDLdTl0BKnFiEGcRIvh0vbmQXPu1GOyTmSwMHUBfLAsN h+NS+bdE9QkNGlxmDrvon3sTlRXtH31ka3jjK3v2PhirwUAdKXt5pBA/Y8cMk/tFZaEE Ai4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734109705; x=1734714505; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fUr/l1Pdf78RbDbf6VMtD2cqieSyCHYDIkk4joiQiGw=; b=UdnqNaZ1oO/zOq0MH9JTmk+wCtxNzC+JTgcKvLA1ApCKwDxLIA8eTDYa8jHtTIfh3q WhmB1OtvV4LqOHYDoHz2AjIBCG7QTy1HiKGRdARhKzg02jTzvcGuyqRQnyZ0Hvxm7GSJ hCTocG+TG4IKPf2qE3sY19xI0wjKQWzaage55ryud414V+3fBQTXHk4UOnn553uMqGtF 01FJh+O/F34VYgW094UiMEAGirhwPgyVABOCNq0m98mC/Zh7Yg/EYQVZC+z0sQCbKy+i xQR6GJxlEOspoK4pQCX4mLhiudanRr6htz+L1abOMkGjxk8BAUjraDDSdJecz1uHNznC gYAg== X-Forwarded-Encrypted: i=1; AJvYcCUcXiMVT6GPoMn68pvS+lmN3jceotEzlH/fjxa+ApJx+1dtocfFcd8oCNkDvnNKOgJOqQM=@dpdk.org X-Gm-Message-State: AOJu0YwXrfqqCVHfIRwFW3QvDhb9wncIZbXJIzASDHhLhmnZQmJESEwA bxgzudKDjU8ce1yePBHQvIzf4aGl75GovCjIMyJAwgRZWFVQSuHsAzbpIRuwcUA= X-Gm-Gg: ASbGncvhgTZozSDTR5SOofYapHTQ9i4Cr1wfF6USvwzrZvNCRqyNxamBFM5G83Kd+SP BmE7JikncLGZjgUJutxmvlaG2LmHsi11xiR9210EOCL5tfZyMFCYtPks+G8P/VrsDjuIUyNVjw0 Bwff1s3qWxMc+QSNygZdXG4sLruV7SdM0uP5Bf9VCr4DMMaqDdeSx/8jTqCLpCiX7nM0fvqis0P UWtav8oa1QrM3mBPcYeo8EOimRtX45VBfURS1vLIgKrCObclfWBhDGa6yWO42ZmtU0QNeoLaH1G nKCxIUB6FEoy3VCEwh20494DCDh+mMEWnA== X-Google-Smtp-Source: AGHT+IF88wF7NZaljfvUEAtkV+TBcP+OB8zf30UYQ82ZGZPx8MLsT+IKbUUYCRfCqavxSQpCw/mwlA== X-Received: by 2002:a17:902:e808:b0:216:4c88:d939 with SMTP id d9443c01a7336-21892a41d6fmr44695795ad.38.1734109704704; Fri, 13 Dec 2024 09:08:24 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-218a1e510a9sm10795ad.167.2024.12.13.09.08.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:08:24 -0800 (PST) Date: Fri, 13 Dec 2024 09:08:22 -0800 From: Stephen Hemminger To: "Medvedkin, Vladimir" Cc: Andre Muezerie , Bruce Richardson , Subject: Re: [PATCH] app/test: fix stack overflow in lpm6_perf_autotest Message-ID: <20241213090822.23687f7a@hermes.local> In-Reply-To: References: <1734057571-20367-1-git-send-email-andremue@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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, 13 Dec 2024 10:22:20 +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? > > + sizeof(struct rte_ipv6_addr) * NUM_IPS_ENTRIES); > > + TEST_LPM_ASSERT(ip_batch != NULL); There is no need for rte_malloc() here. The data doesn't need to come from hugepages and regular malloc() has more checking. But the cast is unnecessary in C.