Skip to content

Commit 55f6829

Browse files
Shani Michaelijfvogel
authored andcommitted
mlx4: Handle memory region deregistration failure
Memory region deregistration can fail when memory windows are bound to it. We handle such failures by propagating them to the user, or by printing a serious warning. Signed-off-by: Haggai Eran <[email protected]> Signed-off-by: Shani Michaeli <[email protected]> (Ported from Mellanox OFED 2.4) Signed-off-by: Mukesh Kacker <[email protected]> Orabug: 27510464 (cherry picked from commit 872599a) cherry-pick-repo=linux-uek.git This is a partial port of the cherry-picked commit: Changes to drivers/infiniband/core/uverbs_main.c are no longer needed because upstream commits fd3c790 and 43579b5 have introduced new implementation for this code section. Conflicts: drivers/infiniband/core/uverbs_main.c Signed-off-by: Qing Huang <[email protected]> Reviewed-by: Yuval Shaia <[email protected]> Signed-off-by: Aron Silverton <[email protected]> Signed-off-by: Somasundaram Krishnasamy <[email protected]> Orabug: 31620961 UEK5 => UEK6 (cherry picked from commit c113cd0) cherry-pick-repo=UEK/production/linux-uek.git unmodified-from-upstream: c113cd0 Signed-off-by: Qing Huang <[email protected]> Reviewed-by: Sharath Srinivasan <[email protected]> Signed-off-by: Aron Silverton <[email protected]> Orabug: 31620963 UEK6 => LUCI (cherry picked from commit 3fecb9e) cherry-pick-repo=UEK/production/linux-uek.git Conflicts: drivers/net/ethernet/mellanox/mlx4/mr.c Only include changes to en_main.c and ignore changes to mr.c since FMR support was removed by upstream commit: 1f55b7a ("RDMA/mlx4: Remove FMR support for memory registration") Signed-off-by: Sharath Srinivasan <[email protected]> Reviewed-by: Qing Huang <[email protected]> Signed-off-by: Aron Silverton <[email protected]
1 parent c8bfa12 commit 55f6829

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

drivers/net/ethernet/mellanox/mlx4/en_main.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,11 @@ static void mlx4_en_event(struct mlx4_dev *dev, void *endev_ptr,
227227
static void mlx4_en_remove(struct mlx4_dev *dev, void *endev_ptr)
228228
{
229229
struct mlx4_en_dev *mdev = endev_ptr;
230+
#ifdef WITHOUT_ORACLE_EXTENSIONS
230231
int i;
232+
#else
233+
int i, ret;
234+
#endif /* WITHOUT_ORACLE_EXTENSIONS */
231235

232236
mutex_lock(&mdev->state_lock);
233237
mdev->device_up = false;
@@ -239,7 +243,13 @@ static void mlx4_en_remove(struct mlx4_dev *dev, void *endev_ptr)
239243

240244
flush_workqueue(mdev->workqueue);
241245
destroy_workqueue(mdev->workqueue);
246+
#ifdef WITHOUT_ORACLE_EXTENSIONS
242247
(void) mlx4_mr_free(dev, &mdev->mr);
248+
#else
249+
ret = mlx4_mr_free(dev, &mdev->mr);
250+
if (ret)
251+
mlx4_err(mdev, "Error deregistering MR. The system may have become unstable.");
252+
#endif /* WITHOUT_ORACLE_EXTENSIONS */
243253
iounmap(mdev->uar_map);
244254
mlx4_uar_free(dev, &mdev->priv_uar);
245255
mlx4_pd_free(dev, mdev->priv_pdn);
@@ -337,7 +347,12 @@ static void *mlx4_en_add(struct mlx4_dev *dev)
337347
return mdev;
338348

339349
err_mr:
350+
#ifdef WITHOUT_ORACLE_EXTENSIONS
340351
(void) mlx4_mr_free(dev, &mdev->mr);
352+
#else
353+
if (mlx4_mr_free(dev, &mdev->mr))
354+
mlx4_err(mdev, "Error deregistering MR. The system may have become unstable.");
355+
#endif /* WITHOUT_ORACLE_EXTENSIONS */
341356
err_map:
342357
if (mdev->uar_map)
343358
iounmap(mdev->uar_map);

0 commit comments

Comments
 (0)