967502f022a4e8e3dd2168eeb071384bb29fb091
[openwrt/openwrt.git] / target / linux / generic / backport-5.4 / 771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch
1 From 2fd186501b1cff155cc4a755c210793cfc0dffb5 Mon Sep 17 00:00:00 2001
2 From: Vladimir Oltean <vladimir.oltean@nxp.com>
3 Date: Wed, 6 Jan 2021 11:51:31 +0200
4 Subject: [PATCH] net: dsa: be louder when a non-legacy FDB operation fails
5
6 The dev_close() call was added in commit c9eb3e0f8701 ("net: dsa: Add
7 support for learning FDB through notification") "to indicate inconsistent
8 situation" when we could not delete an FDB entry from the port.
9
10 bridge fdb del d8:58:d7:00:ca:6d dev swp0 self master
11
12 It is a bit drastic and at the same time not helpful if the above fails
13 to only print with netdev_dbg log level, but on the other hand to bring
14 the interface down.
15
16 So increase the verbosity of the error message, and drop dev_close().
17
18 Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
19 Reviewed-by: Andrew Lunn <andrew@lunn.ch>
20 Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
21 Signed-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 @@ -1590,7 +1590,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 @@ -1605,9 +1607,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();