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
Unknown Object (File)
Dec 20 2023, 1:11 AM
Unknown Object (File)
Dec 10 2023, 7:30 PM
Unknown Object (File)
Nov 9 2023, 4:37 PM
Unknown Object (File)
Sep 17 2023, 1:53 AM
Unknown Object (File)
Sep 16 2023, 7:06 AM
Unknown Object (File)
Aug 18 2023, 7:19 AM
Unknown Object (File)
Aug 14 2023, 3:12 PM
Unknown Object (File)
Aug 14 2023, 2:28 AM

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