Skip to content

Commit ad05154

Browse files
jakemoroniopsiff
authored andcommitted
RDMA/irdma: Fix SD index calculation
[ Upstream commit 8d158f4 ] 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 Fixes: e8c4dbc ("RDMA/irdma: Add PBLE resource manager") Signed-off-by: Jacob Moroni <[email protected]> Link: https://patch.msgid.link/[email protected] Acked-by: Tatyana Nikolova <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Sasha Levin <[email protected]> (cherry picked from commit cd7e3bb8e20098630495a072c0a67dd0e5c503a0) Signed-off-by: Wentao Guan <[email protected]>
1 parent 0b12e00 commit ad05154

File tree

1 file changed

+1
-1
lines changed
  • drivers/infiniband/hw/irdma

1 file changed

+1
-1
lines changed

drivers/infiniband/hw/irdma/pble.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ int irdma_hmc_init_pble(struct irdma_sc_dev *dev,
7171
static void get_sd_pd_idx(struct irdma_hmc_pble_rsrc *pble_rsrc,
7272
struct sd_pd_idx *idx)
7373
{
74-
idx->sd_idx = (u32)pble_rsrc->next_fpm_addr / IRDMA_HMC_DIRECT_BP_SIZE;
74+
idx->sd_idx = pble_rsrc->next_fpm_addr / IRDMA_HMC_DIRECT_BP_SIZE;
7575
idx->pd_idx = (u32)(pble_rsrc->next_fpm_addr / IRDMA_HMC_PAGED_BP_SIZE);
7676
idx->rel_pd_idx = (idx->pd_idx % IRDMA_HMC_PD_CNT_IN_SD);
7777
}

0 commit comments

Comments
 (0)