Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Apr 2000 18:44:35 -0700 (PDT)
From:      Archie Cobbs <archie@whistle.com>
To:        pavel@NetworkPhysics.COM (Tom Pavel)
Cc:        freebsd-net@FreeBSD.ORG, rwatson@FreeBSD.ORG (Robert Watson), julian@elischer.org
Subject:   Re: NETGRAPH in GENERIC?
Message-ID:  <200004230144.SAA17203@bubba.whistle.com>
In-Reply-To: <200004211753.KAA84271@gto.networkphysics.com> from Tom Pavel at "Apr 21, 2000 10:53:18 am"

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200004230144.SAA17203>