diff options
author | Eli Britstein <elibr@mellanox.com> | 2019-01-21 09:00:42 +0200 |
---|---|---|
committer | Saeed Mahameed <saeedm@mellanox.com> | 2019-02-22 13:38:23 -0800 |
commit | bfedc645deb7f96303afbdb38a42e2a8f356a5cc (patch) | |
tree | 839b8aaae7e8b81c7d3c608790732c2586c9fe20 /drivers/net/ethernet/mellanox/mlx5 | |
parent | 2fce40a592daa92f1565152cb68d4c4ca7e97d52 (diff) | |
download | linux-bfedc645deb7f96303afbdb38a42e2a8f356a5cc.tar.bz2 |
net/mlx5: Use read-modify-write when changing PCMR register values
Currently changing a PCMR field is done by setting the field in a
zeroed buffer, zeroing other unrelated fields.
Fix this behaviour by modifying only the required field after first
reading the current register values, as a pre-step towards using more
fields in PCMR register.
Signed-off-by: Eli Britstein <elibr@mellanox.com>
Reviewed-by: Oz Shlomo <ozsh@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/port.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/port.c b/drivers/net/ethernet/mellanox/mlx5/core/port.c index b81542820528..55b30d21a73a 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/port.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/port.c @@ -785,7 +785,11 @@ static int mlx5_set_ports_check(struct mlx5_core_dev *mdev, u32 *in, int inlen) int mlx5_set_port_fcs(struct mlx5_core_dev *mdev, u8 enable) { u32 in[MLX5_ST_SZ_DW(pcmr_reg)] = {0}; + int err; + err = mlx5_query_ports_check(mdev, in, sizeof(in)); + if (err) + return err; MLX5_SET(pcmr_reg, in, local_port, 1); MLX5_SET(pcmr_reg, in, fcs_chk, enable); return mlx5_set_ports_check(mdev, in, sizeof(in)); |