OSDN Git Service

mlxsw: spectrum_span: Add APIs to bind / unbind a SPAN agent
authorIdo Schimmel <idosch@mellanox.com>
Thu, 30 Apr 2020 17:01:12 +0000 (20:01 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 30 Apr 2020 20:02:32 +0000 (13:02 -0700)
commitc056618c53a771bacf4e077e8be01de4405439ae
tree5e1eba5550b76657aff5c073265c68f754b2015f
parent14366da6b59203ef5fc3cf21660113b60c2f1421
mlxsw: spectrum_span: Add APIs to bind / unbind a SPAN agent

Currently, a SPAN agent can only be bound to a per-port trigger where
the trigger is either an incoming packet (INGRESS) or an outgoing packet
(EGRESS) to / from the port.

A follow-up patch set will introduce the concept of global triggers and
per-{port, TC} enablement. With global triggers, the trigger entry is
only keyed by a trigger and not by a port and a trigger. The trigger can
be, for example, a packet that was early dropped.

While the binding between the SPAN agent and the trigger is performed
only once, the trigger entry needs to be reference counted, as the
trigger can be enabled on multiple ports.

Add APIs to bind / unbind a SPAN agent to a trigger and reference count
the trigger entry in preparation for global triggers.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h