Date: Fri, 2 Jun 2000 11:35:36 -0700 (PDT) From: Archie Cobbs <archie@whistle.com> To: julian@elischer.org (Julian Elischer) Cc: freebsd-net@freebsd.org Subject: Re: Patch review request (ng_ether(4)) Message-ID: <200006021835.LAA09339@bubba.whistle.com> In-Reply-To: <3937487C.41C67EA6@elischer.org> from Julian Elischer at "Jun 1, 2000 10:39:08 pm"
next in thread | previous in thread | raw e-mail | index | archive | help
Julian Elischer writes: > Archie Cobbs wrote: > > I'd appreciate any reviews of this patch: > > > > ftp://ftp.whistle.com/pub/archie/misc/NGETHER.patch > > > > What this does is: > > > > - Change the ng_ether(4) netgraph node type to get rid of the > > "divert" and "orphans" hooks, replacing them with these hooks: > > > > "lower" - connection to the raw device > > "upper" - connection to the upper protocol layers > > > > This should allow much more interesting Ethernet operations > > using netgraph, especially things that filter, etc. For example, > > bridging can all be done with a netgraph node. > > > > - Moves all the netgraph-specific functionality out of net/if_ethersubr.c > > and into a new file netgraph/ng_ether.c > > > > - Allows a KLD for ng_ether.ko so your kernel doesn't have to > > be compiled with options NETGRAPH to use it. When loaded, all > > ethernet interfaces become netgraph nodes as well.. including > > PCCARDS inserted later. > > This change removes the ability to only catch packets that are > unknown to the exisiting infrastructure.(i.e. orphans). > So you'd have to write code to do that especially in the netgraph > node.. See below.. > The topography of the new interceptions are interesting and useful, > but I have a couple of concerns. > > 1/ impact. My original design was done as it was, so that in the > case of no netgraph option, the path through the driver would > be unchanged. The new code is implemented so that > under all cases there is an extra test and function call, > as ether_input() calls ether_input2(). I think the impact will be small, pretty much one pointer != NULL test per packet. The fact that ether_input() has been split into ether_input() and ether_input2() should not matter because gcc will optimize away the function call to ether_input2(), because it comes at the very tail end of ether_input(). > 2/ Compatibility.. > because there is no 'orphans' node, pppoe will probably have to > pass packets back to ether_input2() > which will be considerably slower than > what was going on before. On second thought I agree with this. I've added back the divert and orphans hooks with their original functionality (divert is just an alias for lower). As soon as I can access freefall again I'll put up a new patch. -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?200006021835.LAA09339>