Subject: Dynamic registry of ehternet frame types
To: None <tech-kern@NetBSD.ORG>
From: Martin Husemann <martin@duskware.de>
List: tech-kern
Date: 11/12/2003 08:49:33
Hi folks,

apparently there are strange PPPoE implementations out there (I bet you knew
that already). Some use different ethernet frame types.

In userland PPPoE implementations it is easy to change this on the command
line, so I thought we could support that with our in-kernel stuff to. It
is easy to make the frame types configurable via pppoectl - but it has
some impact on the kernel ethernet input path.

Currently there is a big switch statement in ether_input that dispatches
the frame type. Obviously the case labels need to be constant ;-)

For the above application we would need a dynamic registry (a list of
ethernet frame types and callback function to pass the mbuf), which ether_input
would use in the default: case.

This has the additional advantage that it enables LKMs to register and handler
additional ethernet frame types. It would not affect the efficiency of 
hardwired frame types.

Do you think this is worth the effort?

I'm not sure myself, the easy way out is to add a few #ifdefs and handle this
very rare corner case for pppoe with a kernel config option.

Martin