From owner-freebsd-net@FreeBSD.ORG Thu Jan 15 10:01:20 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 0748A106564A for ; Thu, 15 Jan 2009 10:01:20 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) Received: from 0.mx.codelabs.ru (0.mx.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id A6DC08FC12 for ; Thu, 15 Jan 2009 10:01:19 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) DomainKey-Signature: a=rsa-sha1; q=dns; c=simple; s=one; d=codelabs.ru; h=Received:Date:From:To:Cc:Subject:Message-ID:Reply-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:Sender; b=Z1a4lDAPEodKGgCjXjEL3mgBSq2afh3PRuHPXUaoCeCn5MfNAvLZ6YppSXaaMUjKcesx1TJBdPiVGWDNi4V12R6Tiw+mfLAVrOl03xlJar9MypVGrG0Ds4AWuBeUJE8kbh+uqtzoLpETHxE/JHQ/psCSocq0HKac0K64cUpCtfc=; Received: from void.codelabs.ru (void.codelabs.ru [144.206.177.25]) by 0.mx.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1LNP2I-000OVF-DL; Thu, 15 Jan 2009 13:01:14 +0300 Date: Thu, 15 Jan 2009 13:01:12 +0300 From: Eygene Ryabinkin To: Yony Yossef Message-ID: References: <20def4870901140009y1f007108y92797d5f79ffac08@mail.gmail.com> <496E11B7.3010608@sepehrs.com> <000b01c9768e$745aa160$220f000a@mtl.com> <496EF30E.4010304@sepehrs.com> <000c01c976ec$87e040b0$220f000a@mtl.com> <496EF849.7040909@elischer.org> <001501c976f3$5d7a81d0$220f000a@mtl.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <001501c976f3$5d7a81d0$220f000a@mtl.com> Sender: rea-fbsd@codelabs.ru Cc: Liran Liss , freebsd-net@freebsd.org, Oleg Kats , "'H.fazaeli'" , 'Julian Elischer' , Eitan Shefi , freebsd-questions@freebsd.org Subject: Re: howto determine network device unit number? device.hints? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: rea-fbsd@codelabs.ru List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 10:01:20 -0000 Yony, good day. Thu, Jan 15, 2009 at 11:26:34AM +0200, Yony Yossef wrote: > All I'm doing is unloading and reloading the driver. > Unit numbers change and it makes my automatic subnet configuration > (/etc/rc.conf) assign bad IPs. You're using your own driver, aren't you? If yes, could you show your device_method_t structure and the corresponding identify, probe, attach and detach routines? You're setting the unit numbers via 'if_initname(ifp, device_get_name(dev), device_get_unit(dev))' or alike? > I still don't get the reason for this arbitrarily assigned unit numbers and > what is the common solution for it. Except post load rename of the > interfaces. I was under impression that the unit number are coming from the parent busses and they should be stable, at least for the case when the parent bus driver isn't unloaded (and for PCI it should be the case). So, either the driver sets device unit names weirdly or you hit some bug. -- Eygene _ ___ _.--. # \`.|\..----...-'` `-._.-'_.-'` # Remember that it is hard / ' ` , __.--' # to read the on-line manual )/' _/ \ `-_, / # while single-stepping the kernel. `-'" `"\_ ,_.-;_.-\_ ', fsc/as # _.-'_./ {_.' ; / # -- FreeBSD Developers handbook {_.-``-' {_/ #