* [PATCH] RDMA/irdma: Fix erroneous -ENOMEM for large MR registration
@ 2026-09-15 17:03 Jacob Moroni
2026-09-15 17:12 ` sashiko-bot
2026-09-22 13:23 ` Leon Romanovsky
0 siblings, 2 replies; 3+ messages in thread
From: Jacob Moroni @ 2026-09-15 17:03 UTC (permalink / raw)
To: tatyana.e.nikolova, jgg, leon; +Cc: linux-rdma, Jacob Moroni
Commit cc8997c94bf3 ("RDMA/irdma: Refactor PBLE functions")
replaced the explicit level1_only boolean with a bit mask
but did not properly convert the "if (level1_only)" check
in irdma_get_pble() to be "lvl == PBLE_LEVEL_1" and instead
left it as "if (lvl)".
User MR registration passes "lvl = PBLE_LEVEL_1 | PBLE_LEVEL_2"
so this check always evaluates to true and causes the
loop to bail after grabbing a single SD even if the region
actually requires more than one SD (as is the case for
regions larger than 1 GiB with 4k pages). As a result, these
registrations can fail with -ENOMEM even if there are
sufficient PBLE resources.
Fixes: cc8997c94bf3 ("RDMA/irdma: Refactor PBLE functions")
Signed-off-by: Jacob Moroni <jmoroni@google.com>
---
drivers/infiniband/hw/irdma/pble.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/irdma/pble.c b/drivers/infiniband/hw/irdma/pble.c
index 28dfad7f940c..14318af97d58 100644
--- a/drivers/infiniband/hw/irdma/pble.c
+++ b/drivers/infiniband/hw/irdma/pble.c
@@ -482,7 +482,7 @@ int irdma_get_pble(struct irdma_hmc_pble_rsrc *pble_rsrc,
status = get_lvl1_lvl2_pble(pble_rsrc, palloc, lvl);
/* if level1_only, only go through it once */
- if (!status || lvl)
+ if (!status || lvl == PBLE_LEVEL_1)
break;
}
--
2.55.0.1032.g73a4cd73de-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] RDMA/irdma: Fix erroneous -ENOMEM for large MR registration
2026-09-15 17:03 [PATCH] RDMA/irdma: Fix erroneous -ENOMEM for large MR registration Jacob Moroni
@ 2026-09-15 17:12 ` sashiko-bot
2026-09-22 13:23 ` Leon Romanovsky
1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-09-15 17:12 UTC (permalink / raw)
To: Jacob Moroni; +Cc: linux-rdma
> Commit cc8997c94bf3 ("RDMA/irdma: Refactor PBLE functions")
> replaced the explicit level1_only boolean with a bit mask
> but did not properly convert the "if (level1_only)" check
> in irdma_get_pble() to be "lvl == PBLE_LEVEL_1" and instead
> left it as "if (lvl)".
>
> User MR registration passes "lvl = PBLE_LEVEL_1 | PBLE_LEVEL_2"
> so this check always evaluates to true and causes the
> loop to bail after grabbing a single SD even if the region
> actually requires more than one SD (as is the case for
> regions larger than 1 GiB with 4k pages). As a result, these
> registrations can fail with -ENOMEM even if there are
> sufficient PBLE resources.
>
> Fixes: cc8997c94bf3 ("RDMA/irdma: Refactor PBLE functions")
> Signed-off-by: Jacob Moroni <jmoroni@google.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260915170317.2901672-1-jmoroni@google.com?part=1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] RDMA/irdma: Fix erroneous -ENOMEM for large MR registration
2026-09-15 17:03 [PATCH] RDMA/irdma: Fix erroneous -ENOMEM for large MR registration Jacob Moroni
2026-09-15 17:12 ` sashiko-bot
@ 2026-09-22 13:23 ` Leon Romanovsky
1 sibling, 0 replies; 3+ messages in thread
From: Leon Romanovsky @ 2026-09-22 13:23 UTC (permalink / raw)
To: tatyana.e.nikolova, jgg, Jacob Moroni; +Cc: linux-rdma
On Tue, 15 Sep 2026 17:03:17 +0000, Jacob Moroni wrote:
> Commit cc8997c94bf3 ("RDMA/irdma: Refactor PBLE functions")
> replaced the explicit level1_only boolean with a bit mask
> but did not properly convert the "if (level1_only)" check
> in irdma_get_pble() to be "lvl == PBLE_LEVEL_1" and instead
> left it as "if (lvl)".
>
> User MR registration passes "lvl = PBLE_LEVEL_1 | PBLE_LEVEL_2"
> so this check always evaluates to true and causes the
> loop to bail after grabbing a single SD even if the region
> actually requires more than one SD (as is the case for
> regions larger than 1 GiB with 4k pages). As a result, these
> registrations can fail with -ENOMEM even if there are
> sufficient PBLE resources.
>
> [...]
Applied, thanks!
[1/1] RDMA/irdma: Fix erroneous -ENOMEM for large MR registration
https://git.kernel.org/rdma/rdma/c/5bb710151753fe
Best regards,
--
Leon Romanovsky <leon@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-09-22 13:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-15 17:03 [PATCH] RDMA/irdma: Fix erroneous -ENOMEM for large MR registration Jacob Moroni
2026-09-15 17:12 ` sashiko-bot
2026-09-22 13:23 ` Leon Romanovsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox