On Fri, 13 Dec 2024 10:22:20 +0000
"Medvedkin, Vladimir" <vladimir.medved...@intel.com> 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 <andre...@linux.microsoft.com>
> > ---
> >   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.

Reply via email to