Re: [PATCH v5 net-next 1/6] net: bridge: add locked entry fdb flag to extend locked port feature

From
<hidden>
Date
2022-08-29 12:40:16
Also in
bridge, linux-kselftest, linux-mediatek, lkml, netdev
Reply to
Nikolay Aleksandrov, 2022-08-27
On 2022-08-27 13:30, Nikolay Aleksandrov wrote:
quoted
@@ -879,6 +888,10 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source,
 						      &fdb->flags)))
 					clear_bit(BR_FDB_ADDED_BY_EXT_LEARN,
 						  &fdb->flags);
+				if (source->flags & BR_PORT_MAB)
+					set_bit(BR_FDB_ENTRY_LOCKED, &fdb->flags);
+				else
+					clear_bit(BR_FDB_ENTRY_LOCKED, &fdb->flags);
Please add a test for that bit and only then change it.
Something like this?
@@ -749,6 +756,12 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source,
                                                      &fdb->flags)))
                                        
clear_bit(BR_FDB_ADDED_BY_EXT_LEARN,
                                                  &fdb->flags);
+                               if (unlikely(test_bit(BR_FDB_ENTRY_LOCKED, &fdb->flags))) {
+                                       if (!(source->flags & BR_PORT_MAB))
+                                               clear_bit(BR_FDB_ENTRY_LOCKED, &fdb->flags);
+                               } else
+                                       if (source->flags & BR_PORT_MAB)
+                                               set_bit(BR_FDB_ENTRY_LOCKED, &fdb->flags);
                        }

                        if (unlikely(test_bit(BR_FDB_ADDED_BY_USER, &flags)))



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Thread (69 messages) 69 messages, 5 authors, last reply 2022-09-29
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help