diff options
author | Petr Machata | 2018-02-27 14:53:44 +0100 |
---|---|---|
committer | David S. Miller | 2018-02-27 20:46:27 +0100 |
commit | 079c9f393b8d467995516c4716557373edefaa89 (patch) | |
tree | 35ad523245035f455d476255065d979f02b13efd /drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c | |
parent | mlxsw: spectrum_span: Extract mlxsw_sp_span_entry_{de, }configure() (diff) | |
download | kernel-qcow2-linux-079c9f393b8d467995516c4716557373edefaa89.tar.gz kernel-qcow2-linux-079c9f393b8d467995516c4716557373edefaa89.tar.xz kernel-qcow2-linux-079c9f393b8d467995516c4716557373edefaa89.zip |
mlxsw: spectrum: Keep mirror netdev in mlxsw_sp_span_entry
Currently the only mirror action supported by mlxsw is mirror to another
mlxsw physical port. Correspondingly, span_entry, which tracks each
mlxsw mirror in the system, currently holds a u8 number of the
destination port.
To extend this system to mirror to gretap and ip6gretap netdevices, have
struct mlxsw_sp_span_entry actually hold the destination netdevice
itself.
This change then trickles down in obvious manner to SPAN module API and
mirror-related interfaces in struct mlxsw_afa_ops.
To prevent use of invalid pointer, NETDEV_UNREGISTER needs to be hooked
and the corresponding SPAN entry invalidated.
Signed-off-by: Petr Machata <petrm@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c index b450d3e4a905..510ce48d87f7 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c @@ -126,18 +126,18 @@ mlxsw_sp_act_counter_index_put(void *priv, unsigned int counter_index) } static int -mlxsw_sp_act_mirror_add(void *priv, u8 local_in_port, u8 local_out_port, +mlxsw_sp_act_mirror_add(void *priv, u8 local_in_port, + const struct net_device *out_dev, bool ingress, int *p_span_id) { - struct mlxsw_sp_port *in_port, *out_port; + struct mlxsw_sp_port *in_port; struct mlxsw_sp *mlxsw_sp = priv; enum mlxsw_sp_span_type type; type = ingress ? MLXSW_SP_SPAN_INGRESS : MLXSW_SP_SPAN_EGRESS; - out_port = mlxsw_sp->ports[local_out_port]; in_port = mlxsw_sp->ports[local_in_port]; - return mlxsw_sp_span_mirror_add(in_port, out_port, type, + return mlxsw_sp_span_mirror_add(in_port, out_dev, type, false, p_span_id); } |