From owner-freebsd-current@freebsd.org Tue Mar 14 13:31:05 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48567D0BC7C for ; Tue, 14 Mar 2017 13:31:05 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [IPv6:2607:fc50:1000:7400:216:3eff:fe72:314f]) by mx1.freebsd.org (Postfix) with ESMTP id 333D51DB4 for ; Tue, 14 Mar 2017 13:31:05 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from ford.home.vangyzen.net (unknown [76.164.15.242]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 5B90B56575; Tue, 14 Mar 2017 08:31:04 -0500 (CDT) Subject: Re: PCI slot and function number for ARI enabled devices To: Mu Lichao , "freebsd-current@freebsd.org" References: From: Eric van Gyzen Message-ID: Date: Tue, 14 Mar 2017 08:30:56 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Mar 2017 13:31:05 -0000 On 03/14/2017 01:37, Mu Lichao wrote: > Hi, > > I am trying to enable Intel 82599 10GbE SR-IOV VFs on FreeBSD 12-CURRENT, and after enabled, the SR-IOV VFs can be seen by pciconf(1), but can not be seen by lspci(1), which is installed from ports/sysutils/pciutils: > # pciconf -l | tail -2 > ixv0@pci0:1:0:128: class=0x020000 card=0x002a1fc1 chip=0x10ed8086 rev=0x01 hdr=0x00 > ixv1@pci0:1:0:130: class=0x020000 card=0x002a1fc1 chip=0x10ed8086 rev=0x01 hdr=0x00 > > # lspci | grep 82599 > 01:00.0 Ethernet controller: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection (rev 01) > 01:00.1 Ethernet controller: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection (rev 01) > > After some debugging, I found that it is because of ARI. After ARI is enabled, the slot number is always 0 and the function number can be range between 0 and 255 when reading from /dev/pci, and this breaks lspci(1). > > Is it a behavior by design or not? It is by design. See section 6.13 of the PCIe specification. I imagine lspci will need to be fixed. Eric