Re: Information about bridging

Alan Cox (alan@lxorguk.ukuu.org.uk)
Sat, 7 Sep 1996 23:29:12 +0100 (BST)


> Read the sourcecode to figure out how to use it. Thats what I did.
> but I later found that the memory management of the bridging code is not
> right. After some hours your machine will die with exhausted memory.

Try this

Forwarded message:
> From Michael.Leodolter@lab1.psy.univie.ac.at Thu Sep 5 11:10:20 1996
> Sender: michael@lab1.psy.univie.ac.at
> Message-ID: <322EA64F.4A03449@lab1.psy.univie.ac.at>
> Date: Thu, 05 Sep 1996 12:07:11 +0200
> From: Michael Leodolter <Michael.Leodolter@lab1.psy.univie.ac.at>
> Organization: Brain Reserch Lab (BRL) Univ. Vienna
> X-Mailer: Mozilla 3.0b6 (X11; I; Linux 2.0.0 i586)
> MIME-Version: 1.0
> Newsgroups: comp.os.linux.networking,comp.os.linux.development.system
> CC: alan.cox@linux.org, ccurtis@ee.fit.edu
> Subject: BRIDGE-MEMORY-LEAK-FOUND
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
>
> Hi,
>
> I found the memory leak in the bridging code in br_forward().
> br_forward should not lock.
>
> It works for me as a 10/100-bridge on P133 with a ne2000-comp and a
> SMC-9332.
>
>
> -----------------------------------------------------------cut-here---
> --- linux-2.0.16/net/bridge/br.c Fri Jul 19 07:24:05 1996
> +++ linux/net/bridge/br.c Thu Sep 5 11:52:35 1996
> @@ -1137,7 +1137,9 @@
> /* happen in net_bh() in
> dev.c) */
> }
> /* ok, forward this frame... */
> +#if 0 /* ML */ /* is done in dev_queue_xmit */
> skb_device_lock(skb);
> +#endif
> return(br_forward(skb, port));
> default:
> printk(KERN_DEBUG "br_receive_frame: port [%i]
> unknown state [%i]\n",
> ------------------------------------------------------------cut-here---
>
> I hope this was all, (too see it in the kernel),
>
> thanks,
>
> michael
>
>
> --
> --------------------------------------------------------
> - Michael Leodolter Brain Research Lab (BRL) -
> - Inst. of Psychology Univ. of Vienna -
> - EMail: <Michael.Leodolter@univie.ac.at> -
> - or <Michael.Leodolter@lab1.psy.univie.ac.at> -
> - Tel: <+43-222-40103-2436> Fax: <+43-222-406 64 22> -
> --------------------------------------------------------
>

>From snowcrash.cymru.net!alan Thu Sep 5 20:32:47 1996
Return-Path: <snowcrash.cymru.net!alan>
Received: by lightning.swansea.linux.org.uk (Smail3.1.29.1 #2)
id m0uykAP-0005FcC; Thu, 5 Sep 96 20:32 BST
Received: (from alan@localhost) by snowcrash.cymru.net (8.7.1/8.7.1) id LAA13902 for alan@lxorguk.ukuu.org.uk; Thu, 5 Sep 1996 11:43:12 +0100
From: Alan Cox <alan@cymru.net>
Message-Id: <199609051043.LAA13902@snowcrash.cymru.net>
Subject: Re: BRIDGE-MEMORY-LEAK-FOUND (fwd)
To: alan@lxorguk.ukuu.org.uk
Date: Thu, 5 Sep 1996 11:43:08 +0100 (BST)
X-Mailer: ELM [version 2.4 PL24]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Status: RO

Forwarded message:
> From michael@lab1.psy.univie.ac.at Thu Sep 5 11:25:22 1996
> Date: Thu, 5 Sep 1996 12:13:00 +0200 (MET DST)
> From: Michael Leodolter <michael@lab1.psy.univie.ac.at>
> X-Sender: michael@lab2.psy.univie.ac.at
> To: Michael Leodolter <Michael.Leodolter@lab1.psy.univie.ac.at>
> cc: alan.cox@linux.org, ccurtis@ee.fit.edu,
> Ulrich Leodolter <ulrich@lab1.psy.univie.ac.at>
> Subject: Re: BRIDGE-MEMORY-LEAK-FOUND
> In-Reply-To: <322EA64F.4A03449@lab1.psy.univie.ac.at>
> Message-ID: <Pine.LNX.3.93.960905121032.3285A-100000@lab2.psy.univie.ac.at>
> MIME-Version: 1.0
> Content-Type: TEXT/PLAIN; charset=US-ASCII
>
>
>
> On Thu, 5 Sep 1996, Michael Leodolter wrote:
>
> > Hi,
> >
> > I found the memory leak in the bridging code in br_forward().
> > br_forward should not lock.
> It was br_receive_frame() !! should not lock, because br_forward() could
> drop !!
> >
> > It works for me as a 10/100-bridge on P133 with a ne2000-comp and a
> > SMC-9332.
> >
> >
> > -----------------------------------------------------------cut-here---
> > --- linux-2.0.16/net/bridge/br.c Fri Jul 19 07:24:05 1996
> > +++ linux/net/bridge/br.c Thu Sep 5 11:52:35 1996
> > @@ -1137,7 +1137,9 @@
> > /* happen in net_bh() in
> > dev.c) */
> > }
> > /* ok, forward this frame... */
> > +#if 0 /* ML */ /* is done in dev_queue_xmit */
> > skb_device_lock(skb);
> > +#endif
> > return(br_forward(skb, port));
> > default:
> > printk(KERN_DEBUG "br_receive_frame: port [%i]
> > unknown state [%i]\n",
> > ------------------------------------------------------------cut-here---
> >
> > I hope this was all, (too see it in the kernel),
> >
> thanks,
>
> michael
>
> --------------------------------------------------------
> - Michael Leodolter Brain Research Lab (BRL) -
> - Inst. of Psychology Univ. of Vienna -
> - EMail: <Michael.Leodolter@univie.ac.at> -
> - or <Michael.Leodolter@lab1.psy.univie.ac.at> -
> - Tel: <+43-222-40103-2436> Fax: <+43-222-406 64 22> -
> --------------------------------------------------------
>
>
>