public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* RE: SR-IOV enabling process failed in kernel 2.6.32
@ 2009-12-08  9:07 Erez Shitrit
  0 siblings, 0 replies; 2+ messages in thread
From: Erez Shitrit @ 2009-12-08  9:07 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, linux-pci, Erez Shitrit

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.
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 ? 
 
Thanks, Erez

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-12-08 17:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <2ED289D4E09FBD4D92D911E869B97FDD01E6E538@mtlexch01.mtl.com>
2009-12-08 17:34 ` SR-IOV enabling process failed in kernel 2.6.32 Greg KH
2009-12-08  9:07 Erez Shitrit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox