From owner-freebsd-bugs@FreeBSD.ORG Tue Jul 19 14:20:27 2005 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BE9A816A41F for ; Tue, 19 Jul 2005 14:20:27 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 88CD943D46 for ; Tue, 19 Jul 2005 14:20:27 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j6JEKROB023622 for ; Tue, 19 Jul 2005 14:20:27 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j6JEKRLh023621; Tue, 19 Jul 2005 14:20:27 GMT (envelope-from gnats) Date: Tue, 19 Jul 2005 14:20:27 GMT Message-Id: <200507191420.j6JEKRLh023621@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Brooks Davis Cc: Subject: Re: kern/83622: [ patch ] add network interfaces labeling support X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Brooks Davis List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jul 2005 14:20:27 -0000 The following reply was made to PR kern/83622; it has been noted by GNATS. From: Brooks Davis To: Roman Bogorodskiy Cc: Brooks Davis , Roman Bogorodskiy , 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