Re: RFC: if_clone overhaul

From: Brooks Davis (brooks_at_one-eyed-alien.net)
Date: 04/22/04

  • Next message: Lars Eggert: "Re: simulating an LFN over 1Gb LAN Ethernet?"
    Date: Thu, 22 Apr 2004 08:44:51 -0700
    To: Andre Oppermann <andre@freebsd.org>
    
    
    

    On Thu, Apr 22, 2004 at 04:13:40PM +0200, Andre Oppermann wrote:
    > Brooks Davis wrote:
    > >
    > > Please test/review the following patch to the network interface cloneing
    > > code. This code is a major overhaul of the cloning infrastructure.
    > >
    > > The significant include:
    > > - Split the code out into if_clone.[ch].
    > > - Locked struct if_clone. Derived from work by Maurycy
    > > Pawlowski-Wieronski <maurycy at fouk.org>
    > > - Add a per-cloner match function rather then simply matching names of
    > > the form <name><unit> and <name>.
    > > - Use the match function to allow creation of <interface>.<tag>
    > > vlan interfaces. The old way is preserved unchanged!
    > > - Also the match function to allow creation of stf(4) interfaces named
    > > stf0, stf, or 6to4. This is the only major user visiable change in
    > > that "ifconfig stf" creates the interface stf rather then stf0 and
    > > does not print "stf0" to stdout.
    > > - Allow destroy functions to fail so they can refuse to delete
    > > interfaces. Currently, we forbid the deletion of interfaces which
    > > were created in the init function, particularly lo0, pflog0, and
    > > pfsync0. In the case of lo0 this was a panic implemenation so it
    > > does not count as a user visiable change. :-)
    > > - Since most interfaces do not need the new functionality, an family of
    > > wrapper functions, ifc_simple_*(), were created to wrap old style
    > > cloner functions.
    > > - The IF_CLONE_INITIALIZER macro is replaced with a new incompatable
    > > IFC_CLONE_INITALIZER and ifc_simple consumers use IFC_SIMPLE_DECLARE
    > > instead.
    > >
    > > TODO:
    > > - Integrate vlan changes into /etc/rc* (add support for interfaces with
    > > '.' in their name).
    > > - Document new vlan syntax in vlan(4).
    >
    > Looks good and I like it! ;-)
    >
    > Some comments:
    >
    > o in net/if_clone.h you can remove the 3rd Regents copyright clause.
    > o in net/if_clone.c you can remove the 3rd Regents copyright clause.

    Done in perforce.

    > o in net/if_clone.h, is ## really a legal character in variables?
    > Looks strange for sure!

    That's the concatenation operator for cpp macros. While it's not
    stricly necessicary to use a unique variable name per driver since the
    variable is static, it's still a good idea in general. This lets me do
    that (it's also why the input is unquoted).

    >
    > o how far does the cloning code scale? I'm asking because with the
    > work on the l2tp stuff you'll get machines with possibly 10'000
    > or more ppp over l2tp connections acting as LAC.

    The only scaling issue I can think of is that it uses a linearly scanned
    bitmap of units to handle unit allocation. You could presumably
    optimize this into some sort of a tree if you had poor performance and
    sparce allocation. You could also obtain some optimization benefits by
    using longs (native word size ints) instead of chars.

    -- Brooks

    -- 
    Any statement of the form "X is the one, true Y" is FALSE.
    PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4
    
    



  • Next message: Lars Eggert: "Re: simulating an LFN over 1Gb LAN Ethernet?"

    Relevant Pages

    • Re: HEADSUP: OpenBSD dhclient incoming
      ... > From: Brooks Davis ... There are real configurations in which some interfaces are not ... > accepted tool for performing such tasks, but rcordering puts devd after ... > local scripts that duplicate rc.d functionality. ...
      (freebsd-current)
    • Re: dhclient taking all cpu
      ... Brooks Davis wrote: ... >>I've seen it on ath and em interfaces now, but am not sure what's going ... and have no idea how to reproduce the problem. ...
      (freebsd-current)
    • Re: dhclient taking all cpu
      ... Brooks Davis wrote: ... > I've seen it on ath and em interfaces now, but am not sure what's going ... Given the current lack of an existance proof of such servers ...
      (freebsd-current)
    • Re: RFC: if_clone overhaul
      ... > Please test/review the following patch to the network interface cloneing ... This code is a major overhaul of the cloning infrastructure. ... > vlan interfaces. ... or more ppp over l2tp connections acting as LAC. ...
      (freebsd-net)