RE: [EXT] Re: [PATCH net v3] octeontx2-af: Initialize maps.

From: Ratheesh Kannoth
Date: Thu Feb 01 2024 - 04:38:32 EST


> From: Simon Horman <horms@xxxxxxxxxx>
> Subject: [EXT] Re: [PATCH net v3] octeontx2-af: Initialize maps.
> > /* Alloc memory for saving entry to RVU PFFUNC allocation mapping
> */
> > mcam->entry2pfvf_map = kmalloc_array(mcam->bmap_entries,
> > - sizeof(u16), GFP_KERNEL);
> > + sizeof(u16),
> > + GFP_KERNEL | __GFP_ZERO);
>
> Hi Ratheesh,
>
> The use of bitmap_zalloc()/bitmap_free() looks good to me.
> But for the kmalloc_array(..., GFP_KERNEL | __GFP_ZERO) cases I think
> kcalloc() is the way to go.
Kcalloc() is a wrapper around kmalloc_array(). Why do you think kcalloc()
Is better ?