[Bridge] Re: [PATCH] (1/4) propgate bridge internal MTU changes

Stephen Hemminger shemminger at osdl.org
Thu Jul 29 10:59:31 PDT 2004


Follow up to earlier RCU patch.  Since now using RCU, need to use
deferred free.  

Signed-off-by: Stephen Hemminger <shemminger at osdl.org>

diff -Nru a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
--- a/net/bridge/br_fdb.c	2004-07-29 11:00:07 -07:00
+++ b/net/bridge/br_fdb.c	2004-07-29 11:00:07 -07:00
@@ -217,11 +217,18 @@
 	return fdb;
 }
 
+static void fdb_rcu_free(struct rcu_head *head)
+{
+	struct net_bridge_fdb_entry *ent
+		= container_of(head, struct net_bridge_fdb_entry, rcu);
+	kmem_cache_free(br_fdb_cache, ent);
+}
 
+/* Set entry up for deletion with RCU  */
 void br_fdb_put(struct net_bridge_fdb_entry *ent)
 {
 	if (atomic_dec_and_test(&ent->use_count))
-		kmem_cache_free(br_fdb_cache, ent);
+		call_rcu(&ent->rcu, fdb_rcu_free);
 }
 
 /*
diff -Nru a/net/bridge/br_private.h b/net/bridge/br_private.h
--- a/net/bridge/br_private.h	2004-07-29 11:00:07 -07:00
+++ b/net/bridge/br_private.h	2004-07-29 11:00:07 -07:00
@@ -46,7 +46,10 @@
 {
 	struct hlist_node		hlist;
 	struct net_bridge_port		*dst;
-	struct list_head		age_list;
+	union {
+		struct list_head	age_list;
+		struct rcu_head		rcu;
+	};
 	atomic_t			use_count;
 	unsigned long			ageing_timer;
 	mac_addr			addr;



More information about the Bridge mailing list