From: carlos.bilbao@kernel.org
To: Leon Romanovsky <leon@kernel.org>
Cc: Carlos Bilbao <carlos.bilbao@lambdal.com>,
linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
Carlos Bilbao <carlos.bilbao@kernel.org>,
Tatyana Nikolova <tatyana.e.nikolova@intel.com>
Subject: [PATCH v2] RDMA/irdma: Use kvzalloc for paged memory DMA address array
Date: Tue, 27 Jan 2026 17:44:46 -0800 [thread overview]
Message-ID: <20260128014446.405247-1-carlos.bilbao@kernel.org> (raw)
In-Reply-To: <20260126194655.GN13967@unreal>
From: Carlos Bilbao <carlos.bilbao@kernel.org>
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>
---
drivers/infiniband/hw/irdma/utils.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/infiniband/hw/irdma/utils.c b/drivers/infiniband/hw/irdma/utils.c
index 13d7499131d4..6aac6d314564 100644
--- a/drivers/infiniband/hw/irdma/utils.c
+++ b/drivers/infiniband/hw/irdma/utils.c
@@ -2239,7 +2239,7 @@ void irdma_pble_free_paged_mem(struct irdma_chunk *chunk)
chunk->pg_cnt);
done:
- kfree(chunk->dmainfo.dmaaddrs);
+ kvfree(chunk->dmainfo.dmaaddrs);
chunk->dmainfo.dmaaddrs = NULL;
vfree(chunk->vaddr);
chunk->vaddr = NULL;
@@ -2256,7 +2256,7 @@ int irdma_pble_get_paged_mem(struct irdma_chunk *chunk, u32 pg_cnt)
u32 size;
void *va;
- chunk->dmainfo.dmaaddrs = kzalloc(pg_cnt << 3, GFP_KERNEL);
+ chunk->dmainfo.dmaaddrs = kvzalloc(pg_cnt << 3, GFP_KERNEL);
if (!chunk->dmainfo.dmaaddrs)
return -ENOMEM;
@@ -2277,7 +2277,7 @@ int irdma_pble_get_paged_mem(struct irdma_chunk *chunk, u32 pg_cnt)
return 0;
err:
- kfree(chunk->dmainfo.dmaaddrs);
+ kvfree(chunk->dmainfo.dmaaddrs);
chunk->dmainfo.dmaaddrs = NULL;
return -ENOMEM;
--
2.43.0
next prev parent reply other threads:[~2026-01-28 1:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-21 18:54 [PATCH] RDMA/irdma: Use kvzalloc for paged memory DMA address array Carlos Bilbao
2026-01-21 19:00 ` Carlos Bilbao
2026-01-22 20:53 ` Nikolova, Tatyana E
2026-01-26 19:46 ` Leon Romanovsky
2026-01-28 1:44 ` carlos.bilbao [this message]
2026-01-28 12:18 ` [PATCH v2] " Leon Romanovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260128014446.405247-1-carlos.bilbao@kernel.org \
--to=carlos.bilbao@kernel.org \
--cc=carlos.bilbao@lambdal.com \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=tatyana.e.nikolova@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox