From owner-freebsd-net@FreeBSD.ORG Sat Aug 15 15:01:24 2009 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA7CB106568F for ; Sat, 15 Aug 2009 15:01:24 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 4A8818FC15 for ; Sat, 15 Aug 2009 15:01:24 +0000 (UTC) Received: (qmail 96602 invoked from network); 15 Aug 2009 14:12:09 -0000 Received: from localhost (HELO [127.0.0.1]) ([127.0.0.1]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 15 Aug 2009 14:12:09 -0000 Message-ID: <4A86C782.5030808@freebsd.org> Date: Sat, 15 Aug 2009 16:34:42 +0200 From: Andre Oppermann User-Agent: Thunderbird 1.5.0.14 (Windows/20071210) MIME-Version: 1.0 To: d@delphij.net References: <4A83EEA8.5080202@delphij.net> <20090813182918.S93661@maildrop.int.zabbadoz.net> <20090814193303.GA21941@lor.one-eyed-alien.net> <4A8601CE.5030205@delphij.net> In-Reply-To: <4A8601CE.5030205@delphij.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "Li, Qing" , Brooks Davis , freebsd-net@freebsd.org, Qing Li , "Andrey V. Elsukov" , Julian Elischer , "Bjoern A. Zeeb" Subject: Re: [Take 2] Re: RFC: interface description X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Aug 2009 15:01:24 -0000 Xin LI wrote: > Hi, guys, > > Here is a patch that implements the functionality in userland (as > setifdescription/getifdescription functions in libutil); with this I > think we can also provide an option that some kernel feature (like Qing > Li said it might be useful for embedded systems, but of course the > kernel feature would require more careful design) being used without > modifying programs. This version uses if_dname plus if_dunit as > distinguished name, and a Berkeley DB (hash, /etc/ifdescr.db) to store > the information. I don't like this approach. Adding unconditional dependencies to libutil and libbsdxml unnecessarily complicates and bloats up ifconfig, which is a very central utility that resides on every rescue and minimal boot disk. Additionally the DB stored description can easily go out of sync when interface disappear and reappear. On top of that it complicates porting of routing daemons (Quagga suite, OpenBGPD/OSPFD). Having it only for ifconfig but nowhere else is not entirely pointless but seriously reduces its usefulness. IMHO interface description is a very useful feature and it should be stored in the kernel attached to struct ifnet. However it probably should only be a pointer to malloc'ed memory. It is only infrequently accessed and never in a critical code path. A slight disadvantage is either a separate IOCTL to retrieve the description or a little hack to copy it into struct ifnet just when it is retrieved by userspace from the kernel. [Which reminds me that somewhen we need something more flexible than the current routing socket.] -- Andre