All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v3] net: bridge: Fix improper taking over HW learned FDB
@ 2017-04-28 19:39 ` Arkadi Sharshevsky
  0 siblings, 0 replies; 6+ messages in thread
From: Arkadi Sharshevsky @ 2017-04-28 19:39 UTC (permalink / raw)
  To: netdev
  Cc: Ido Schimmel, Nikolay Aleksandrov, bridge, Arkadi Sharshevsky, davem

Commit 7e26bf45e4cb ("net: bridge: allow SW learn to take over HW fdb
entries") added the ability to "take over an entry which was previously
learned via HW when it shows up from a SW port".

However, if an entry was learned via HW and then a control packet
(e.g., ARP request) was trapped to the CPU, the bridge driver will
update the entry and remove the externally learned flag, although the
entry is still present in HW. Instead, only clear the externally learned
flag in case of roaming.

Fixes: 7e26bf45e4cb ("net: bridge: allow SW learn to take over HW fdb entries")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Arkadi Sharashevsky <arkadis@mellanox.com>
Cc: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
---
v1->v2
- net-next rebase.

v2->v3
- remove redundant line.
---
 net/bridge/br_fdb.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index de7988b..ab0c7cc 100644
--- a/net/bridge/br_fdb.c
+++ b/net/bridge/br_fdb.c
@@ -589,16 +589,14 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source,
 			if (unlikely(source != fdb->dst)) {
 				fdb->dst = source;
 				fdb_modified = true;
+				/* Take over HW learned entry */
+				if (unlikely(fdb->added_by_external_learn))
+					fdb->added_by_external_learn = 0;
 			}
 			if (now != fdb->updated)
 				fdb->updated = now;
 			if (unlikely(added_by_user))
 				fdb->added_by_user = 1;
-			/* Take over HW learned entry */
-			if (unlikely(fdb->added_by_external_learn)) {
-				fdb->added_by_external_learn = 0;
-				fdb_modified = true;
-			}
 			if (unlikely(fdb_modified))
 				fdb_notify(br, fdb, RTM_NEWNEIGH);
 		}
-- 
2.4.11

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

* [Bridge] [PATCH net-next v3] net: bridge: Fix improper taking over HW learned FDB
@ 2017-04-28 19:39 ` Arkadi Sharshevsky
  0 siblings, 0 replies; 6+ messages in thread
From: Arkadi Sharshevsky @ 2017-04-28 19:39 UTC (permalink / raw)
  To: netdev
  Cc: Ido Schimmel, Nikolay Aleksandrov, bridge, Arkadi Sharshevsky, davem

Commit 7e26bf45e4cb ("net: bridge: allow SW learn to take over HW fdb
entries") added the ability to "take over an entry which was previously
learned via HW when it shows up from a SW port".

However, if an entry was learned via HW and then a control packet
(e.g., ARP request) was trapped to the CPU, the bridge driver will
update the entry and remove the externally learned flag, although the
entry is still present in HW. Instead, only clear the externally learned
flag in case of roaming.

Fixes: 7e26bf45e4cb ("net: bridge: allow SW learn to take over HW fdb entries")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Arkadi Sharashevsky <arkadis@mellanox.com>
Cc: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
---
v1->v2
- net-next rebase.

v2->v3
- remove redundant line.
---
 net/bridge/br_fdb.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index de7988b..ab0c7cc 100644
--- a/net/bridge/br_fdb.c
+++ b/net/bridge/br_fdb.c
@@ -589,16 +589,14 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source,
 			if (unlikely(source != fdb->dst)) {
 				fdb->dst = source;
 				fdb_modified = true;
+				/* Take over HW learned entry */
+				if (unlikely(fdb->added_by_external_learn))
+					fdb->added_by_external_learn = 0;
 			}
 			if (now != fdb->updated)
 				fdb->updated = now;
 			if (unlikely(added_by_user))
 				fdb->added_by_user = 1;
-			/* Take over HW learned entry */
-			if (unlikely(fdb->added_by_external_learn)) {
-				fdb->added_by_external_learn = 0;
-				fdb_modified = true;
-			}
 			if (unlikely(fdb_modified))
 				fdb_notify(br, fdb, RTM_NEWNEIGH);
 		}
-- 
2.4.11


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

* Re: [PATCH net-next v3] net: bridge: Fix improper taking over HW learned FDB
  2017-04-28 19:39 ` [Bridge] " Arkadi Sharshevsky
@ 2017-04-28 21:33   ` Nikolay Aleksandrov
  -1 siblings, 0 replies; 6+ messages in thread
From: Nikolay Aleksandrov @ 2017-04-28 21:33 UTC (permalink / raw)
  To: Arkadi Sharshevsky, netdev; +Cc: davem, stephen, bridge, Ido Schimmel

On 28/04/17 22:39, Arkadi Sharshevsky wrote:
> Commit 7e26bf45e4cb ("net: bridge: allow SW learn to take over HW fdb
> entries") added the ability to "take over an entry which was previously
> learned via HW when it shows up from a SW port".
> 
> However, if an entry was learned via HW and then a control packet
> (e.g., ARP request) was trapped to the CPU, the bridge driver will
> update the entry and remove the externally learned flag, although the
> entry is still present in HW. Instead, only clear the externally learned
> flag in case of roaming.
> 
> Fixes: 7e26bf45e4cb ("net: bridge: allow SW learn to take over HW fdb entries")
> Signed-off-by: Ido Schimmel <idosch@mellanox.com>
> Signed-off-by: Arkadi Sharashevsky <arkadis@mellanox.com>
> Cc: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
> ---
> v1->v2
> - net-next rebase.
> 
> v2->v3
> - remove redundant line.
> ---
>  net/bridge/br_fdb.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 

Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>

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

* Re: [Bridge] [PATCH net-next v3] net: bridge: Fix improper taking over HW learned FDB
@ 2017-04-28 21:33   ` Nikolay Aleksandrov
  0 siblings, 0 replies; 6+ messages in thread
From: Nikolay Aleksandrov @ 2017-04-28 21:33 UTC (permalink / raw)
  To: Arkadi Sharshevsky, netdev; +Cc: Ido Schimmel, bridge, davem

On 28/04/17 22:39, Arkadi Sharshevsky wrote:
> Commit 7e26bf45e4cb ("net: bridge: allow SW learn to take over HW fdb
> entries") added the ability to "take over an entry which was previously
> learned via HW when it shows up from a SW port".
> 
> However, if an entry was learned via HW and then a control packet
> (e.g., ARP request) was trapped to the CPU, the bridge driver will
> update the entry and remove the externally learned flag, although the
> entry is still present in HW. Instead, only clear the externally learned
> flag in case of roaming.
> 
> Fixes: 7e26bf45e4cb ("net: bridge: allow SW learn to take over HW fdb entries")
> Signed-off-by: Ido Schimmel <idosch@mellanox.com>
> Signed-off-by: Arkadi Sharashevsky <arkadis@mellanox.com>
> Cc: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
> ---
> v1->v2
> - net-next rebase.
> 
> v2->v3
> - remove redundant line.
> ---
>  net/bridge/br_fdb.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 

Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>



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

* Re: [PATCH net-next v3] net: bridge: Fix improper taking over HW learned FDB
  2017-04-28 19:39 ` [Bridge] " Arkadi Sharshevsky
@ 2017-05-01  2:46   ` David Miller
  -1 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2017-05-01  2:46 UTC (permalink / raw)
  To: arkadis; +Cc: netdev, stephen, bridge, idosch, nikolay

From: Arkadi Sharshevsky <arkadis@mellanox.com>
Date: Fri, 28 Apr 2017 22:39:07 +0300

> Commit 7e26bf45e4cb ("net: bridge: allow SW learn to take over HW fdb
> entries") added the ability to "take over an entry which was previously
> learned via HW when it shows up from a SW port".
> 
> However, if an entry was learned via HW and then a control packet
> (e.g., ARP request) was trapped to the CPU, the bridge driver will
> update the entry and remove the externally learned flag, although the
> entry is still present in HW. Instead, only clear the externally learned
> flag in case of roaming.
> 
> Fixes: 7e26bf45e4cb ("net: bridge: allow SW learn to take over HW fdb entries")
> Signed-off-by: Ido Schimmel <idosch@mellanox.com>
> Signed-off-by: Arkadi Sharashevsky <arkadis@mellanox.com>

Applied, thanks.

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

* Re: [Bridge] [PATCH net-next v3] net: bridge: Fix improper taking over HW learned FDB
@ 2017-05-01  2:46   ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2017-05-01  2:46 UTC (permalink / raw)
  To: arkadis; +Cc: netdev, bridge, nikolay, idosch

From: Arkadi Sharshevsky <arkadis@mellanox.com>
Date: Fri, 28 Apr 2017 22:39:07 +0300

> Commit 7e26bf45e4cb ("net: bridge: allow SW learn to take over HW fdb
> entries") added the ability to "take over an entry which was previously
> learned via HW when it shows up from a SW port".
> 
> However, if an entry was learned via HW and then a control packet
> (e.g., ARP request) was trapped to the CPU, the bridge driver will
> update the entry and remove the externally learned flag, although the
> entry is still present in HW. Instead, only clear the externally learned
> flag in case of roaming.
> 
> Fixes: 7e26bf45e4cb ("net: bridge: allow SW learn to take over HW fdb entries")
> Signed-off-by: Ido Schimmel <idosch@mellanox.com>
> Signed-off-by: Arkadi Sharashevsky <arkadis@mellanox.com>

Applied, thanks.

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

end of thread, other threads:[~2017-05-01  2:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-28 19:39 [PATCH net-next v3] net: bridge: Fix improper taking over HW learned FDB Arkadi Sharshevsky
2017-04-28 19:39 ` [Bridge] " Arkadi Sharshevsky
2017-04-28 21:33 ` Nikolay Aleksandrov
2017-04-28 21:33   ` [Bridge] " Nikolay Aleksandrov
2017-05-01  2:46 ` David Miller
2017-05-01  2:46   ` [Bridge] " 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.