From: DENG Qingfang <dqfext@gmail.com>
To: netdev@vger.kernel.org
Cc: "Andrew Lunn" <andrew@lunn.ch>,
"Vivien Didelot" <vivien.didelot@gmail.com>,
"Florian Fainelli" <f.fainelli@gmail.com>,
"Roopa Prabhu" <roopa@cumulusnetworks.com>,
bridge@lists.linux-foundation.org,
"Nikolay Aleksandrov" <nikolay@cumulusnetworks.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"David S . Miller" <davem@davemloft.net>,
"René van Dorst" <opensource@vdorst.com>
Subject: [RFC PATCH net-next] net: bridge: fix client roaming from DSA user port
Date: Mon, 20 Apr 2020 00:19:46 +0800 [thread overview]
Message-ID: <20200419161946.19984-1-dqfext@gmail.com> (raw)
When a client roams from a DSA user port to a soft-bridged port (such as WiFi
interface), the left-over MAC entry in the switch HW is not deleted, causing
inconsistency between Linux fdb and the switch MAC table. As a result, the
client cannot talk to other hosts which are on that DSA user port until the
MAC entry expires.
Solve this by notifying switchdev fdb to delete the leftover entry when an
entry is updated. Remove the added_by_user check in DSA
Signed-off-by: DENG Qingfang <dqfext@gmail.com>
---
I tried this on mt7530 and mv88e6xxx, but only mt7530 works.
In previous discussion[1], Andrew Lunn said "try playing with auto learning
for the CPU port" but it didn't work on mv88e6xxx either
I think commit 7e26bf45e4cb ("net: bridge: allow SW learn to take over HW fdb
entries") already tried to fix this issue..
[1] https://lore.kernel.org/netdev/20200405150915.GD161768@lunn.ch/
net/bridge/br_fdb.c | 3 +++
net/dsa/slave.c | 2 --
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index 4877a0db16c6..46003e78f2ac 100644
--- a/net/bridge/br_fdb.c
+++ b/net/bridge/br_fdb.c
@@ -579,6 +579,9 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source,
/* fastpath: update of existing entry */
if (unlikely(source != fdb->dst &&
!test_bit(BR_FDB_STICKY, &fdb->flags))) {
+ /* Remove the entry in HW */
+ br_switchdev_fdb_notify(fdb, RTM_DELNEIGH);
+
fdb->dst = source;
fdb_modified = true;
/* Take over HW learned entry */
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index e94eb1aac602..6133a1be1a74 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -1932,8 +1932,6 @@ static void dsa_slave_switchdev_event_work(struct work_struct *work)
case SWITCHDEV_FDB_DEL_TO_DEVICE:
fdb_info = &switchdev_work->fdb_info;
- if (!fdb_info->added_by_user)
- break;
err = dsa_port_fdb_del(dp, fdb_info->addr, fdb_info->vid);
if (err) {
--
2.26.0
next reply other threads:[~2020-04-19 16:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-19 16:19 DENG Qingfang [this message]
2020-04-19 16:42 ` [RFC PATCH net-next] net: bridge: fix client roaming from DSA user port Andrew Lunn
2020-04-20 4:03 ` DENG Qingfang
2020-04-20 13:31 ` Andrew Lunn
2020-04-22 6:01 ` Chuanhong Guo
2020-04-23 21:36 ` Andrew Lunn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200419161946.19984-1-dqfext@gmail.com \
--to=dqfext@gmail.com \
--cc=andrew@lunn.ch \
--cc=bridge@lists.linux-foundation.org \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nikolay@cumulusnetworks.com \
--cc=opensource@vdorst.com \
--cc=roopa@cumulusnetworks.com \
--cc=vivien.didelot@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).