aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2020-07-14 17:21:00 +0300
committerDavid S. Miller <davem@davemloft.net>2020-07-14 14:50:49 -0700
commita120ecc3c5d8da86aca29f142f92a1547578a7bb (patch)
treedd81306fd02511d70cb19ea4a3e9b8a4134a6acd /drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c
parentmlxsw: spectrum_span: Add support for mirroring towards CPU port (diff)
downloadlinux-dev-a120ecc3c5d8da86aca29f142f92a1547578a7bb.tar.xz
linux-dev-a120ecc3c5d8da86aca29f142f92a1547578a7bb.zip
mlxsw: spectrum_span: Allow passing parameters to SPAN agents
Currently, the only parameter of a SPAN agent is the netdev which the SPAN agent should mirror to. The next patch will add the ability to request a SPAN agent that mirrors to a specific netdev and has a specific policer ID bound to it. This is required when mirroring packets to the CPU port. Therefore, encapsulate the sole parameter to mlxsw_sp_span_agent_get() in a structure, so that it could later be extended with policer information. 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_acl_flex_actions.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c4
1 files changed, 3 insertions, 1 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 73d56012654b..0e32123097d8 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c
@@ -136,11 +136,13 @@ 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_span_agent_parms agent_parms;
struct mlxsw_sp_port *mlxsw_sp_port;
struct mlxsw_sp *mlxsw_sp = priv;
int err;
- err = mlxsw_sp_span_agent_get(mlxsw_sp, out_dev, p_span_id);
+ agent_parms.to_dev = out_dev;
+ err = mlxsw_sp_span_agent_get(mlxsw_sp, p_span_id, &agent_parms);
if (err)
return err;