OS-7458 bhyve should allow pci_slot addressing for NICs#309
Open
jasonbking wants to merge 4 commits into
Open
Conversation
sjorge
reviewed
Jun 4, 2020
| if (snprintf(slotconf, sizeof (slotconf), | ||
| "%d:%d,virtio-net-viona,%s", PCI_SLOT_NICS, pcifn, net) >= | ||
| sizeof (slotconf)) { | ||
| if (pcibus > 0) { |
There was a problem hiding this comment.
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?
sjorge
reviewed
Jun 4, 2020
| pcibus, pcislot, pcifn, net); | ||
| } else { | ||
| ret = snprintf(slotconf, sizeof (slotconf), | ||
| "%u:%u,virtio-net-viona,%s", pcislot, pcifn, net); |
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.