Date: Thu, 20 Oct 2005 10:51:00 +0200 From: Ragnar Lonn <raglon@packetfront.com> To: Gleb Smirnoff <glebius@FreeBSD.org> Cc: freebsd-net@FreeBSD.org, yar@FreeBSD.org, ru@FreeBSD.org, Andrew Thompson <thompsa@FreeBSD.org> Subject: Re: vlan patch Message-ID: <43575A74.6090004@packetfront.com> In-Reply-To: <20051020070054.GZ59364@cell.sick.ru> References: <20051019102559.GA45909@heff.fud.org.nz> <20051020070054.GZ59364@cell.sick.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
Gleb Smirnoff wrote: >Although the memory overhead is not noticable on modern i386 and amd64 >PCs I don't think that we should waste so much memory. We should keep >in mind the existence of embedded architectures with little memory. > >In most cases people use 10 - 30 VLANs. I suggest to use a hash, like it >is already done in ng_vlan(4). This hash makes every sixteenth VLAN to fall >into same slot. Since most people allocate VLAN ids contiguously the hash >distribution should be good. > >Moreover, I suggest Yar and Ruslan to work together and make the hash code >shared between vlan(4) and ng_vlan(4), not copy-and-pasted. > > It looks as if ng_vlan implements a standard hash. Wouldn't a hashtree be a good compromise between speed and memory usage? Of course, a 16-slot hash is a lot better than no hash at all :-) /Ragnar
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43575A74.6090004>