summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2020-07-14 17:21:01 +0300
committerDavid S. Miller <davem@davemloft.net>2020-07-15 00:50:49 +0300
commit4039504e6a0c1abdbbabb4693e5e251c55009f21 (patch)
treed8b04ff4b0161f16cd5f9078cb78c9180042de33 /drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c
parenta120ecc3c5d8da86aca29f142f92a1547578a7bb (diff)
downloadlinux-4039504e6a0c1abdbbabb4693e5e251c55009f21.tar.xz
mlxsw: spectrum_span: Allow setting policer on a SPAN agent
When mirroring packets to the CPU port the mirrored packets are trapped to the CPU. However, unlike other traps, it is not possible to set a policer on the associated trap group. Instead, the policer needs to be set on the SPAN agent. Moreover, the policer ID must be within a specified range: From a configurable (even) base ID to this base plus the maximum number of SPAN agents. While the immediate use case is to set the policer on a SPAN agent that mirrors to the CPU port, a policer can be set on any SPAN agent. Therefore, the operation is implemented for all SPAN agent types. Extend the SPAN agent request API to allow passing the desired policer ID that should be bound to the SPAN agent. Return an error for Spectrum-1, as it does not support policer setting on a SPAN agent. Reviewed-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Petr Machata <petrm@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c
index ab4ec44b566a..f30599ad6019 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c
@@ -27,7 +27,7 @@ mlxsw_sp_mall_port_mirror_add(struct mlxsw_sp_port *mlxsw_sp_port,
struct mlxsw_sp_mall_entry *mall_entry)
{
struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp;
- struct mlxsw_sp_span_agent_parms agent_parms;
+ struct mlxsw_sp_span_agent_parms agent_parms = {};
struct mlxsw_sp_span_trigger_parms parms;
enum mlxsw_sp_span_trigger trigger;
int err;