Bug 2061216

Summary: pciAddress for SR-IOV VF passthrough of Network Device is ignored.
Product: Container Native Virtualization (CNV) Reporter: Germano Veit Michel <gveitmic>
Component: NetworkingAssignee: Orel Misan <omisan>
Status: CLOSED DUPLICATE QA Contact: Ruth Netser <rnetser>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.8.5CC: cnv-qe-bugs, phoracek
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-03-31 21:17:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
VMI object with two SR-IOV NICs with custom PCI and MAC addresses
none
virt-launcher Pod object
none
virt-launcher log file
none
domain.xml
none
ip link command output from the guest OS
none
lshw command output from the guest OS
none
ip link command output from the node
none
VF to PCI mapping from the node
none
SR-IOV CNI output 1
none
SR-IOV CNI output 2
none
NetworkAttachmentDefinition 1
none
NetworkAttachmentDefinition 2 none

Description Germano Veit Michel 2022-03-06 23:56:30 UTC
Description of problem:

If the user specifies a sriov network device like the below, with a pciAddress, it passes validation but the specified pciAddress does not end up in the libvirt xml.

      - macAddress: aa:bb:cc:dd:ee:ff
        name: nic-1
        pciAddress: "0000:XY:00.0"
        sriov: {}

When defining the interface, the converter jumps SR-IOV ones here [1], so it does not get to the part where the guest side address of the VF is set, a few lines below, here [2].

This makes it hard for the user to use Scheme 3 of network interface predictable/persistent naming [3] with SR-IOV devices. Note the above works fine for para-virt devices like virtio-net.

[1] https://github.com/kubevirt/kubevirt/blob/main/pkg/virt-launcher/virtwrap/converter/network.go#L53
[2] https://github.com/kubevirt/kubevirt/blob/main/pkg/virt-launcher/virtwrap/converter/network.go#L78
[3] https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_and_managing_networking/consistent-network-interface-device-naming_configuring-and-managing-networking

How reproducible:
- Still looking for HW to confirm on latest, happens with customer on 4.8.5.

Comment 1 Petr Horáček 2022-03-10 14:09:22 UTC
Thanks for reporting this. The team will be looking into this issue in the next sprint.

Comment 12 Orel Misan 2022-03-28 15:28:49 UTC
Created attachment 1868764 [details]
VMI object with two SR-IOV NICs with custom PCI and MAC addresses

Comment 13 Orel Misan 2022-03-28 15:29:45 UTC
Created attachment 1868766 [details]
virt-launcher Pod object

Comment 14 Orel Misan 2022-03-28 15:30:21 UTC
Created attachment 1868767 [details]
virt-launcher log file

Comment 15 Orel Misan 2022-03-28 15:31:06 UTC
Created attachment 1868768 [details]
domain.xml

Comment 16 Orel Misan 2022-03-28 15:32:17 UTC
Created attachment 1868769 [details]
ip link command output from the guest OS

Comment 17 Orel Misan 2022-03-28 15:33:28 UTC
Created attachment 1868770 [details]
lshw command output from the guest OS

Comment 18 Orel Misan 2022-03-28 15:34:21 UTC
Created attachment 1868771 [details]
ip link command output from the node

Comment 19 Orel Misan 2022-03-28 15:35:09 UTC
Created attachment 1868772 [details]
VF to PCI mapping from the node

Comment 20 Orel Misan 2022-03-28 15:36:02 UTC
Created attachment 1868773 [details]
SR-IOV CNI output 1

Comment 21 Orel Misan 2022-03-28 15:36:45 UTC
Created attachment 1868774 [details]
SR-IOV CNI output 2

Comment 22 Orel Misan 2022-03-28 15:44:36 UTC
Created attachment 1868777 [details]
NetworkAttachmentDefinition 1

Comment 23 Orel Misan 2022-03-28 15:45:04 UTC
Created attachment 1868779 [details]
NetworkAttachmentDefinition 2

Comment 26 Orel Misan 2022-03-30 12:26:48 UTC
There is a bug that masked this bug https://bugzilla.redhat.com/show_bug.cgi?id=2070050

A more accurate description of this bug is: Cannot reliably set multiple SR-IOV NICs with different properties (pciAddress, bootOrder, macAddress or setting from the NetworkAttachmentDefinitions).
The attachments are a recreation of this bug on the latest upstream code.

Comment 27 Germano Veit Michel 2022-03-30 22:32:53 UTC
(In reply to Orel Misan from comment #26)
> There is a bug that masked this bug
> https://bugzilla.redhat.com/show_bug.cgi?id=2070050

But only on 4.9 and 4.10 right, 4.8 can start without duplicate pci addresses, its just all scrambled.

> A more accurate description of this bug is: Cannot reliably set multiple
> SR-IOV NICs with different properties (pciAddress, bootOrder, macAddress or
> setting from the NetworkAttachmentDefinitions).
> The attachments are a recreation of this bug on the latest upstream code.

Are you saying the MAC address with randomly float around the multiple NICs too, not just PCI Address and bootOrder?
Seems to be working for the customer, but could be luck (like Petr mentioned).

I'm uploading the data soon.

Comment 29 Orel Misan 2022-03-31 07:22:32 UTC
Thank you for the information.

> Are you saying the MAC address with randomly float around the multiple NICs too, not just PCI Address and bootOrder?
> Seems to be working for the customer, but could be luck (like Petr mentioned).

At the moment there is an issue to distinguish between multiple SR-IOV NICs that have different properties from one another.
for example if you specify a list of multiple SR-IOV NICs, each with a custom PCI address and a MAC address, it is not guaranteed to be reflected correctly in the domain, and thus in the guest OS.

Comment 30 Orel Misan 2022-03-31 07:32:32 UTC
(In reply to Germano Veit Michel from comment #27)

> But only on 4.9 and 4.10 right, 4.8 can start without duplicate pci addresses, its just all scrambled.

This bug https://bugzilla.redhat.com/show_bug.cgi?id=2070050 is only affecting versions 4.9 4.10.

Comment 31 Germano Veit Michel 2022-03-31 07:47:11 UTC
(In reply to Orel Misan from comment #29)
> At the moment there is an issue to distinguish between multiple SR-IOV NICs
> that have different properties from one another.
> for example if you specify a list of multiple SR-IOV NICs, each with a
> custom PCI address and a MAC address, it is not guaranteed to be reflected
> correctly in the domain, and thus in the guest OS.

Yes, this is exactly what this BZ is about, more specific to the pci address.

Thanks for clarifying everything!

Comment 32 Orel Misan 2022-03-31 08:04:55 UTC
No problem.

Can you please update this bug's description with the new information?
I suggest to also remove the references to the code because they are misleading.

Comment 33 Germano Veit Michel 2022-03-31 21:17:17 UTC
Unfortunately this cannot be done, BZ does not allow to edit comments.

My BZ comment #0 was quite bad start, and then there is a lot of back and forth and noise because of that, plus the extra bug on 4.9 and 4.10.
Let's close this one as other people may get lost too, I'll open a new one with a proper problem description and we continue from there.

Will also have to KCS the child BZ from this (4.9/4.10 closure).

*** This bug has been marked as a duplicate of bug 2070772 ***