From: Greg KH <gregkh@suse.de>
To: Erez Shitrit <erezsh@mellanox.co.il>
Cc: linux-kernel@vger.kernel.org, linux-pci@atrey.karlin.mff.cuni.cz
Subject: Re: SR-IOV enabling process failed in kernel 2.6.32
Date: Tue, 8 Dec 2009 09:34:16 -0800 [thread overview]
Message-ID: <20091208173416.GA25957@suse.de> (raw)
In-Reply-To: <2ED289D4E09FBD4D92D911E869B97FDD01E6E538@mtlexch01.mtl.com>
On Tue, Dec 08, 2009 at 11:02:22AM +0200, Erez Shitrit wrote:
> Hi Greg,
>
> We are working on InfiniBand device that supports SR-IOV.
> and lately (from version 2.6.32 ) we faced a problem:
> When the driver tried to enable SR-IOV it failed to allocate resources
> for the 2 BARS the device needs.
Hm, you do realize I'm no longer the PCI maintainer, and havn't been for
about 1 1/2 years, right? :)
> The situation is when there are 2 BARS, the first asks for little amount
> of memory and the second asks for much larger memory requirements.
> I saw in the code (drivers/pci/iov.c) that the order of the allocation
> starts from the first BAR to the last
> The code:
> for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) {
> res = iov->res + i;
> if (!res->flags)
> continue;
> rc = pci_assign_resource(dev, i + PCI_IOV_RESOURCES);
>
> This process failed for the second BAR (The big one). (in the log: "not
> enough MMIO resources for SR-IOV")
>
> I think (IMHO) it because the allocation of the first BAR (the little)
> one was from the allocated slot of the big one (the allocation from the
> sriov_init function)
> and when the kernel tries to allocate the slot for he second BAR (the
> big one) in the place of the little one it failed.
>
> when I changed the code to start the allocation from the last to the
> first: for (i = PCI_SRIOV_NUM_BARS; i >= 0; i--)
> It works fine.
>
> Is it a bug ?
I don't know, care to make a patch that shows your exact change?
thanks,
greg k-h
next parent reply other threads:[~2009-12-08 17:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <2ED289D4E09FBD4D92D911E869B97FDD01E6E538@mtlexch01.mtl.com>
2009-12-08 17:34 ` Greg KH [this message]
2009-12-08 9:07 SR-IOV enabling process failed in kernel 2.6.32 Erez Shitrit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091208173416.GA25957@suse.de \
--to=gregkh@suse.de \
--cc=erezsh@mellanox.co.il \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@atrey.karlin.mff.cuni.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.