From owner-freebsd-questions@FreeBSD.ORG Thu Jan 15 12:35:16 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59CC71065675; Thu, 15 Jan 2009 12:35:16 +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 040DA8FC14; Thu, 15 Jan 2009 12:35:15 +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=oHoGECQ7wvuNWSIdafIgk7W1Vvvb3P+9xlXERyCHEhSGxkeTo3HTpMBB9GYHb66TgaPsJkDbSEGV9eMeJ6KiaJmWa7B+hqzG+Q9TiAHtr1YIjZaOaNQlM49NE6qp7UjWOvvkeacFxBGpjn+UXWl+8W2VM17/vG7omFzMlwF1Rwk=; Received: from void.codelabs.ru (void.codelabs.ru [144.206.177.25]) by 0.mx.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1LNRRH-000BXA-WF; Thu, 15 Jan 2009 15:35:12 +0300 Date: Thu, 15 Jan 2009 15:35:09 +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> <001701c97702$a301bd90$220f000a@mtl.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <001701c97702$a301bd90$220f000a@mtl.com> Sender: rea-fbsd@codelabs.ru X-Mailman-Approved-At: Thu, 15 Jan 2009 12:38:37 +0000 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-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: rea-fbsd@codelabs.ru List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 12:35:17 -0000 Thu, Jan 15, 2009 at 01:15:53PM +0200, Yony Yossef wrote: > > 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? > > My device has 2 ports, therefore my if_initname is that: > > if_initname(dev, device_get_name(mdev->pdev), > port + 2 * device_get_unit(mdev->pdev)); So, you totally have four network interfaces -- two for each PCI device? > This is what I captured the last time it happened. > > # pciconf -l | grep mtnic > mtnic0@pci0:19:0:0: class=0x020000 card=0x001715b3 chip=0x636815b3 > rev=0xa0 hdr=0x00 > mtnic1@pci0:16:0:0: class=0x020000 card=0x001715b3 chip=0x636815b3 > rev=0xa0 hdr=0x00 > > # kldunload if_mtnic > # kldload if_mtnic > > # pciconf -l | grep mtnic > mtnic1@pci0:19:0:0: class=0x020000 card=0x001715b3 chip=0x636815b3 > rev=0xa0 hdr=0x00 > mtnic0@pci0:16:0:0: class=0x020000 card=0x001715b3 chip=0x636815b3 > rev=0xa0 hdr=0x00 Could you do the following: 1. Boot with verbose kernel mode (push '5' on the boot screen). 2. Kldload your module and provide the full list of kernel messages you will see after this action. 3. Kldunload and again, provide all messages kernel will print for this. 4. Kldload again and supply all messages for the last time. This will show the PCI enumeration sequence and probe order for your driver pci device units. This might shed some light on the problem. Thanks. -- Eygene _ ___ _.--. # \`.|\..----...-'` `-._.-'_.-'` # Remember that it is hard / ' ` , __.--' # to read the on-line manual )/' _/ \ `-_, / # while single-stepping the kernel. `-'" `"\_ ,_.-;_.-\_ ', fsc/as # _.-'_./ {_.' ; / # -- FreeBSD Developers handbook {_.-``-' {_/ #