From owner-freebsd-net Sat Apr 22 18:45:30 2000 Delivered-To: freebsd-net@freebsd.org Received: from bubba.whistle.com (bubba.whistle.com [207.76.205.7]) by hub.freebsd.org (Postfix) with ESMTP id C8A9E37B8F4; Sat, 22 Apr 2000 18:45:16 -0700 (PDT) (envelope-from archie@whistle.com) Received: (from archie@localhost) by bubba.whistle.com (8.9.3/8.9.2) id SAA17203; Sat, 22 Apr 2000 18:44:35 -0700 (PDT) From: Archie Cobbs Message-Id: <200004230144.SAA17203@bubba.whistle.com> Subject: Re: NETGRAPH in GENERIC? In-Reply-To: <200004211753.KAA84271@gto.networkphysics.com> from Tom Pavel at "Apr 21, 2000 10:53:18 am" To: pavel@NetworkPhysics.COM (Tom Pavel) Date: Sat, 22 Apr 2000 18:44:35 -0700 (PDT) Cc: freebsd-net@FreeBSD.ORG, rwatson@FreeBSD.ORG (Robert Watson), julian@elischer.org X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Tom Pavel writes: > Because the ethernet nodes are only created if /sys/net/if_ethersubr.c > is compiled with -DNETGRAPH, I think the netgraph.ko module is > completely useless and that the netgraph system only works if option > NETGRAPH is in the kernel config. This is essentially what Robert > said, but I may be overstating the point (for example, if one is only > interested in serial-line netgraph uses without ethernet). netgraph.ko is not completely useless -- it's only useless for the ng_ether node type. Other node types work fine even if you didn't compile the kernel with -DNETGRAPH. The netgraph.ko gets loaded dynamically and everthing more or less works. The reason net/if_ethersubr.c has #ifdef NETGRAPH everywhere is so that the base netgraph code would not always be required in the kernel, i.e., it could be made into the KLD netgraph.ko and the netgraphobic could keep it out of their kernels. There are two possible resolutions to this situation.. 1. Extract the netgraph code out of net/if_ethersubr.c and build a separate ng_ether.ko netgraph KLD. Add hooks in net/if_ethersubr.c to call the netgraph stuff through function pointers that get set by the KLD when it loads.. similar to the way ipfw.ko works. 2. Always compile the base netgraph.ko module into the kernel Option #1 would be best because option #2, even though the base netgraph code is small, would be bad for things like PicoBSD. Maybe I'll work on #1.. it shouldn't be too hard. > I propose, however, that having "KMODDEPS=netgraph" in all of the > /sys/modules/netgraph/*/Makefile is a mistake, and should be removed. > This causes the problem with double copies of the netgraph base code > that I reported in the Mar.19 posting cited above, which makes > netgraph streams completely fail. I've tested netgraph modules > without the dependency, and they work fine for me (with option > NETGRAPH and NETGRAPH_SOCKET compiled into my kernel). No, KMODDEPS=netgraph is correct and required -- the real problem is in the module mechanism, in that it doesn't properly detect that the netgraph module is already part of the kernel and loads it again via the KLD. Semi-related PR's: kern/17393 kern/11928 kern/17751 kern/11919 -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message