Commit 972db38
RDMA/mlx5: Remove the redundant MLX5_IB_STAGE_UAR stage
The MLX5_IB_STAGE_UAR stage in the RDMA driver is redundant and should
be removed.
Responsibility for initializing the device's UAR pointer
(mdev->priv.uar) lies with mlx5_core, which already sets it during the
mlx5_load() process.
At present, the RDMA UAR stage overwrites this pointer, which was
correctly initialized by mlx5_core, creating the risk of inconsistency.
Ownership and management of the UAR pointer should remain exclusively
within mlx5_core.
In the current upstream code, we luckily receive the same pointer, since
mlx5_get_uars_page() still finds available BF registers for that UAR,
allowing it to be shared.
However, future changes in mlx5_core may expose this flaw.
For instance, if mlx5_alloc_bfreg() is invoked twice before the RDMA UAR
stage runs, the RDMA driver may overwrite the UAR allocated by
mlx5_core.
This could lead to real bugs. For example, if mlx5_ib is unloaded
(rmmod), it might free the UAR, leaving mlx5_core with a dangling
reference to an invalid UAR.
Signed-off-by: Yishai Hadas <[email protected]>
Reviewed-by: Fan Li <[email protected]>
Link: https://patch.msgid.link/feaa84ec6f20468b4935c439923e9266122a93d0.1747134130.git.leon@kernel.org
Signed-off-by: Leon Romanovsky <[email protected]>1 parent 21508c8 commit 972db38
2 files changed
+0
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4422 | 4422 | | |
4423 | 4423 | | |
4424 | 4424 | | |
4425 | | - | |
4426 | | - | |
4427 | | - | |
4428 | | - | |
4429 | | - | |
4430 | | - | |
4431 | | - | |
4432 | | - | |
4433 | | - | |
4434 | | - | |
4435 | | - | |
4436 | 4425 | | |
4437 | 4426 | | |
4438 | 4427 | | |
| |||
4662 | 4651 | | |
4663 | 4652 | | |
4664 | 4653 | | |
4665 | | - | |
4666 | | - | |
4667 | | - | |
4668 | 4654 | | |
4669 | 4655 | | |
4670 | 4656 | | |
| |||
4722 | 4708 | | |
4723 | 4709 | | |
4724 | 4710 | | |
4725 | | - | |
4726 | | - | |
4727 | | - | |
4728 | 4711 | | |
4729 | 4712 | | |
4730 | 4713 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1006 | 1006 | | |
1007 | 1007 | | |
1008 | 1008 | | |
1009 | | - | |
1010 | 1009 | | |
1011 | 1010 | | |
1012 | 1011 | | |
| |||
0 commit comments