Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 08 Jun 2023 16:20:37 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 271785] PCI: HotPlug: no BAR mapping after attaching a virtual function to the VM
Message-ID:  <bug-271785-227-RxWJE30mHL@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-271785-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-271785-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D271785

John Baldwin <jhb@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jhb@FreeBSD.org

--- Comment #2 from John Baldwin <jhb@FreeBSD.org> ---
I'm not quite sure I follow exactly.  Are you creating the VFs in a FreeBSD
bare metal machine, or have you created a VF on a host and are then passing
that VF through to the guest as a PCI-e hot-plug event?

Generally speaking, FreeBSD's PCI bus driver does not try to assign resourc=
es
to a device when it discovers it.  When a device is enumerated, if the BARs
already have a resource that has been assigned by firmware (e.g. during boo=
t),
then this existing resource allocations are preserved and the address space=
 is
reserved when enumerating the device.  However, if a BAR doesn't have a
firmware-assigned address range when a qdevice is enumerated, the BAR is st=
ill
sized but left unallocated.  If a device driver attaches and calls
bus_alloc_resource to reserve a BAR, at that point resources are allocated =
for
the BAR.

For HotPlug, BARs are always unassigned when the device appears, so they are
only assigned resources when you attach a driver.  Thus, if you create a VF=
 on
the host and pass through to the FreeBSD guest and the guest doesn't have a
driver for the VF device loaded, I would expect to see all the BARs unassig=
ned.
 However, once you load a driver the BARs should be assigned resources duri=
ng
the attach of the device driver.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-271785-227-RxWJE30mHL>