diff options
author | Petr Machata <petrm@mellanox.com> | 2018-02-27 14:53:41 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-02-27 14:46:26 -0500 |
commit | 98977089d8eef337608272699f4197c631d447b8 (patch) | |
tree | 2bc657bb6e07303d9a52542ebd525d99b7541298 /drivers/net/ethernet/mellanox/mlxsw/spectrum.c | |
parent | 1da93eb466dc6f8a92e0316fd983ee8a3338db4c (diff) | |
download | lwn-98977089d8eef337608272699f4197c631d447b8.tar.gz lwn-98977089d8eef337608272699f4197c631d447b8.zip |
mlxsw: span: Remove span_entry by span_id
Instead of removing span_entry by the port number, allow removing by
SPAN id. That simplifies some code right here, and for mirroring to soft
netdevices, avoids problems with netdevice pointer invalidation and
reuse.
Rename mlxsw_sp_span_entry_find() to mlxsw_sp_span_entry_find_by_port()
and keep it--follow-up patches will make use of it.
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.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c index bfde93910f82..10bb4891ec31 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c @@ -1273,11 +1273,10 @@ mlxsw_sp_port_add_cls_matchall_mirror(struct mlxsw_sp_port *mlxsw_sp_port, } to_port = netdev_priv(to_dev); - mirror->to_local_port = to_port->local_port; mirror->ingress = ingress; span_type = ingress ? MLXSW_SP_SPAN_INGRESS : MLXSW_SP_SPAN_EGRESS; return mlxsw_sp_span_mirror_add(mlxsw_sp_port, to_port, span_type, - true); + true, &mirror->span_id); } static void @@ -1288,7 +1287,7 @@ mlxsw_sp_port_del_cls_matchall_mirror(struct mlxsw_sp_port *mlxsw_sp_port, span_type = mirror->ingress ? MLXSW_SP_SPAN_INGRESS : MLXSW_SP_SPAN_EGRESS; - mlxsw_sp_span_mirror_del(mlxsw_sp_port, mirror->to_local_port, + mlxsw_sp_span_mirror_del(mlxsw_sp_port, mirror->span_id, span_type, true); } |