blob: f8894899158f3883a02eab40ed7748e39e9c2516 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001From 2fd186501b1cff155cc4a755c210793cfc0dffb5 Mon Sep 17 00:00:00 2001
2From: Vladimir Oltean <vladimir.oltean@nxp.com>
3Date: Wed, 6 Jan 2021 11:51:31 +0200
4Subject: [PATCH] net: dsa: be louder when a non-legacy FDB operation fails
5
6The dev_close() call was added in commit c9eb3e0f8701 ("net: dsa: Add
7support for learning FDB through notification") "to indicate inconsistent
8situation" when we could not delete an FDB entry from the port.
9
10bridge fdb del d8:58:d7:00:ca:6d dev swp0 self master
11
12It is a bit drastic and at the same time not helpful if the above fails
13to only print with netdev_dbg log level, but on the other hand to bring
14the interface down.
15
16So increase the verbosity of the error message, and drop dev_close().
17
18Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
19Reviewed-by: Andrew Lunn <andrew@lunn.ch>
20Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
21Signed-off-by: Jakub Kicinski <kuba@kernel.org>
22---
23 net/dsa/slave.c | 10 +++++++---
24 1 file changed, 7 insertions(+), 3 deletions(-)
25
26--- a/net/dsa/slave.c
27+++ b/net/dsa/slave.c
28@@ -1591,7 +1591,9 @@ static void dsa_slave_switchdev_event_wo
29
30 err = dsa_port_fdb_add(dp, fdb_info->addr, fdb_info->vid);
31 if (err) {
32- netdev_dbg(dev, "fdb add failed err=%d\n", err);
33+ netdev_err(dev,
34+ "failed to add %pM vid %d to fdb: %d\n",
35+ fdb_info->addr, fdb_info->vid, err);
36 break;
37 }
38 fdb_info->offloaded = true;
39@@ -1606,9 +1608,11 @@ static void dsa_slave_switchdev_event_wo
40
41 err = dsa_port_fdb_del(dp, fdb_info->addr, fdb_info->vid);
42 if (err) {
43- netdev_dbg(dev, "fdb del failed err=%d\n", err);
44- dev_close(dev);
45+ netdev_err(dev,
46+ "failed to delete %pM vid %d from fdb: %d\n",
47+ fdb_info->addr, fdb_info->vid, err);
48 }
49+
50 break;
51 }
52 rtnl_unlock();