diff options
author | Roi Dayan <roid@nvidia.com> | 2021-08-15 13:36:01 +0300 |
---|---|---|
committer | Saeed Mahameed <saeedm@nvidia.com> | 2021-10-04 18:10:53 -0700 |
commit | d4f401d9ab189b8283e661e57b1ac148bec147fe (patch) | |
tree | b5c560f4a86dde20038413bf6cbc9b322ee6fbdc /drivers/net/ethernet | |
parent | 9c1d3511a2c2fd30c991a20c670991ece4ef27c1 (diff) | |
download | linux-d4f401d9ab189b8283e661e57b1ac148bec147fe.tar.gz linux-d4f401d9ab189b8283e661e57b1ac148bec147fe.tar.bz2 linux-d4f401d9ab189b8283e661e57b1ac148bec147fe.zip |
net/mlx5e: Move parse fdb check into actions_match_supported_fdb()
The parse fdb/nic actions funcs parse the actions and then call
actions_match_supported() for final check.
Move related check in parse_tc_fdb_actions() into
actions_match_supported_fdb() for more organized code.
Signed-off-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Maor Dickman <maord@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index 24b0c0e3c573..606a7757bb04 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -3175,13 +3175,14 @@ actions_match_supported_fdb(struct mlx5e_priv *priv, struct mlx5e_tc_flow *flow, struct netlink_ext_ack *extack) { + struct mlx5_esw_flow_attr *esw_attr = flow->attr->esw_attr; bool ct_flow, ct_clear; ct_clear = flow->attr->ct_attr.ct_action & TCA_CT_ACT_CLEAR; ct_flow = flow_flag_test(flow, CT) && !ct_clear; - if (flow->attr->esw_attr->split_count && ct_flow && - !MLX5_CAP_GEN(flow->attr->esw_attr->in_mdev, reg_c_preserve)) { + if (esw_attr->split_count && ct_flow && + !MLX5_CAP_GEN(esw_attr->in_mdev, reg_c_preserve)) { /* All registers used by ct are cleared when using * split rules. */ @@ -3189,6 +3190,14 @@ actions_match_supported_fdb(struct mlx5e_priv *priv, return false; } + if (esw_attr->split_count > 0 && !mlx5_esw_has_fwd_fdb(priv->mdev)) { + NL_SET_ERR_MSG_MOD(extack, + "current firmware doesn't support split rule for port mirroring"); + netdev_warn_once(priv->netdev, + "current firmware doesn't support split rule for port mirroring\n"); + return false; + } + return true; } @@ -4108,13 +4117,6 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv, return -EOPNOTSUPP; } - if (esw_attr->split_count > 0 && !mlx5_esw_has_fwd_fdb(priv->mdev)) { - NL_SET_ERR_MSG_MOD(extack, - "current firmware doesn't support split rule for port mirroring"); - netdev_warn_once(priv->netdev, "current firmware doesn't support split rule for port mirroring\n"); - return -EOPNOTSUPP; - } - /* Allocate sample attribute only when there is a sample action and * no errors after parsing. */ |