From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Eric Dumazet <edumazet@google.com>
Cc: Saeed Mahameed <saeedm@nvidia.com>,
netdev@vger.kernel.org, Tariq Toukan <tariqt@nvidia.com>,
Shay Drory <shayd@nvidia.com>, Moshe Shemesh <moshe@nvidia.com>
Subject: [net-next 08/14] net/mlx5: Remove redundant cmdif revision check
Date: Mon, 24 Jul 2023 15:44:20 -0700 [thread overview]
Message-ID: <20230724224426.231024-9-saeed@kernel.org> (raw)
In-Reply-To: <20230724224426.231024-1-saeed@kernel.org>
From: Shay Drory <shayd@nvidia.com>
mlx5 is checking the cmdif revision twice, for no reason.
Remove the latter check.
Signed-off-by: Shay Drory <shayd@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
index f175af528fe0..9ced943ebd0d 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
@@ -2191,16 +2191,15 @@ int mlx5_cmd_init(struct mlx5_core_dev *dev)
int align = roundup_pow_of_two(size);
struct mlx5_cmd *cmd = &dev->cmd;
u32 cmd_h, cmd_l;
- u16 cmd_if_rev;
int err;
int i;
memset(cmd, 0, sizeof(*cmd));
- cmd_if_rev = cmdif_rev(dev);
- if (cmd_if_rev != CMD_IF_REV) {
+ cmd->vars.cmdif_rev = cmdif_rev(dev);
+ if (cmd->vars.cmdif_rev != CMD_IF_REV) {
mlx5_core_err(dev,
"Driver cmdif rev(%d) differs from firmware's(%d)\n",
- CMD_IF_REV, cmd_if_rev);
+ CMD_IF_REV, cmd->vars.cmdif_rev);
return -EINVAL;
}
@@ -2233,14 +2232,6 @@ int mlx5_cmd_init(struct mlx5_core_dev *dev)
cmd->vars.max_reg_cmds = (1 << cmd->vars.log_sz) - 1;
cmd->vars.bitmask = (1UL << cmd->vars.max_reg_cmds) - 1;
- cmd->vars.cmdif_rev = ioread32be(&dev->iseg->cmdif_rev_fw_sub) >> 16;
- if (cmd->vars.cmdif_rev > CMD_IF_REV) {
- mlx5_core_err(dev, "driver does not support command interface version. driver %d, firmware %d\n",
- CMD_IF_REV, cmd->vars.cmdif_rev);
- err = -EOPNOTSUPP;
- goto err_free_page;
- }
-
spin_lock_init(&cmd->alloc_lock);
spin_lock_init(&cmd->token_lock);
for (i = 0; i < MLX5_CMD_OP_MAX; i++)
--
2.41.0
next prev parent reply other threads:[~2023-07-24 22:44 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-24 22:44 [pull request][net-next 00/14] mlx5 updates 2023-07-24 Saeed Mahameed
2023-07-24 22:44 ` [net-next 01/14] net/mlx5: Expose port.c/mlx5_query_module_num() function Saeed Mahameed
2023-07-24 22:44 ` [net-next 02/14] net/mlx5: Expose NIC temperature via hardware monitoring kernel API Saeed Mahameed
2023-07-26 3:31 ` Jakub Kicinski
2023-07-26 21:34 ` Saeed Mahameed
2023-07-24 22:44 ` [net-next 03/14] net/mlx5: Use shared code for checking lag is supported Saeed Mahameed
2023-07-24 22:44 ` [net-next 04/14] net/mlx5: Devcom, Infrastructure changes Saeed Mahameed
2023-07-24 22:44 ` [net-next 05/14] net/mlx5e: E-Switch, Register devcom device with switch id key Saeed Mahameed
2023-07-24 22:44 ` [net-next 06/14] net/mlx5e: E-Switch, Allow devcom initialization on more vports Saeed Mahameed
2023-07-24 22:44 ` [net-next 07/14] net/mlx5: Re-organize mlx5_cmd struct Saeed Mahameed
2023-07-24 22:44 ` Saeed Mahameed [this message]
2023-07-24 22:44 ` [net-next 09/14] net/mlx5: split mlx5_cmd_init() to probe and reload routines Saeed Mahameed
2023-07-24 22:44 ` [net-next 10/14] net/mlx5: Allocate command stats with xarray Saeed Mahameed
2023-07-24 22:44 ` [net-next 11/14] net/mlx5e: Remove duplicate code for user flow Saeed Mahameed
2023-07-24 22:44 ` [net-next 12/14] net/mlx5e: Make flow classification filters static Saeed Mahameed
2023-07-24 22:44 ` [net-next 13/14] net/mlx5: Don't check vport->enabled in port ops Saeed Mahameed
2023-07-24 22:44 ` [net-next 14/14] net/mlx5: Remove pointless devlink_rate checks Saeed Mahameed
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=20230724224426.231024-9-saeed@kernel.org \
--to=saeed@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=moshe@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=saeedm@nvidia.com \
--cc=shayd@nvidia.com \
--cc=tariqt@nvidia.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).