Patchwork [v2,net-next] bridge: Add fdb dst check during fdb update

login
register
mail settings
Submitter roopa@cumulusnetworks.com
Date April 14, 2013, 7:43 p.m.
Message ID <1365968593-28725-1-git-send-email-roopa@cumulusnetworks.com>
Download mbox | patch
Permalink /patch/236468/
State Rejected
Delegated to: David Miller
Headers show

Comments

roopa@cumulusnetworks.com - April 14, 2013, 7:43 p.m.
From: roopa <roopa@cumulusnetworks.com>

Current bridge fdb update code does not seem to update the port
during fdb update. This patch adds a check for fdb dst (port)
change during fdb update. Also rearranges the call to
fdb_notify to send only one notification for create and update.

Changelog:
v2 - Change notify flag to bool

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
---
 net/bridge/br_fdb.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
David Miller - April 19, 2013, 8:51 p.m.
From: roopa@cumulusnetworks.com
Date: Sun, 14 Apr 2013 12:43:13 -0700

> From: roopa <roopa@cumulusnetworks.com>
> 
> Current bridge fdb update code does not seem to update the port
> during fdb update. This patch adds a check for fdb dst (port)
> change during fdb update. Also rearranges the call to
> fdb_notify to send only one notification for create and update.
> 
> Changelog:
> v2 - Change notify flag to bool
> 
> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>

This needs review and is just rotting in my patchwork backlog.

Please someone with bridge knowledge take a look at this patch.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - April 22, 2013, 8:12 p.m.
Ok, if nobody with bridgining expertiece can be bothered to review
this I'm simply not going to apply it, it must not be that important.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index c581f12..7a7d920 100644
--- a/net/bridge/br_fdb.c
+++ b/net/bridge/br_fdb.c
@@ -615,6 +615,7 @@  static int fdb_add_entry(struct net_bridge_port *source, const __u8 *addr,
 	struct net_bridge *br = source->br;
 	struct hlist_head *head = &br->hash[br_mac_hash(addr, vid)];
 	struct net_bridge_fdb_entry *fdb;
+	bool notify = false;
 
 	fdb = fdb_find(head, addr, vid);
 	if (fdb == NULL) {
@@ -624,7 +625,7 @@  static int fdb_add_entry(struct net_bridge_port *source, const __u8 *addr,
 		fdb = fdb_create(head, source, addr, vid);
 		if (!fdb)
 			return -ENOMEM;
-		fdb_notify(br, fdb, RTM_NEWNEIGH);
+		notify = true;
 	} else {
 		if (flags & NLM_F_EXCL)
 			return -EEXIST;
@@ -638,7 +639,15 @@  static int fdb_add_entry(struct net_bridge_port *source, const __u8 *addr,
 			fdb->is_static = 1;
 		} else
 			fdb->is_local = fdb->is_static = 0;
+		notify = true;
+	}
+
+	if (fdb->dst != source) {
+		fdb->dst = source;
+		notify = true;
+	}
 
+	if (notify) {
 		fdb->updated = fdb->used = jiffies;
 		fdb_notify(br, fdb, RTM_NEWNEIGH);
 	}