mlxsw: spectrum_span: Do not overwrite policer configuration
authorIdo Schimmel <idosch@nvidia.com>
Thu, 28 Jan 2021 14:48:20 +0000 (16:48 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 7 Feb 2021 14:37:12 +0000 (15:37 +0100)
commita555c2faf02e116a9be2413962114ff548684de5
tree0c87d4e0df4fb0eadc405cce4b1a52a5fb88e0e0
parent3c564a9f9e4378a7c8b18f4281cd42e1665f0aa4
mlxsw: spectrum_span: Do not overwrite policer configuration

commit b6f6881aaf2344bf35a4221810737abe5fd210af upstream.

The purpose of the delayed work in the SPAN module is to potentially
update the destination port and various encapsulation parameters of SPAN
agents that point to a VLAN device or a GRE tap. The destination port
can change following the insertion of a new route, for example.

SPAN agents that point to a physical port or the CPU port are static and
never change throughout the lifetime of the SPAN agent. Therefore, skip
over them in the delayed work.

This fixes an issue where the delayed work overwrites the policer
that was set on a SPAN agent pointing to the CPU. Modifying the delayed
work to inherit the original policer configuration is error-prone, as
the same will be needed for any new parameter.

Fixes: 4039504e6a0c ("mlxsw: spectrum_span: Allow setting policer on a SPAN agent")
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h