From owner-freebsd-net@FreeBSD.ORG Thu Jun 5 23:33:05 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2E3AC37B401 for ; Thu, 5 Jun 2003 23:33:05 -0700 (PDT) Received: from rwcrmhc12.attbi.com (rwcrmhc12.attbi.com [216.148.227.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id AAC2043F3F for ; Thu, 5 Jun 2003 23:33:04 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([12.232.168.4]) by attbi.com (rwcrmhc12) with ESMTP id <2003060606330401400abr2ve>; Fri, 6 Jun 2003 06:33:04 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id XAA16659; Thu, 5 Jun 2003 23:33:03 -0700 (PDT) Date: Thu, 5 Jun 2003 23:33:02 -0700 (PDT) From: Julian Elischer To: Michael Shiu In-Reply-To: <014901c32bc9$4c7a9a30$650019ac@athena> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN Content-Transfer-Encoding: QUOTED-PRINTABLE cc: freebsd-net@freebsd.org Subject: Re: Does Netgraph in FBSD 5.x SMP requires GIANT lock? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2003 06:33:05 -0000 On Fri, 6 Jun 2003, Michael Shiu wrote: > I am using DEVICE_POLLING by Lugzi Rizzo and connecting 2 em devices usin= g > NG_ETHER with NG_BRIDGE. Actually, I am planning to make a netgraph node = to > do some filtering but as a performance prototype, I am getting those resu= lts > mentioned. i.e. >=20 > em0 - NG_ETHER - NG_BRIDGE - NG_ETHER - em1 >=20 > The polling code currently does not work in SMP environments but with som= e > patchwork, I probably can make it work. But I am not clear if the netgrap= h > framework has other limitations. >=20 > rgds, > _Michael >=20 >=20 > ----- Original Message -----=20 > From: "Vincent Jardin" > To: "Julian Elischer" ; "Michael Shiu" > > Cc: > Sent: Friday, June 06, 2003 4:13 AM > Subject: Re: Does Netgraph in FBSD 5.x SMP requires GIANT lock? it should not require Giant. However there are some locking 'holes' that come when locked resources are accessed by external code that is executed from other contexts.. e.g. many drivers do not know about the locks in their netgraph half, and just 'do' what they want. Also there are instances of callout (timeout) code doing things to a node without getting teh node's lock. >=20 >=20 > Maybe one giant2thread node could be introduced into the graphs. It could > put > the messages and the mbufs into a queue from a giant context, then they > could > be processed from a thread. >=20 > Is it a possible architecture or do I forget something ? >=20 > Regards, > Vincent >=20 > Le Jeudi 5 Juin 2003 13:38, Julian Elischer a =E9crit : > > On Thu, 5 Jun 2003, Michael Shiu wrote: > > > Dear all, > > > > > > Just like to know if the netgraph code running 5.x SMP kernel require= s > > > the GIANT lock? > > > > Netgraph has lovking built into it but I have not > > had teh time yet to "thrown the switch" and run it without > > giant. (actually it would only have giant if the edge node that > > introduces the packet has giant, or if it's running > > as a net thread.) > > > > What is your graph like? > > > > > I have the netgraph doing bridging right now but the performance is > > > limited by the CPU (right now, it is something around 100k pkt/s in > > > 4-STABLE). Does adding another CPU together with upgrading to 5.x be = of > > > any help? I guess the bottleneck right now is only one thread is > > > executing in interrupt context with GIANT being held. Am I right? > > > > > > _Michael > > > > > > _______________________________________________ > > > freebsd-net@freebsd.org mailing list > > > http://lists.freebsd.org/mailman/listinfo/freebsd-net > > > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org= " > > > > _______________________________________________ > > freebsd-net@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-net > > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" >=20 >=20 > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" >=20