Skip to content

Commit b69a697

Browse files
mustafakismailrleon
authored andcommitted
RDMA/irdma: Fix memory leak of PBLE objects
On rmmod of irdma, the PBLE object memory is not being freed. PBLE object memory are not statically pre-allocated at function initialization time unlike other HMC objects. PBLEs objects and the Segment Descriptors (SD) for it can be dynamically allocated during scale up and SD's remain allocated till function deinitialization. Fix this leak by adding IRDMA_HMC_IW_PBLE to the iw_hmc_obj_types[] table and skip pbles in irdma_create_hmc_obj but not in irdma_del_hmc_objects(). Fixes: 44d9e52 ("RDMA/irdma: Implement device initialization definitions") Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com> Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com> Link: https://lore.kernel.org/r/20230315145231.931-3-shiraz.saleem@intel.com Signed-off-by: Leon Romanovsky <leon@kernel.org>
1 parent 30ed9ee commit b69a697

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • drivers/infiniband/hw/irdma

drivers/infiniband/hw/irdma/hw.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ static enum irdma_hmc_rsrc_type iw_hmc_obj_types[] = {
4141
IRDMA_HMC_IW_XFFL,
4242
IRDMA_HMC_IW_Q1,
4343
IRDMA_HMC_IW_Q1FL,
44+
IRDMA_HMC_IW_PBLE,
4445
IRDMA_HMC_IW_TIMER,
4546
IRDMA_HMC_IW_FSIMC,
4647
IRDMA_HMC_IW_FSIAV,
@@ -827,6 +828,8 @@ static int irdma_create_hmc_objs(struct irdma_pci_f *rf, bool privileged,
827828
info.entry_type = rf->sd_type;
828829

829830
for (i = 0; i < IW_HMC_OBJ_TYPE_NUM; i++) {
831+
if (iw_hmc_obj_types[i] == IRDMA_HMC_IW_PBLE)
832+
continue;
830833
if (dev->hmc_info->hmc_obj[iw_hmc_obj_types[i]].cnt) {
831834
info.rsrc_type = iw_hmc_obj_types[i];
832835
info.count = dev->hmc_info->hmc_obj[info.rsrc_type].cnt;

0 commit comments

Comments
 (0)