From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753023AbZH1UAF (ORCPT ); Fri, 28 Aug 2009 16:00:05 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752672AbZH1UAE (ORCPT ); Fri, 28 Aug 2009 16:00:04 -0400 Received: from sous-sol.org ([216.99.217.87]:42149 "EHLO sequoia.sous-sol.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752122AbZH1UAD (ORCPT ); Fri, 28 Aug 2009 16:00:03 -0400 Date: Fri, 28 Aug 2009 12:58:23 -0700 From: Chris Wright To: Greg KH Cc: Chris Wright , Jesse Barnes , Ivan Kokshaysky , Matthew Wilcox , Linus Torvalds , Yu Zhao , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, stable@kernel.org Subject: Re: [PATCH] SR-IOV: correct broken resource alignment calculations Message-ID: <20090828195823.GJ10360@sequoia.sous-sol.org> References: <20090828191714.GI10360@sequoia.sous-sol.org> <20090828194338.GB16479@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090828194338.GB16479@kroah.com> User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Greg KH (greg@kroah.com) wrote: > On Fri, Aug 28, 2009 at 12:17:14PM -0700, Chris Wright wrote: > > An SR-IOV capable device includes an SR-IOV PCIe capability which > > describes the Virtual Function (VF) BAR requirements. A typical SR-IOV > > device can support multiple VFs whose BARs must be in a contiguous region, > > effectively an array of VF BARs. The BAR reports the size requirement > > for a single VF. We calculate the full range needed by simply multiplying > > the VF BAR size with the number of possible VFs and create a resource > > spanning the full range. > > > > This all seems sane enough except it artificially inflates the alignment > > requirement for the VF BAR. The VF BAR need only be aligned to the size > > of a single BAR not the contiguous range of VF BARs. This can cause us > > to fail to allocate resources for the BAR despite the fact that we > > actually have enough space. > > > > This patch adds a support for a new resource alignment type, > > IORESOURCE_VSIZEALIGN, and allows struct resource to keep track of the > > size requirements of a VF BAR which are smaller than the full resource > > size. This could also be done all within the PCI layer w/out bloating > > struct resource or using the last available bit for alignment types. > > > > Comments? > > > > Signed-off-by: Chris Wright > > Cc: Jesse Barnes > > Cc: Ivan Kokshaysky > > Cc: Linus Torvalds > > Cc: Matthew Wilcox > > Cc: Yu Zhao > > Cc: stable@kernel.org > > This is a new feature, which seems to be odd to have it sent to stable > :) Yeah, it's broken now (and shipped in 2.6.30). > Does this fix reported problems in the "wild"? Depending on card firwmware, yeah, I've hit this problem. thanks, -chris