All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 net-next] bridge: Add fdb dst check during fdb update
@ 2013-04-14 19:43 roopa
  2013-04-19 20:51 ` David Miller
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: roopa @ 2013-04-14 19:43 UTC (permalink / raw)
  To: davem, stephen, netdev, roopa; +Cc: nolan, shm, wkok

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(-)

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);
 	}
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 net-next] bridge: Add fdb dst check during fdb update
  2013-04-14 19:43 [PATCH v2 net-next] bridge: Add fdb dst check during fdb update roopa
@ 2013-04-19 20:51 ` David Miller
  2013-04-22 20:12 ` David Miller
  2013-04-22 22:56 ` [PATCH v3 " Stephen Hemminger
  2 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2013-04-19 20:51 UTC (permalink / raw)
  To: roopa; +Cc: stephen, netdev, nolan, shm, wkok

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 net-next] bridge: Add fdb dst check during fdb update
  2013-04-14 19:43 [PATCH v2 net-next] bridge: Add fdb dst check during fdb update roopa
  2013-04-19 20:51 ` David Miller
@ 2013-04-22 20:12 ` David Miller
  2013-04-22 22:56 ` [PATCH v3 " Stephen Hemminger
  2 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2013-04-22 20:12 UTC (permalink / raw)
  To: roopa; +Cc: stephen, netdev, nolan, shm, wkok


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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v3 net-next] bridge: Add fdb dst check during fdb update
  2013-04-14 19:43 [PATCH v2 net-next] bridge: Add fdb dst check during fdb update roopa
  2013-04-19 20:51 ` David Miller
  2013-04-22 20:12 ` David Miller
@ 2013-04-22 22:56 ` Stephen Hemminger
  2013-04-29 15:41   ` David Miller
  2 siblings, 1 reply; 5+ messages in thread
From: Stephen Hemminger @ 2013-04-22 22:56 UTC (permalink / raw)
  To: roopa; +Cc: davem, netdev, nolan, shm, wkok

The patch fixes a real oversight in the forwarding database management stuff.

A couple of minor tweaks.
 1. Always update used value but don't change 'updated' value unless changed.
 2. Rename notify flag to modified
 3. Add some whitespace.


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>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

---
 net/bridge/br_fdb.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

--- a/net/bridge/br_fdb.c	2013-03-28 14:26:20.746064670 -0700
+++ b/net/bridge/br_fdb.c	2013-04-22 15:52:24.183494631 -0700
@@ -615,6 +615,7 @@ static int fdb_add_entry(struct net_brid
 	struct net_bridge *br = source->br;
 	struct hlist_head *head = &br->hash[br_mac_hash(addr, vid)];
 	struct net_bridge_fdb_entry *fdb;
+	bool modified = false;
 
 	fdb = fdb_find(head, addr, vid);
 	if (fdb == NULL) {
@@ -624,10 +625,16 @@ static int fdb_add_entry(struct net_brid
 		fdb = fdb_create(head, source, addr, vid);
 		if (!fdb)
 			return -ENOMEM;
-		fdb_notify(br, fdb, RTM_NEWNEIGH);
+
+		modified = true;
 	} else {
 		if (flags & NLM_F_EXCL)
 			return -EEXIST;
+
+		if (fdb->dst != source) {
+			fdb->dst = source;
+			modified = true;
+		}
 	}
 
 	if (fdb_to_nud(fdb) != state) {
@@ -639,7 +646,12 @@ static int fdb_add_entry(struct net_brid
 		} else
 			fdb->is_local = fdb->is_static = 0;
 
-		fdb->updated = fdb->used = jiffies;
+		modified = true;
+	}
+
+	fdb->used = jiffies;
+	if (modified) {
+		fdb->updated = jiffies;
 		fdb_notify(br, fdb, RTM_NEWNEIGH);
 	}
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3 net-next] bridge: Add fdb dst check during fdb update
  2013-04-22 22:56 ` [PATCH v3 " Stephen Hemminger
@ 2013-04-29 15:41   ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2013-04-29 15:41 UTC (permalink / raw)
  To: stephen; +Cc: roopa, netdev, nolan, shm, wkok

From: Stephen Hemminger <stephen@networkplumber.org>
Date: Mon, 22 Apr 2013 15:56:49 -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>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

Applied.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-04-29 15:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-14 19:43 [PATCH v2 net-next] bridge: Add fdb dst check during fdb update roopa
2013-04-19 20:51 ` David Miller
2013-04-22 20:12 ` David Miller
2013-04-22 22:56 ` [PATCH v3 " Stephen Hemminger
2013-04-29 15:41   ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.