From owner-freebsd-current@FreeBSD.ORG Wed May 6 18:58:40 2015 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E252A326; Wed, 6 May 2015 18:58:40 +0000 (UTC) Received: from aussmtpmrkps320.us.dell.com (aussmtpmrkps320.us.dell.com [143.166.224.254]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "ausxipmktps31.us.dell.com", Issuer "Verizon Public SureServer CA G14-SHA1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A9C41E3F; Wed, 6 May 2015 18:58:39 +0000 (UTC) X-Loopcount0: from 64.238.244.148 X-IronPort-AV: E=Sophos;i="5.13,380,1427778000"; d="scan'208";a="269948827" Message-ID: <554A6457.4060702@compellent.com> Date: Wed, 6 May 2015 13:58:31 -0500 From: Eric Badger User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: John Baldwin , Ryan Stone CC: FreeBSD Current Subject: Re: PCI PF memory decode disable when sizing VF BARs References: <11092809.7nmbPfKl0V@ralph.baldwin.cx> <2106775.8KnH0oLhUZ@ralph.baldwin.cx> In-Reply-To: <2106775.8KnH0oLhUZ@ralph.baldwin.cx> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 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: Wed, 06 May 2015 18:58:41 -0000 On 05/06/15 13:33, John Baldwin wrote: > On Wednesday, May 06, 2015 02:24:24 PM Ryan Stone wrote: >> On Wed, May 6, 2015 at 11:45 AM, John Baldwin wrote: >> >>> There are some devices with BARs in non-standard locations. :( If there is >>> a flag to just disable the VF bar decoding, then ideally we should just be >>> doing that and leaving the global decoding flag alone while sizing the VF >>> BAR. >>> >> Disabling SR-IOV BAR decoding in this function is currently redundant, as >> it's already done in pci_iov.c, but I guess to keep the interface sane it >> makes sense to do it here too. Something like this then? > Ah, sorry, I didn't know you did it in the caller already. Perhaps > then something more like your previous patch, but using the test you > added here (PCIR_IS_IOV) instead of your previous check against BAR > values to decide when to frob the command register? > Does the disabling of VF MSE in pci_iov_config actually protect anything else beyond what happens in pci_read_bar? I gave a read through which suggests "no", but I might have missed something. Just thinking that the code would be a bit more hardy if it were done the same way for both VFs and other devices. Eric