aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c
diff options
context:
space:
mode:
authorPetr Machata <petrm@mellanox.com>2018-02-27 14:53:47 +0100
committerDavid S. Miller <davem@davemloft.net>2018-02-27 14:46:27 -0500
commit52a6444cda7d1b6fc6f6ff84e2d23cdb71c84102 (patch)
tree6763936da226ab655a63c7b8f78c811c0696140a /drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c
parentmlxsw: Handle config changes pertinent to SPAN (diff)
downloadlinux-dev-52a6444cda7d1b6fc6f6ff84e2d23cdb71c84102.tar.xz
linux-dev-52a6444cda7d1b6fc6f6ff84e2d23cdb71c84102.zip
mlxsw: Move a mirroring check to mlxsw_sp_span_entry_create
The check for whether a mirror port (which is a mlxsw front panel port) belongs to the same mlxsw instance as the mirrored port, is currently only done in spectrum_acl, even though it's applicable for the matchall case as well. Thus move it to mlxsw_sp_span_entry_create(). Signed-off-by: Petr Machata <petrm@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c
index 71102f156a97..57df57c7a405 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c
@@ -164,7 +164,11 @@ mlxsw_sp_span_entry_configure(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_span_parms sparms)
{
if (sparms.dest_port) {
- if (span_entry->ops->configure(span_entry, sparms)) {
+ if (sparms.dest_port->mlxsw_sp != mlxsw_sp) {
+ netdev_err(span_entry->to_dev, "Cannot mirror to %s, which belongs to a different mlxsw instance",
+ sparms.dest_port->dev->name);
+ sparms.dest_port = NULL;
+ } else if (span_entry->ops->configure(span_entry, sparms)) {
netdev_err(span_entry->to_dev, "Failed to offload mirror to %s",
sparms.dest_port->dev->name);
sparms.dest_port = NULL;