Date: Tue, 19 Jul 2005 14:20:27 GMT From: Brooks Davis <brooks@one-eyed-alien.net> To: freebsd-bugs@FreeBSD.org Subject: Re: kern/83622: [ patch ] add network interfaces labeling support Message-ID: <200507191420.j6JEKRLh023621@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/83622; it has been noted by GNATS. From: Brooks Davis <brooks@one-eyed-alien.net> To: Roman Bogorodskiy <bogorodskiy@gmail.com> Cc: Brooks Davis <brooks@one-eyed-alien.net>, Roman Bogorodskiy <novel@freebsd.org>, FreeBSD-gnats-submit@freebsd.org Subject: Re: kern/83622: [ patch ] add network interfaces labeling support Date: Tue, 19 Jul 2005 07:19:42 -0700 On Tue, Jul 19, 2005 at 02:18:53PM +0400, Roman Bogorodskiy wrote: > Brooks wrote: > > > This seems like an intresting and useful feature. I'd like to see the > > storage malloc'd instead of stuffed in the ifnet. There's no sense > > in using 64 bytes in ever ifnet when I suspect most people won't ever > > use this feature. It would also avoid hardcoding a limit in ifconfig > > (you'll want to restrict overall size, probably to MAX_PHYS). To > > Well, I think 64 bytes is not a big problem (I assume nobody's using > 5.x, 6.x and 7.x on hardware where few kilobytes make sense). Anyway, > I'd be glad to see an example of malloc'ing storage for it. 64 bytes isn't a big deal, but it adds up. You can currently have up to 2^15-1 interfaces and I'd like to eliminate that restriction at some point. Some of the work Sam Leffler is doing and the directions he is pushing the 802.11 code in argue for keeping ifnet from growing too much. I don't mind adding 4-8 bytes for the pointer, but most people either won't use this feature or won't use 64-byte strings so using malloc could save a fair bit of space. Malloc works the same as in userland except that it takes a couple extra arguements and there is no realloc so you have to implement that by hand. See the malloc(9) manpage. Use the M_IFNET malloc type (used in if_alloc in RELENG_6 and HEAD. -- Brooks
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200507191420.j6JEKRLh023621>