RDMA/irdma: Fix SD index calculation
Subsystems (2)
PATCH 1/1 RDMA/irdma: Fix SD index calculation
In some cases, it is possible for pble_rsrc->next_fpm_addr to be larger than u32, so remove the u32 cast to avoid unintentional truncation.
This fixes the following error that can be observed when registering massive memory regions:
[ 447.227494] (NULL ib_device): cqp opcode = 0x1f maj_err_code = 0xffff min_err_code = 0x800c [ 447.227505] (NULL ib_device): [Update PE SDs Cmd Error][op_code=21] status=-5 waiting=1 completion_err=1 maj=0xffff min=0x800c
--- drivers/infiniband/hw/irdma/pble.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/irdma/pble.c +1 -1
@@ -71,7 +71,7 @@ int irdma_hmc_init_pble(struct irdma_sc_dev *dev,static void get_sd_pd_idx (struct irdma_hmc_pble_rsrc *pble_rsrc,struct sd_pd_idx *idx) { - idx->sd_idx = (u32 )pble_rsrc->next_fpm_addr /IRDMA_HMC_DIRECT_BP_SIZE ; + idx->sd_idx = pble_rsrc->next_fpm_addr /IRDMA_HMC_DIRECT_BP_SIZE ; idx->pd_idx = (u32)(pble_rsrc->next_fpm_addr /IRDMA_HMC_PAGED_BP_SIZE ); idx->rel_pd_idx = (idx->pd_idx %IRDMA_HMC_PD_CNT_IN_SD ); }
Signature · 1 line
2.51.0.534.gc79095c0ca-goog
Quoted 16 lines
-----Original Message-----
From: Jacob Moroni <[email protected]>
Sent: Tuesday, September 23, 2025 2:09 PM
To: Nikolova, Tatyana E <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Jacob Moroni <[email protected]>
Subject: [PATCH rdma-next] RDMA/irdma: Fix SD index calculationIn some cases, it is possible for
pble_rsrc->next_fpm_addrto be larger than u32, so remove the u32 cast to avoid unintentional truncation.This fixes the following error that can be observed when registering massive memory regions:
Quoted 8 lines
[ 447.227494] (NULL ib_device): cqp opcode = 0x1f maj_err_code = 0xffff
min_err_code=0x800c[ 447.227505] (NULLib_device): [Update PE SDs Cmd Error][op_code=21] status=-5 waiting=1 completion_err=1 maj=0xffff min=0x800cFixes e8c4dbc2fcac ("RDMA/irdma: Add PBLE resource manager")Signed-off-by Jacob Moroni <[email protected]>---
Thank you
Leon Romanovsky
AppliedQuoted 8 lines · Jacob Moroni
In some cases, it is possible for
pble_rsrc->next_fpm_addrto be larger than u32, so remove the u32 cast to avoid unintentional truncation.This fixes the following error that can be observed when registering massive memory regions:
[...]
Applied, thanks!
[1/1] RDMA/irdma: Fix SD index calculation
https://git.kernel.org/rdma/rdma/c/8d158f47f1f33d
Best regards,
Signature · 1 line
Leon Romanovsky <[email protected]>