Commit 49fdbd23 authored by Aya Levin's avatar Aya Levin Committed by Jakub Kicinski

net/mlx5e: Add listener to DMAC filter trap event

Add support for trapping packets which didn't match any DMAC in the MAC
table. Add a listener which adds/removes MAC trap rule in the flow
steering according to the trap's action trap/drop.
Signed-off-by: default avatarAya Levin <ayal@nvidia.com>
Reviewed-by: default avatarMoshe Shemesh <moshe@nvidia.com>
Reviewed-by: default avatarTariq Toukan <tariqt@nvidia.com>
Signed-off-by: default avatarTariq Toukan <tariqt@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 70038b73
...@@ -360,6 +360,11 @@ static int mlx5e_handle_action_trap(struct mlx5e_priv *priv, int trap_id) ...@@ -360,6 +360,11 @@ static int mlx5e_handle_action_trap(struct mlx5e_priv *priv, int trap_id)
if (err) if (err)
goto err_out; goto err_out;
break; break;
case DEVLINK_TRAP_GENERIC_ID_DMAC_FILTER:
err = mlx5e_add_mac_trap(priv, trap_id, mlx5e_trap_get_tirn(priv->en_trap));
if (err)
goto err_out;
break;
default: default:
netdev_warn(priv->netdev, "%s: Unknown trap id %d\n", __func__, trap_id); netdev_warn(priv->netdev, "%s: Unknown trap id %d\n", __func__, trap_id);
err = -EINVAL; err = -EINVAL;
...@@ -379,6 +384,9 @@ static int mlx5e_handle_action_drop(struct mlx5e_priv *priv, int trap_id) ...@@ -379,6 +384,9 @@ static int mlx5e_handle_action_drop(struct mlx5e_priv *priv, int trap_id)
case DEVLINK_TRAP_GENERIC_ID_INGRESS_VLAN_FILTER: case DEVLINK_TRAP_GENERIC_ID_INGRESS_VLAN_FILTER:
mlx5e_remove_vlan_trap(priv); mlx5e_remove_vlan_trap(priv);
break; break;
case DEVLINK_TRAP_GENERIC_ID_DMAC_FILTER:
mlx5e_remove_mac_trap(priv);
break;
default: default:
netdev_warn(priv->netdev, "%s: Unknown trap id %d\n", __func__, trap_id); netdev_warn(priv->netdev, "%s: Unknown trap id %d\n", __func__, trap_id);
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment