Skip to content

Commit 9a28271

Browse files
Alexei Lazaropsiff
authored andcommitted
net/mlx5e: Clear Read-Only port buffer size in PBMC before update
[ Upstream commit fd4b97246a23c1149479b88490946bcfbd28de63 ] When updating the PBMC register, we read its current value, modify desired fields, then write it back. The port_buffer_size field within PBMC is Read-Only (RO). If this RO field contains a non-zero value when read, attempting to write it back will cause the entire PBMC register update to fail. This commit ensures port_buffer_size is explicitly cleared to zero after reading the PBMC register but before writing back the modified value. This allows updates to other fields in the PBMC register to succeed. Fixes: 0696d60 ("net/mlx5e: Receive buffer configuration") Signed-off-by: Alexei Lazar <[email protected]> Reviewed-by: Yael Chemla <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Sasha Levin <[email protected]> (cherry picked from commit 4d81205d27c33c251a1d9fee6ea5c4d53af97042)
1 parent fc3733f commit 9a28271

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en/port_buffer.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,9 @@ static int port_set_buffer(struct mlx5e_priv *priv,
331331
if (err)
332332
goto out;
333333

334+
/* RO bits should be set to 0 on write */
335+
MLX5_SET(pbmc_reg, in, port_buffer_size, 0);
336+
334337
err = mlx5e_port_set_pbmc(mdev, in);
335338
out:
336339
kfree(in);

0 commit comments

Comments
 (0)