Kevin Bowling fa78e1d0b1 pci: Reserve bus numbers required by SR-IOV VFs
Some firmware assigns only one bus number to each PCI-PCI bridge.  This
prevents later SR-IOV VF enumeration when a VF routing ID falls on a bus
number already allocated to a sibling bridge.

Reserve only the additional bus numbers required by SR-IOV PFs.
Enumerate all directly attached functions before child drivers and
bridges attach, inspect their device_t objects for SR-IOV, and grow the
PCI bus resource through the highest possible VF routing ID.

First VF Offset and VF Stride may change when NumVFs changes.  Probe
every valid NumVFs value and preserve the original setting.  When the
upstream hierarchy uses ARI, temporarily enable the SR-IOV ARI Hierarchy
control in the lowest-numbered PF while sizing, then restore it.  Scope
active-VF detection to each conventional PCI slot; an ARI bus remains
one slot-0 hierarchy.  If firmware left VFs enabled on a device, do not
modify it and reserve only its active layout.

During runtime configuration, consult the PCI bus's owned resource
range rather than PCI-PCI bridge registers.  This recognizes an existing
boot-time reservation beneath both PCI-PCI and host bridges and avoids a
second, overlapping bus-number allocation.

This avoids consuming bus numbers behind unrelated bridges.  The runtime
allocation in pci_iov.c remains as a fallback when the boot-time range
cannot be enlarged.  hw.pci.clear_buses remains useful when firmware
assigned a required number to another bridge before enumeration.

Validated the targeted implementation on an Intel E810-XXV behind a
non-ARI root port.  With hw.pci.clear_buses=1 and no global reserve
tunable, the PF bridge received buses 1-2 while three unrelated bridges
each received one bus.  A VF with First VF Offset 0x100 attached as
iavf0 at pci0:2:0:0, and detached cleanly.

Reviewed by:	jhb, manpages (ziaee)
MFC after:	2 weeks
Sponsored by:	BBOX.io
Differential Revision:	https://reviews.freebsd.org/D58624
2026-09-28 23:25:45 -07:00
2026-09-23 13:37:45 +02:00
2026-09-14 14:37:46 +02:00
2026-09-16 14:28:14 -07:00
2026-09-15 01:44:34 +00:00
2026-07-27 07:01:21 -07:00
2026-09-19 11:20:29 -07:00
2026-09-26 18:05:53 +02:00
…
2026-03-07 00:51:15 -07:00
2026-08-25 21:25:22 -07:00
2026-01-01 00:29:23 +00:00
…
2026-07-07 08:47:40 +02:00
2026-09-22 22:37:02 +09:00

FreeBSD Source:

This is the top level of the FreeBSD source directory.

FreeBSD is an operating system used to power modern servers, desktops, and embedded platforms. A large community has continually developed it for more than thirty years. Its advanced networking, security, and storage features have made FreeBSD the platform of choice for many of the busiest web sites and most pervasive embedded networking and storage devices.

For copyright information, please see the file COPYRIGHT in this directory. Additional copyright information also exists for some sources in this tree - please see the specific source directories for more information.

The Makefile in this directory supports a number of targets for building components (or all) of the FreeBSD source tree. See build(7), config(8), FreeBSD handbook on building userland, and Handbook for kernels for more information, including setting make(1) variables.

For information on the CPU architectures and platforms supported by FreeBSD, see the FreeBSD website's Platforms page.

For official FreeBSD bootable images, see the release page.

Source Roadmap:

Directory Description
bin System/user commands.
cddl Source code for third-party software under the Common Development and Distribution License.
contrib Source code for third-party software.
crypto Source code for cryptographic libraries and commands (see crypto/README).
etc Template files for /etc.
include System include files.
kerberos5 Build system for Kerberos 5 (Heimdal).
krb5 Build system for Kerberos 5 (MIT).
lib System libraries.
libexec System commands intended to be executed by other commands or daemons.
packages Base system packages.
release Makefiles and scripts used for building releases and VM images.
rescue Build system for statically linked /rescue commands.
sbin System commands.
secure Build system for cryptographic libraries and commands (excluding Kerberos).
share Shared resources.
stand Boot loader sources.
sys Kernel sources (see sys/README.md).
targets Support for experimental DIRDEPS_BUILD
tests Tests which can be run by Kyua. See tests/README for additional information.
tools Ancillary utilities and tests (not included in the build).
usr.bin User commands.
usr.sbin System administration commands.

For information on synchronizing your source tree with one or more of the FreeBSD Project's development branches, please see FreeBSD Handbook.

S
Description
No description provided
Readme
4 GiB
0 Stars 1 Watchers 0 Forks
Languages
C 59.9%
C++ 26.8%
Roff 4.5%
Shell 2.8%
Assembly 1.7%
Other 3.7%