From: Stephen Hemminger <shemminger@osdl.org>
To: Linus Torvalds <torvalds@transmeta.com>, David Miller <davem@redhat.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-net@vger.kernel.org
Subject: [PATCH] (4/8) Eliminate brlock in net/bridge
Date: 11 Mar 2003 16:14:51 -0800 [thread overview]
Message-ID: <1047428091.15874.103.camel@dell_ss3.pdx.osdl.net> (raw)
In-Reply-To: <Pine.LNX.4.44.0303091831560.2129-100000@home.transmeta.com>
Eliminate brlock in bridge code.
diff -urN -X dontdiff linux-2.5.64/net/bridge/br.c linux-2.5-nobrlock/net/bridge/br.c
--- linux-2.5.64/net/bridge/br.c 2003-03-11 09:08:01.000000000 -0800
+++ linux-2.5-nobrlock/net/bridge/br.c 2003-03-10 15:49:15.000000000 -0800
@@ -21,7 +21,6 @@
#include <linux/etherdevice.h>
#include <linux/init.h>
#include <linux/if_bridge.h>
-#include <linux/brlock.h>
#include <asm/uaccess.h>
#include "br_private.h"
@@ -73,14 +72,15 @@
unregister_netdevice_notifier(&br_device_notifier);
br_call_ioctl_atomic(__br_clear_ioctl_hook);
- br_write_lock_bh(BR_NETPROTO_LOCK);
br_handle_frame_hook = NULL;
- br_write_unlock_bh(BR_NETPROTO_LOCK);
#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE)
br_fdb_get_hook = NULL;
br_fdb_put_hook = NULL;
#endif
+
+ /* netif_receive_skb uses RCU */
+ synchronize_kernel();
}
EXPORT_SYMBOL(br_should_route_hook);
diff -urN -X dontdiff linux-2.5.64/net/bridge/br_if.c linux-2.5-nobrlock/net/bridge/br_if.c
--- linux-2.5.64/net/bridge/br_if.c 2003-03-11 09:08:01.000000000 -0800
+++ linux-2.5-nobrlock/net/bridge/br_if.c 2003-03-10 15:50:54.000000000 -0800
@@ -18,7 +18,6 @@
#include <linux/if_bridge.h>
#include <linux/inetdevice.h>
#include <linux/rtnetlink.h>
-#include <linux/brlock.h>
#include <asm/uaccess.h>
#include "br_private.h"
@@ -87,12 +86,11 @@
static void del_ifs(struct net_bridge *br)
{
- br_write_lock_bh(BR_NETPROTO_LOCK);
write_lock(&br->lock);
while (br->port_list != NULL)
__br_del_if(br, br->port_list->dev);
write_unlock(&br->lock);
- br_write_unlock_bh(BR_NETPROTO_LOCK);
+ synchronize_kernel();
}
static struct net_bridge *new_nb(char *name)
@@ -257,13 +255,12 @@
{
int retval;
- br_write_lock_bh(BR_NETPROTO_LOCK);
write_lock(&br->lock);
retval = __br_del_if(br, dev);
br_stp_recalculate_bridge_id(br);
write_unlock(&br->lock);
- br_write_unlock_bh(BR_NETPROTO_LOCK);
+ synchronize_kernel();
return retval;
}
diff -urN -X dontdiff linux-2.5.64/net/bridge/netfilter/ebtable_broute.c linux-2.5-nobrlock/net/bridge/netfilter/ebtable_broute.c
--- linux-2.5.64/net/bridge/netfilter/ebtable_broute.c 2003-03-11 09:08:01.000000000 -0800
+++ linux-2.5-nobrlock/net/bridge/netfilter/ebtable_broute.c 2003-03-11 15:04:04.000000000 -0800
@@ -14,7 +14,6 @@
#include <linux/netfilter_bridge/ebtables.h>
#include <linux/module.h>
#include <linux/if_bridge.h>
-#include <linux/brlock.h>
// EBT_ACCEPT means the frame will be bridged
// EBT_DROP means the frame will be routed
@@ -68,18 +67,17 @@
ret = ebt_register_table(&broute_table);
if (ret < 0)
return ret;
- br_write_lock_bh(BR_NETPROTO_LOCK);
// see br_input.c
br_should_route_hook = ebt_broute;
- br_write_unlock_bh(BR_NETPROTO_LOCK);
+ synchronize_kernel();
+
return ret;
}
static void __exit fini(void)
{
- br_write_lock_bh(BR_NETPROTO_LOCK);
br_should_route_hook = NULL;
- br_write_unlock_bh(BR_NETPROTO_LOCK);
+ synchronize_kernel();
ebt_unregister_table(&broute_table);
}
next prev parent reply other threads:[~2003-03-12 0:09 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-09 23:44 [PATCH] small fixes in brlock.h Zwane Mwaikambo
2003-03-10 0:00 ` Robert Love
2003-03-10 0:03 ` Zwane Mwaikambo
2003-03-10 0:10 ` Robert Love
2003-03-10 1:11 ` Zwane Mwaikambo
2003-03-10 0:15 ` Robert Love
2003-03-10 2:33 ` Linus Torvalds
2003-03-10 21:54 ` Roman Zippel
2003-03-12 0:13 ` [PATCH] (0/8) replace brlock with RCU Stephen Hemminger
2003-03-12 0:23 ` Linus Torvalds
2003-03-12 0:28 ` David S. Miller
2003-03-12 1:36 ` Roman Zippel
2003-03-12 0:14 ` [PATCH] (1/8) Eliminate brlock in psnap Stephen Hemminger
2003-03-12 1:03 ` Roman Zippel
2003-03-12 1:13 ` Zwane Mwaikambo
2003-03-12 0:14 ` [PATCH] (2/8) Eliminate brlock for packet_type Stephen Hemminger
2003-03-12 0:20 ` David S. Miller
2003-03-12 0:25 ` Stephen Hemminger
2003-03-12 0:14 ` [PATCH] (3/8) Eliminate brlock from vlan Stephen Hemminger
2003-03-12 0:14 ` Stephen Hemminger [this message]
2003-03-12 0:14 ` [PATCH] (5/8) Eliminate brlock from netfilter Stephen Hemminger
2003-03-12 1:25 ` Zwane Mwaikambo
2003-03-12 0:15 ` [PATCH] (6/8) Eliminate brlock from ipv4 Stephen Hemminger
2003-03-12 0:15 ` [PATCH] (7/8) Eliminate brlock from IPV6 Stephen Hemminger
2003-03-12 0:15 ` [PATCH] (8/8) Kill brlock Stephen Hemminger
2003-03-12 0:23 ` David S. Miller
2003-03-12 0:31 ` Stephen Hemminger
2003-03-12 0:34 ` David S. Miller
2003-03-12 0:44 ` Linus Torvalds
2003-03-12 0:48 ` Stephen Hemminger
2003-03-12 2:31 ` Alan Cox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1047428091.15874.103.camel@dell_ss3.pdx.osdl.net \
--to=shemminger@osdl.org \
--cc=davem@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-net@vger.kernel.org \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®