diff mbox series

[net-next,01/15] net/mlx5: Lag, Update multiport eswitch check to log an error

Message ID 20230204100854.388126-2-saeed@kernel.org (mailing list archive)
State Accepted
Commit 2afcfae77a0798fa0de4e575dc1ab202c153993c
Delegated to: Netdev Maintainers
Headers show
Series [net-next,01/15] net/mlx5: Lag, Update multiport eswitch check to log an error | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Pull request is its own cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 46 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Saeed Mahameed Feb. 4, 2023, 10:08 a.m. UTC
From: Roi Dayan <roid@nvidia.com>

Update the function to log an error to the user if failing to offload
the rule and while there add correct prefix for the function name.

Signed-off-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Maor Dickman <maord@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 .../ethernet/mellanox/mlx5/core/en/tc/act/mirred.c    |  6 +++---
 drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c   | 11 +++++++----
 drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.h   |  4 +++-
 3 files changed, 13 insertions(+), 8 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Feb. 6, 2023, 9:20 a.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (master)
by Saeed Mahameed <saeedm@nvidia.com>:

On Sat,  4 Feb 2023 02:08:40 -0800 you wrote:
> From: Roi Dayan <roid@nvidia.com>
> 
> Update the function to log an error to the user if failing to offload
> the rule and while there add correct prefix for the function name.
> 
> Signed-off-by: Roi Dayan <roid@nvidia.com>
> Reviewed-by: Maor Dickman <maord@nvidia.com>
> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
> 
> [...]

Here is the summary with links:
  - [net-next,01/15] net/mlx5: Lag, Update multiport eswitch check to log an error
    https://git.kernel.org/netdev/net-next/c/2afcfae77a07
  - [net-next,02/15] net/mlx5: Lag, Use mlx5_lag_dev() instead of derefering pointers
    https://git.kernel.org/netdev/net-next/c/9a49a64ea7ed
  - [net-next,03/15] net/mlx5: Lag, Remove redundant bool allocation on the stack
    https://git.kernel.org/netdev/net-next/c/b399b066e27e
  - [net-next,04/15] net/mlx5: Lag, Use flag to check for shared FDB mode
    https://git.kernel.org/netdev/net-next/c/6a80313d24ac
  - [net-next,05/15] net/mlx5: Lag, Move mpesw related definitions to mpesw.h
    https://git.kernel.org/netdev/net-next/c/199abf33f414
  - [net-next,06/15] net/mlx5: Separate mlx5 driver documentation into multiple pages
    https://git.kernel.org/netdev/net-next/c/f2d51e579359
  - [net-next,07/15] net/mlx5: Update Kconfig parameter documentation
    https://git.kernel.org/netdev/net-next/c/a12ba19269d7
  - [net-next,08/15] net/mlx5: Document previously implemented mlx5 tracepoints
    https://git.kernel.org/netdev/net-next/c/e12ebbf0cc55
  - [net-next,09/15] net/mlx5: Add counter information to mlx5 driver documentation
    https://git.kernel.org/netdev/net-next/c/8ce3b586faa4
  - [net-next,10/15] net/mlx5: Document support for RoCE HCA disablement capability
    https://git.kernel.org/netdev/net-next/c/04937a0f6891
  - [net-next,11/15] net/mlx5: Add firmware support for MTUTC scaled_ppm frequency adjustments
    https://git.kernel.org/netdev/net-next/c/b63636b6c170
  - [net-next,12/15] net/mlx5: Enhance debug print in page allocation failure
    https://git.kernel.org/netdev/net-next/c/7eef93003e5d
  - [net-next,13/15] net/mlx5e: IPoIB, Add support for XDR speed
    https://git.kernel.org/netdev/net-next/c/ce231772da8c
  - [net-next,14/15] net/mlx5e: IPsec, support upper protocol selector field offload
    https://git.kernel.org/netdev/net-next/c/a7385187a386
  - [net-next,15/15] net/mlx5e: Trigger NAPI after activating an SQ
    https://git.kernel.org/netdev/net-next/c/79efecb41f58

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/mirred.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/mirred.c
index 78c427b38048..c095a12346de 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/mirred.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/mirred.c
@@ -232,9 +232,9 @@  parse_mirred(struct mlx5e_tc_act_parse_state *parse_state,
 	parse_state->ifindexes[if_count] = out_dev->ifindex;
 	parse_state->if_count++;
 	is_uplink_rep = mlx5e_eswitch_uplink_rep(out_dev);
-	err = mlx5_lag_do_mirred(priv->mdev, out_dev);
-	if (err)
-		return err;
+
+	if (mlx5_lag_mpesw_do_mirred(priv->mdev, out_dev, extack))
+		return -EOPNOTSUPP;
 
 	out_dev = get_fdb_out_dev(uplink_dev, out_dev);
 	if (!out_dev)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c b/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c
index c17e8f1ec914..d2f840812942 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c
@@ -96,17 +96,20 @@  int mlx5_lag_add_mpesw_rule(struct mlx5_core_dev *dev)
 	return mlx5_lag_mpesw_queue_work(dev, MLX5_MPESW_OP_ENABLE);
 }
 
-int mlx5_lag_do_mirred(struct mlx5_core_dev *mdev, struct net_device *out_dev)
+int mlx5_lag_mpesw_do_mirred(struct mlx5_core_dev *mdev,
+			     struct net_device *out_dev,
+			     struct netlink_ext_ack *extack)
 {
 	struct mlx5_lag *ldev = mdev->priv.lag;
 
 	if (!netif_is_bond_master(out_dev) || !ldev)
 		return 0;
 
-	if (ldev->mode == MLX5_LAG_MODE_MPESW)
-		return -EOPNOTSUPP;
+	if (ldev->mode != MLX5_LAG_MODE_MPESW)
+		return 0;
 
-	return 0;
+	NL_SET_ERR_MSG_MOD(extack, "can't forward to bond in mpesw mode");
+	return -EOPNOTSUPP;
 }
 
 bool mlx5_lag_mpesw_is_activated(struct mlx5_core_dev *dev)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.h b/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.h
index 88e8daffcf92..f88dc6ec3de1 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.h
@@ -12,7 +12,9 @@  struct lag_mpesw {
 	atomic_t mpesw_rule_count;
 };
 
-int mlx5_lag_do_mirred(struct mlx5_core_dev *mdev, struct net_device *out_dev);
+int mlx5_lag_mpesw_do_mirred(struct mlx5_core_dev *mdev,
+			     struct net_device *out_dev,
+			     struct netlink_ext_ack *extack);
 bool mlx5_lag_mpesw_is_activated(struct mlx5_core_dev *dev);
 #if IS_ENABLED(CONFIG_MLX5_ESWITCH)
 void mlx5_lag_mpesw_init(struct mlx5_lag *ldev);