]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Allocate PCI I/O memory spaces for VFs
authorRyan Stone <rstone@FreeBSD.org>
Sun, 1 Mar 2015 00:40:26 +0000 (00:40 +0000)
committerRyan Stone <rstone@FreeBSD.org>
Sun, 1 Mar 2015 00:40:26 +0000 (00:40 +0000)
commite9309eac19c3c8d0ba90e8e926b6107761093861
tree27cdf99df1fa9cb67ab09386bc428478c76c8ff1
parent5060ec97d4e67b12ce4738f30299ea5ff81b1adb
Allocate PCI I/O memory spaces for VFs

When creating VFs, we must size each SR-IOV BAR on the PF and
allocate a configuous I/O memory window large enough for every VF.
However, the window only needs to be aligned to a boundary equal
to the size of the window for a single VF.

When a VF attempts to allocate an I/O memory resource, we must
intercept the request in the pci driver and pass it off to the
SR-IOV code, which will allocate the correct window from the
pre-allocated memory space for the PF.

Inform the pci driver about the size and address of the BARs on
the VF when the VF is created.  This is required by pciconf -b and
bhyve.

Differential Revision: https://reviews.freebsd.org/D78
Reviewed by: jhb
MFC after:  1 month
Sponsored by: Sandvine Inc.
sys/dev/pci/pci.c
sys/dev/pci/pci_iov.c
sys/dev/pci/pci_iov_private.h
sys/dev/pci/pci_private.h
sys/dev/pci/pcivar.h