* [PATCH] RDMA/irdma: Fix FRWR IRDMAQPSQ_PBLADDR field population
@ 2026-10-15 16:17 Jacob Moroni
2026-10-15 16:28 ` sashiko-bot
2026-10-15 18:44 ` Leon Romanovsky
0 siblings, 2 replies; 3+ messages in thread
From: Jacob Moroni @ 2026-10-15 16:17 UTC (permalink / raw)
To: tatyana.e.nikolova, jgg, leon; +Cc: linux-rdma, metze, Jacob Moroni
Previously, the IRDMAQPSQ_PBLADDR FRWR WQE field was being populated
using a mask that was right-shifted, whereas it should have been the
address being right-shifted.
This ended up working fine in many cases because the lowermost 12 bits
are always zero (the addresses are page aligned) and the uppermost 12
bits are usually zero too, but it could break for DMA addresses that
are wider than 52 bits.
Fix this by right-shifting the address instead of the mask, similar
to how it was done in the original i40iw driver.
Tested with NFS over RDMA with some added debug logs to ensure it
was hitting both the direct (single page) path as well as multi
page (< 512).
Fixes: 3f49d6842569 ("RDMA/irdma: Implement HW Admin Queue OPs")
Signed-off-by: Jacob Moroni <jmoroni@google.com>
---
drivers/infiniband/hw/irdma/ctrl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/irdma/ctrl.c b/drivers/infiniband/hw/irdma/ctrl.c
index 0db73fd7d01b..b62bf4d11829 100644
--- a/drivers/infiniband/hw/irdma/ctrl.c
+++ b/drivers/infiniband/hw/irdma/ctrl.c
@@ -1727,7 +1727,7 @@ int irdma_sc_mr_fast_register(struct irdma_sc_qp *qp,
info->first_pm_pbl_index >> 16);
set_64bit_val(wqe, 8,
FIELD_PREP(IRDMAQPSQ_FIRSTPMPBLIDXHI, temp) |
- FIELD_PREP(IRDMAQPSQ_PBLADDR >> IRDMA_HW_PAGE_SHIFT, info->reg_addr_pa));
+ FIELD_PREP(IRDMAQPSQ_PBLADDR, info->reg_addr_pa >> IRDMA_HW_PAGE_SHIFT));
set_64bit_val(wqe, 16,
info->total_len |
FIELD_PREP(IRDMAQPSQ_FIRSTPMPBLIDXLO, info->first_pm_pbl_index));
--
2.56.0.385.gd3acb90ef8-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] RDMA/irdma: Fix FRWR IRDMAQPSQ_PBLADDR field population
2026-10-15 16:17 [PATCH] RDMA/irdma: Fix FRWR IRDMAQPSQ_PBLADDR field population Jacob Moroni
@ 2026-10-15 16:28 ` sashiko-bot
2026-10-15 18:44 ` Leon Romanovsky
1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-10-15 16:28 UTC (permalink / raw)
To: Jacob Moroni; +Cc: linux-rdma
> Previously, the IRDMAQPSQ_PBLADDR FRWR WQE field was being populated
> using a mask that was right-shifted, whereas it should have been the
> address being right-shifted.
>
> This ended up working fine in many cases because the lowermost 12 bits
> are always zero (the addresses are page aligned) and the uppermost 12
> bits are usually zero too, but it could break for DMA addresses that
> are wider than 52 bits.
>
> Fix this by right-shifting the address instead of the mask, similar
> to how it was done in the original i40iw driver.
>
> Tested with NFS over RDMA with some added debug logs to ensure it
> was hitting both the direct (single page) path as well as multi
> page (< 512).
>
> Fixes: 3f49d6842569 ("RDMA/irdma: Implement HW Admin Queue OPs")
> 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/20261015161756.3078300-1-jmoroni@google.com?part=1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] RDMA/irdma: Fix FRWR IRDMAQPSQ_PBLADDR field population
2026-10-15 16:17 [PATCH] RDMA/irdma: Fix FRWR IRDMAQPSQ_PBLADDR field population Jacob Moroni
2026-10-15 16:28 ` sashiko-bot
@ 2026-10-15 18:44 ` Leon Romanovsky
1 sibling, 0 replies; 3+ messages in thread
From: Leon Romanovsky @ 2026-10-15 18:44 UTC (permalink / raw)
To: tatyana.e.nikolova, jgg, Jacob Moroni; +Cc: linux-rdma, metze
On Thu, 15 Oct 2026 16:17:55 +0000, Jacob Moroni wrote:
> Previously, the IRDMAQPSQ_PBLADDR FRWR WQE field was being populated
> using a mask that was right-shifted, whereas it should have been the
> address being right-shifted.
>
> This ended up working fine in many cases because the lowermost 12 bits
> are always zero (the addresses are page aligned) and the uppermost 12
> bits are usually zero too, but it could break for DMA addresses that
> are wider than 52 bits.
>
> [...]
Applied, thanks!
[1/1] RDMA/irdma: Fix FRWR IRDMAQPSQ_PBLADDR field population
https://git.kernel.org/rdma/rdma/c/59df57262e6fa9
Best regards,
--
Leon Romanovsky <leon@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-15 18:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-15 16:17 [PATCH] RDMA/irdma: Fix FRWR IRDMAQPSQ_PBLADDR field population Jacob Moroni
2026-10-15 16:28 ` sashiko-bot
2026-10-15 18:44 ` Leon Romanovsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox