netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeedm@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Eli Britstein <elibr@mellanox.com>,
	Oz Shlomo <ozsh@mellanox.com>, Roi Dayan <roid@mellanox.com>,
	Saeed Mahameed <saeedm@mellanox.com>
Subject: [net-next 1/9] net/mlx5: Use read-modify-write when changing PCMR register values
Date: Fri, 22 Feb 2019 13:44:18 -0800	[thread overview]
Message-ID: <20190222214426.27833-2-saeedm@mellanox.com> (raw)
In-Reply-To: <20190222214426.27833-1-saeedm@mellanox.com>

From: Eli Britstein <elibr@mellanox.com>

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>
---
 drivers/net/ethernet/mellanox/mlx5/core/port.c | 4 ++++
 1 file changed, 4 insertions(+)

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));
-- 
2.20.1


  reply	other threads:[~2019-02-22 21:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-22 21:44 [pull request][net-next 0/9] Mellanox, mlx5 updates 2019-02-21 Saeed Mahameed
2019-02-22 21:44 ` Saeed Mahameed [this message]
2019-02-22 21:44 ` [net-next 2/9] net/mlx5: Introduce tunnel entropy control in PCMR register Saeed Mahameed
2019-02-22 21:44 ` [net-next 3/9] net/mlx5e: Fix GRE key by controlling port tunnel entropy calculation Saeed Mahameed
2019-02-22 21:44 ` [net-next 4/9] net/mlx5e: Fix warn print in case of TX reporter creation failure Saeed Mahameed
2019-02-22 21:44 ` [net-next 5/9] net/mlx5e: Re-add support for TX timeout when TX reporter is not valid Saeed Mahameed
2019-02-22 21:44 ` [net-next 6/9] net/mlx5e: Fix return status of TX reporter timeout recover Saeed Mahameed
2019-02-22 21:44 ` [net-next 7/9] net/mlx5e: Fix mlx5e_tx_reporter_create return value Saeed Mahameed
2019-02-22 21:44 ` [net-next 8/9] net/mlx5: E-Switch, Add support for VEPA in legacy mode Saeed Mahameed
2019-02-22 21:44 ` [net-next 9/9] net/mlx5: Support ndo bridge_setlink and getlink Saeed Mahameed
2019-02-23 21:56 ` [pull request][net-next 0/9] Mellanox, mlx5 updates 2019-02-21 David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190222214426.27833-2-saeedm@mellanox.com \
    --to=saeedm@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=elibr@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=ozsh@mellanox.com \
    --cc=roid@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).