Page MenuHomeFreeBSD

pci_iov: Reuse downstream bridge bus window if it already covers VF bus
Needs ReviewPublic

Authored by chandrakanth.patil_broadcom.com on Aug 26 2025, 8:11 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 2, 12:28 PM
Unknown Object (File)
Tue, Sep 30, 8:37 AM
Unknown Object (File)
Sun, Sep 21, 6:23 PM
Unknown Object (File)
Sat, Sep 20, 6:04 PM
Unknown Object (File)
Aug 27 2025, 1:39 PM
Unknown Object (File)
Aug 27 2025, 4:09 AM
Unknown Object (File)
Aug 26 2025, 10:20 PM
Subscribers
None

Details

Summary

If the parent bridge's [secondary, subordinate] window already covers
the VF bus (e.g., programmed by BIOS or a prior PF), skip allocating
PCI_RES_BUS. This avoids a duplicate rman allocation in the multi-PF
case while still allocating when growth is actually needed.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

I need to think about this. I don't really want to have the PCI bus directly reading the config registers from the parent bridge. It's also true that you want to not release the bus until all VFs using that bus have been torn down, so you really kind of want a refcounted bus_alloc_resource here (in essence). It might be that just switching from RF_ACTIVE to RF_SHAREABLE when calling bus_alloc_resource is sufficient however.

In D52163#1195416, @jhb wrote:

I need to think about this. I don't really want to have the PCI bus directly reading the config registers from the parent bridge. It's also true that you want to not release the bus until all VFs using that bus have been torn down, so you really kind of want a refcounted bus_alloc_resource here (in essence). It might be that just switching from RF_ACTIVE to RF_SHAREABLE when calling bus_alloc_resource is sufficient however.

ok. I tried with "RF_SHAREABLE" but still the "bus_alloc_resource" was returning NULL for VFs created on other PFs.

Hi John,
I wanted to check if there are any updates on the suggestion I had asked.