]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum_span: Do not overwrite policer configuration
authorIdo Schimmel <idosch@nvidia.com>
Thu, 28 Jan 2021 14:48:20 +0000 (16:48 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 28 Jan 2021 21:09:01 +0000 (13:09 -0800)
commitf3e52af00fc6a02d26742b2dc77e6fc088c3a9c8
tree36e1990eeab1372cfcdeb9a3061c56cb0f482484
parentd00c993dacccdc7499f4d5dabc1e5ea921fc232e
mlxsw: spectrum_span: Do not overwrite policer configuration

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: cb24c7173fc8 ("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>
drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h