Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Tue, 11 Mar 2003 19:07:36 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Tue, 11 Mar 2003 19:07:32 -0500 Received: from air-2.osdl.org ([65.172.181.6]:14218 "EHLO mail.osdl.org") by vger.kernel.org with ESMTP id ; Tue, 11 Mar 2003 19:03:58 -0500 Subject: [PATCH] (2/8) Eliminate brlock for packet_type From: Stephen Hemminger To: Linus Torvalds , David Miller Cc: linux-net@vger.kernel.org, Linux Kernel Mailing List In-Reply-To: References: Content-Type: text/plain Organization: Open Source Devlopment Lab Message-Id: <1047428080.15872.99.camel@dell_ss3.pdx.osdl.net> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 11 Mar 2003 16:14:40 -0800 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1699 Lines: 53 Replace linked list for packet_type with brlock with list macros and RCU. diff -urN -X dontdiff linux-2.5.64/net/8021q/vlan.c linux-2.5-nobrlock/net/8021q/vlan.c --- linux-2.5.64/net/8021q/vlan.c 2003-03-11 09:08:01.000000000 -0800 +++ linux-2.5-nobrlock/net/8021q/vlan.c 2003-03-11 14:31:28.000000000 -0800 @@ -29,7 +29,6 @@ #include #include #include -#include #include #include @@ -68,7 +67,6 @@ .dev =NULL, .func = vlan_skb_recv, /* VLAN receive method */ .data = (void *)(-1), /* Set here '(void *)1' when this code can SHARE SKBs */ - .next = NULL }; /* End of global variables definitions. */ @@ -231,9 +229,10 @@ real_dev->vlan_rx_kill_vid(real_dev, vlan_id); } - br_write_lock(BR_NETPROTO_LOCK); grp->vlan_devices[vlan_id] = NULL; - br_write_unlock(BR_NETPROTO_LOCK); + + /* wait for RCU in network receive */ + synchronize_kernel(); /* Caller unregisters (and if necessary, puts) diff -urN -X dontdiff linux-2.5.64/net/8021q/vlan_dev.c linux-2.5-nobrlock/net/8021q/vlan_dev.c --- linux-2.5.64/net/8021q/vlan_dev.c 2003-03-11 09:08:01.000000000 -0800 +++ linux-2.5-nobrlock/net/8021q/vlan_dev.c 2003-03-10 15:49:52.000000000 -0800 @@ -31,7 +31,6 @@ #include #include #include -#include #include "vlan.h" #include "vlanproc.h" - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/