Skip to content

Commit fd4b972

Browse files
Alexei Lazarkuba-moo
authored andcommitted
net/mlx5e: Clear Read-Only port buffer size in PBMC before update
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]>
1 parent c8f1313 commit fd4b972

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)