Page MenuHomeFreeBSD

bhyve: pci_devinst.pi_name should contain bus, slot, func
ClosedPublic

Authored by gusev.vitaliy_gmail.com on May 15 2023, 1:57 PM.
Tags
Referenced Files
F102458873: D40107.diff
Tue, Nov 12, 2:05 PM
Unknown Object (File)
Mon, Oct 28, 7:02 PM
Unknown Object (File)
Sep 27 2024, 9:33 PM
Unknown Object (File)
Sep 25 2024, 11:17 AM
Unknown Object (File)
Sep 3 2024, 12:06 AM
Unknown Object (File)
Sep 2 2024, 4:35 AM
Unknown Object (File)
Jul 20 2024, 2:37 PM
Unknown Object (File)
Jul 6 2024, 5:48 PM

Details

Summary

Each device needs a unique identifier to store and restore snapshots
properly. Adding the pci bsf information to the device name creates a
unique identifier as a bsf can't be occupied twice.

Related to multiple devices support.

Sponsored by: vStack

Test Plan

Note, pdi.pi_name is changed, for example, to: "virtio-net@pci.0.4.0"

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

usr.sbin/bhyve/pci_emul.c
1032

We may like to use the same format as pciconf pci%s:%s:%s:%s, domain, bus, slot, func.

usr.sbin/bhyve/pci_emul.c
1032

Yes, but currently this format is more useful since .meta file doesn't have command line. This format has 'emu' type and it is important.

The best is enemy of good :)

usr.sbin/bhyve/pci_emul.c
1032

Sry to be unclear. I've only talked to the pci part. So, I suggested to use %s@pci%s:%s:%s:%s, emu, domain, bus, slot, func.

gusev.vitaliy_gmail.com added inline comments.
usr.sbin/bhyve/pci_emul.c
1032

Hmm, I can't find domain in bhyve source directory.

usr.sbin/bhyve/pci_emul.c
1032

Afaik, domain isn't supported by bhyve yet. So, we can hard code it to 0.

gusev.vitaliy_gmail.com added inline comments.
usr.sbin/bhyve/pci_emul.c
1032

It seems that domain can be added when becomes supported.

This revision is now accepted and ready to land.Jun 6 2023, 9:31 AM