Skip to content

Commit 5bddb28

Browse files
Mukesh KackerJerry Snitselaar
authored andcommitted
mlx4_ib: unmap FMR should update MPT status to 0xF
ConnectX PRM: To unmap the FMR (prior to issuing the SYNC_TPT command), set the status field to 0xF(MLX4_MPT_STATUS_SW). The status is only a part of the byte, and the software is allowed to write zeroes to the rest of the byte (to avoid a read-modify-write operation). Set the status field to 0(MLX4_MPT_STATUS_HW) in free FMR code. Orabug: 18801967 Signed-off-by: Saeed Mahameed <[email protected]> Signed-off-by: Mukesh Kacker <[email protected]> Acked-by: Konrad Rzeszutek Wilk <[email protected]> (cherry picked from commit 1ee0f6d80889fa47c2136654477d14340fa94e72) Signed-off-by: Jerry Snitselaar <[email protected]>
1 parent cb2cb09 commit 5bddb28

File tree

1 file changed

+8
-0
lines changed
  • drivers/net/mlx4

1 file changed

+8
-0
lines changed

drivers/net/mlx4/mr.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,6 +1222,10 @@ void mlx4_fmr_unmap(struct mlx4_dev *dev, struct mlx4_fmr *fmr,
12221222

12231223
fmr->maps = 0;
12241224

1225+
*(u8 *)fmr->mpt = MLX4_MPT_STATUS_SW;
1226+
/* Make sure MPT status is visible */
1227+
wmb();
1228+
12251229
fmr->mr.enabled = MLX4_MR_EN_SW;
12261230
}
12271231
EXPORT_SYMBOL_GPL(mlx4_fmr_unmap);
@@ -1231,6 +1235,10 @@ int mlx4_fmr_free(struct mlx4_dev *dev, struct mlx4_fmr *fmr)
12311235
if (fmr->maps)
12321236
return -EBUSY;
12331237

1238+
*(u8 *)fmr->mpt = MLX4_MPT_STATUS_HW;
1239+
/* Make sure MPT status is visible */
1240+
wmb();
1241+
12341242
mlx4_mr_free(dev, &fmr->mr);
12351243
fmr->mr.enabled = MLX4_MR_DISABLED;
12361244

0 commit comments

Comments
 (0)