Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Bernard Metzler <bernard.metzler@linux.dev>
To: Leon Romanovsky <leon@kernel.org>, rosenp@gmail.com
Cc: jgg@ziepe.ca, kees@kernel.org, gustavoars@kernel.org,
	linux-rdma@vger.kernel.org
Subject: Re: [RFC PATCH v3] RDMA/siw: use kzalloc_flex
Date: Thu, 14 May 2026 15:14:24 +0200	[thread overview]
Message-ID: <7463ed4b-543c-49d4-9337-f41915354a3f@linux.dev> (raw)
In-Reply-To: <177869432039.2333679.10257766726760194039.b4-ty@kernel.org>

On 13.05.2026 19:45, Leon Romanovsky wrote:
> 
> On Mon, 11 May 2026 16:11:49 +0200, bernard.metzler@linux.dev wrote:
>> Simplify umem allocation by using flexible array member.
>> Add __counted_by to get extra runtime analysis.
> 
> Applied, thanks!
> 
> [1/1] RDMA/siw: use kzalloc_flex
>        https://git.kernel.org/rdma/rdma/c/79678bea399052
> 
> Best regards,
Hi Leon,

per Jason's suggestion, please amend the patch by
adding below line. We should NOT assume kzalloc_flex
to initialize anything but 0. So we shall set
umem->num_chunks explicitly.

Many thanks,
Bernard.
----

diff --git a/drivers/infiniband/sw/siw/siw_mem.c b/drivers/infiniband/sw/siw/siw_mem.c
index 88ec3cacfa00..40455616d9ec 100644
--- a/drivers/infiniband/sw/siw/siw_mem.c
+++ b/drivers/infiniband/sw/siw/siw_mem.c
@@ -359,6 +359,7 @@ struct siw_umem *siw_umem_get(struct ib_device *base_dev, u64 start,
	umem->fp_addr = first_page_va;
	umem->base_mem = base_mem;
	umem->num_pages = num_pages;
+	umem->num_chunks = num_chunks;

	sgt = &base_mem->sgt_append.sgt;
	__sg_page_iter_start(&sg_iter, sgt->sgl, sgt->orig_nents, 0);


      reply	other threads:[~2026-05-14 13:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-11 14:11 [RFC PATCH v3] RDMA/siw: use kzalloc_flex bernard.metzler
2026-05-13 14:17 ` Bernard Metzler
2026-05-13 14:28   ` Jason Gunthorpe
2026-05-14 16:12     ` Kees Cook
2026-05-13 17:45 ` Leon Romanovsky
2026-05-14 13:14   ` Bernard Metzler [this message]

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=7463ed4b-543c-49d4-9337-f41915354a3f@linux.dev \
    --to=bernard.metzler@linux.dev \
    --cc=gustavoars@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=kees@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=rosenp@gmail.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