Skip to content

Commit

Permalink
net: dsa: be louder when a non-legacy FDB operation fails
Browse files Browse the repository at this point in the history
The dev_close() call was added in commit c9eb3e0 ("net: dsa: Add
support for learning FDB through notification") "to indicate inconsistent
situation" when we could not delete an FDB entry from the port.

bridge fdb del d8:58:d7:00:ca:6d dev swp0 self master

It is a bit drastic and at the same time not helpful if the above fails
to only print with netdev_dbg log level, but on the other hand to bring
the interface down.

So increase the verbosity of the error message, and drop dev_close().

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Vladimir Oltean authored and Jakub Kicinski committed Jan 7, 2021
1 parent 90dc8fd commit 2fd1865
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions net/dsa/slave.c
Original file line number Diff line number Diff line change
Expand Up @@ -2072,7 +2072,9 @@ static void dsa_slave_switchdev_event_work(struct work_struct *work)

err = dsa_port_fdb_add(dp, fdb_info->addr, fdb_info->vid);
if (err) {
netdev_dbg(dev, "fdb add failed err=%d\n", err);
netdev_err(dev,
"failed to add %pM vid %d to fdb: %d\n",
fdb_info->addr, fdb_info->vid, err);
break;
}
fdb_info->offloaded = true;
Expand All @@ -2087,9 +2089,11 @@ static void dsa_slave_switchdev_event_work(struct work_struct *work)

err = dsa_port_fdb_del(dp, fdb_info->addr, fdb_info->vid);
if (err) {
netdev_dbg(dev, "fdb del failed err=%d\n", err);
dev_close(dev);
netdev_err(dev,
"failed to delete %pM vid %d from fdb: %d\n",
fdb_info->addr, fdb_info->vid, err);
}

break;
}
rtnl_unlock();
Expand Down

0 comments on commit 2fd1865

Please sign in to comment.