Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Oct 2005 10:17:11 -0700
From:      Brooks Davis <brooks@one-eyed-alien.net>
To:        Andrew Thompson <thompsa@freebsd.org>
Cc:        freebsd-net@freebsd.org
Subject:   Re: vlan patch
Message-ID:  <20051019171711.GC20830@odin.ac.hmc.edu>
In-Reply-To: <20051019102559.GA45909@heff.fud.org.nz>
References:  <20051019102559.GA45909@heff.fud.org.nz>

next in thread | previous in thread | raw e-mail | index | archive | help

--qjNfmADvan18RZcF
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Oct 19, 2005 at 11:25:59PM +1300, Andrew Thompson wrote:
> Hi,
>   =20
> It has always bugged me how the vlan code traverses the linked-list for
> each incoming packet to find the right ifvlan, I have this patch which
> attempts to fix this.
>  =20
> What it does is replace the linear search for the vlan with a constant
> time lookup. It does this by allocating an array for each vlan enabled
> parent interface so the tag can be directly indexed.
>  =20
> This has an overhead of ~16kb on 32bit, this is not too bad as there is
> usually only one physical interface when using a large number of vlans.
>  =20
> I have measured a 1.6% pps increase with 100 vlans, and 8% with 500, and
> yes, some people use this many in production.
>  =20
> It also has the benefit of enforcing unique vlan tags per parent which  =
=20
> the current code doesn't do.

I like the idea and had been thinking of doing something similar.  I'm a
bit concerned about cleanup.  It doens't look like the network code
needs to grow the ability to unconfig existing vlans if they are there
during if_detach.  It looks like publishing a pointer to vlan_config is
the thing to do.

It would be best if the new member where added to the end of struct
ifnet to avoid breaking the ABI for now.

We may want to develop some sort of policy around that sort of thing
where we append each time, but mark the correct location for each one
with #ifdef BREAK_IFNET_ABI.  Then when an ABI breaking change has to
happen in current, we resort the structure correctly.

-- Brooks

--=20
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

--qjNfmADvan18RZcF
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFDVn+WXY6L6fI4GtQRAjFHAJ9w/+mD61Qnv7tX1ZasgMUEdfnoawCdHw0f
JRYwRvcEhk3pVFVU0lIVVTM=
=DY0H
-----END PGP SIGNATURE-----

--qjNfmADvan18RZcF--



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