netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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>,
	Roi Dayan <roid@nvidia.com>, Maor Dickman <maord@nvidia.com>
Subject: [net-next 01/15] net/mlx5: Remove redundant esw multiport validate function
Date: Fri, 19 May 2023 10:55:43 -0700	[thread overview]
Message-ID: <20230519175557.15683-2-saeed@kernel.org> (raw)
In-Reply-To: <20230519175557.15683-1-saeed@kernel.org>

From: Roi Dayan <roid@nvidia.com>

The function didn't validate the value and doesn't require value
validation as it will always be valid true or false values.

Signed-off-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Maor Dickman <maord@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 .../net/ethernet/mellanox/mlx5/core/devlink.c | 23 +------------------
 1 file changed, 1 insertion(+), 22 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/devlink.c b/drivers/net/ethernet/mellanox/mlx5/core/devlink.c
index 4b607785d694..0e07971e024a 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/devlink.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/devlink.c
@@ -464,27 +464,6 @@ static int mlx5_devlink_esw_multiport_get(struct devlink *devlink, u32 id,
 	ctx->val.vbool = mlx5_lag_is_mpesw(dev);
 	return 0;
 }
-
-static int mlx5_devlink_esw_multiport_validate(struct devlink *devlink, u32 id,
-					       union devlink_param_value val,
-					       struct netlink_ext_ack *extack)
-{
-	struct mlx5_core_dev *dev = devlink_priv(devlink);
-
-	if (!MLX5_ESWITCH_MANAGER(dev)) {
-		NL_SET_ERR_MSG_MOD(extack, "E-Switch is unsupported");
-		return -EOPNOTSUPP;
-	}
-
-	if (mlx5_eswitch_mode(dev) != MLX5_ESWITCH_OFFLOADS) {
-		NL_SET_ERR_MSG_MOD(extack,
-				   "E-Switch must be in switchdev mode");
-		return -EBUSY;
-	}
-
-	return 0;
-}
-
 #endif
 
 static int mlx5_devlink_eq_depth_validate(struct devlink *devlink, u32 id,
@@ -563,7 +542,7 @@ static const struct devlink_param mlx5_devlink_params[] = {
 			     BIT(DEVLINK_PARAM_CMODE_RUNTIME),
 			     mlx5_devlink_esw_multiport_get,
 			     mlx5_devlink_esw_multiport_set,
-			     mlx5_devlink_esw_multiport_validate),
+			     NULL),
 #endif
 	DEVLINK_PARAM_GENERIC(IO_EQ_SIZE, BIT(DEVLINK_PARAM_CMODE_DRIVERINIT),
 			      NULL, NULL, mlx5_devlink_eq_depth_validate),
-- 
2.40.1


  reply	other threads:[~2023-05-19 17:56 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-19 17:55 [pull request][net-next 00/15] mlx5 updates 2023-05-19 Saeed Mahameed
2023-05-19 17:55 ` Saeed Mahameed [this message]
2023-05-23  2:20   ` [net-next 01/15] net/mlx5: Remove redundant esw multiport validate function patchwork-bot+netdevbpf
2023-05-19 17:55 ` [net-next 02/15] net/mlx5: E-Switch, Remove redundant check Saeed Mahameed
2023-05-19 17:55 ` [net-next 03/15] net/mlx5e: E-Switch, Remove flow_source check for metadata matching Saeed Mahameed
2023-05-19 17:55 ` [net-next 04/15] net/mlx5e: Remove redundant __func__ arg from fs_err() calls Saeed Mahameed
2023-05-19 17:55 ` [net-next 05/15] net/mlx5e: E-Switch, Update when to set other vport context Saeed Mahameed
2023-05-19 17:55 ` [net-next 06/15] net/mlx5e: E-Switch, Allow get vport api if esw exists Saeed Mahameed
2023-05-19 17:55 ` [net-next 07/15] net/mlx5e: E-Switch, Use metadata for vport matching in send-to-vport rules Saeed Mahameed
2023-05-19 17:55 ` [net-next 08/15] net/mlx5: Remove redundant vport_group_manager cap check Saeed Mahameed
2023-05-19 17:55 ` [net-next 09/15] net/mlx5e: E-Switch, Check device is PF when stopping esw offloads Saeed Mahameed
2023-05-19 17:55 ` [net-next 10/15] net/mlx5e: E-Switch: move debug print of adding mac to correct place Saeed Mahameed
2023-05-19 17:55 ` [net-next 11/15] net/mlx5e: E-Switch, Add a check that log_max_l2_table is valid Saeed Mahameed
2023-05-19 17:55 ` [net-next 12/15] net/mlx5: E-Switch, Use RoCE version 2 for loopback traffic Saeed Mahameed
2023-05-19 17:55 ` [net-next 13/15] net/mlx5: E-Switch, Use metadata matching for RoCE loopback rule Saeed Mahameed
2023-05-19 17:55 ` [net-next 14/15] net/mlx5: devlink, Only show PF related devlink warning when needed Saeed Mahameed
2023-05-19 17:55 ` [net-next 15/15] net/mlx5e: E-Switch, Initialize E-Switch for eswitch manager Saeed Mahameed
2023-05-20  4:46 ` [pull request][net-next 00/15] mlx5 updates 2023-05-19 Jakub Kicinski

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=20230519175557.15683-2-saeed@kernel.org \
    --to=saeed@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=maord@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=roid@nvidia.com \
    --cc=saeedm@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).