Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OS-7458 bhyve should allow pci_slot addressing for NICs #309

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jasonbking
Copy link

No description provided.

if (snprintf(slotconf, sizeof (slotconf),
"%d:%d,virtio-net-viona,%s", PCI_SLOT_NICS, pcifn, net) >=
sizeof (slotconf)) {
if (pcibus > 0) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see no way to avoid collisions here?

I can add a nic without pci_slot set and mark it primary and then add a 2nd one set to 0:6:0 an they will end up in the same slot. (Or am I missing a check for that somewhere?

pcibus, pcislot, pcifn, net);
} else {
ret = snprintf(slotconf, sizeof (slotconf),
"%u:%u,virtio-net-viona,%s", pcislot, pcifn, net);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also be explicitly set the bus to 0 while we're here?

6919:   bhyve -H -U 99e40ee7-a8f9-4b57-9225-e7bd19f64b07 -B 1,manufacturer=Joyent,produ
argv[0]: bhyve
argv[1]: -H
argv[2]: -U
argv[3]: 99e40ee7-a8f9-4b57-9225-e7bd19f64b07
argv[4]: -B
argv[5]: 1,manufacturer=Joyent,product=SmartDC HVM,version=7.20200529T085640Z,serial=99e40ee7-a8f9-4b57-9225-e7bd19f64b07,sku=001,family=Virtual Machine
argv[6]: -s
argv[7]: 31,lpc
argv[8]: -l
argv[9]: bootrom,/usr/share/bhyve/uefi-rom.bin
argv[10]: -l
argv[11]: com1,/dev/zconsole
argv[12]: -l
argv[13]: com2,socket,/tmp/vm.ttyb
argv[14]: -s
argv[15]: 0,hostbridge,model=i440fx
argv[16]: -c
argv[17]: 4
argv[18]: -m
argv[19]: 4096
argv[20]: -s
argv[21]: 0:4:0,virtio-blk,/dev/zvol/rdsk/zones/99e40ee7-a8f9-4b57-9225-e7bd19f64b07/disk0
argv[22]: -s
argv[23]: 6:0,virtio-net-viona,net0
argv[24]: -s
argv[25]: 6:1,virtio-net-viona,net1
argv[26]: -s
argv[27]: 6:2,virtio-net-viona,net2
argv[28]: -s
argv[29]: 6:3,virtio-net-viona,net3
argv[30]: -s
argv[31]: 6:4,virtio-net-viona,net4
argv[32]: -w
argv[33]: -c
argv[34]: sockets=1,cores=2,threads=2
argv[35]: SYSbhyve-12

Currently the nics are the only one that get passed without the bus, sure bhyve itself wil use 0 in that case. But given we pass it for all other arguments we add, we should be consistant.

@danmcd
Copy link

danmcd commented Oct 18, 2024

See TritonDataCenter/smartos-live#940 ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants