Skip to content

Commit 959d2c3

Browse files
Zildj1anrleon
authored andcommitted
RDMA/irdma: Use kvzalloc for paged memory DMA address array
Allocate array chunk->dmainfo.dmaaddrs using kvzalloc() to allow the allocation to fall back to vmalloc when contiguous memory is unavailable (instead of failing and logging page allocation warnings). Acked-by: Tatyana Nikolova <tatyana.e.nikolova@intel.com> Signed-off-by: Carlos Bilbao (Lambda) <carlos.bilbao@kernel.org> Link: https://patch.msgid.link/20260128014446.405247-1-carlos.bilbao@kernel.org Signed-off-by: Leon Romanovsky <leon@kernel.org>
1 parent 87bf646 commit 959d2c3

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/infiniband/hw/irdma/utils.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2239,7 +2239,7 @@ void irdma_pble_free_paged_mem(struct irdma_chunk *chunk)
22392239
chunk->pg_cnt);
22402240

22412241
done:
2242-
kfree(chunk->dmainfo.dmaaddrs);
2242+
kvfree(chunk->dmainfo.dmaaddrs);
22432243
chunk->dmainfo.dmaaddrs = NULL;
22442244
vfree(chunk->vaddr);
22452245
chunk->vaddr = NULL;
@@ -2256,7 +2256,7 @@ int irdma_pble_get_paged_mem(struct irdma_chunk *chunk, u32 pg_cnt)
22562256
u32 size;
22572257
void *va;
22582258

2259-
chunk->dmainfo.dmaaddrs = kzalloc(pg_cnt << 3, GFP_KERNEL);
2259+
chunk->dmainfo.dmaaddrs = kvzalloc(pg_cnt << 3, GFP_KERNEL);
22602260
if (!chunk->dmainfo.dmaaddrs)
22612261
return -ENOMEM;
22622262

@@ -2277,7 +2277,7 @@ int irdma_pble_get_paged_mem(struct irdma_chunk *chunk, u32 pg_cnt)
22772277

22782278
return 0;
22792279
err:
2280-
kfree(chunk->dmainfo.dmaaddrs);
2280+
kvfree(chunk->dmainfo.dmaaddrs);
22812281
chunk->dmainfo.dmaaddrs = NULL;
22822282

22832283
return -ENOMEM;

0 commit comments

Comments
 (0)