As this is my first post, I would like to say Hello to everybody.
Seems that you are trying to fix the same issue as we in Cavium/Linaro [1] and 
therefore I would like to share with you with some findings, which I hope you 
will find helpful. It's a rather long explanation ;)

So first of all, this issue is triggered by one of ThunderX SOC devices,
VNIC network device to be exact. It's PF does not expose netdev which
makes trouble for libvirt code.

It means there is no interface name at which PF device can be found under /sys 
or pointed out using RTM_SETLINK message (there are some alternatives to that 
but more over this latter).
>From information which I have at hand, there is no requirement from SRIOV 
>standard (nor any other) that PF has to have the same functionality as their 
>VF, by what IMHO all assumptions in libvirt code about VF->PF->VF mapping 
>using interface names are false. Basically that's why the proper fix for that 
>is hard as it requires a lot of rework in virtnetdev layer of libvirt. Someone 
>might argue that Intel cards expose such interfaces but this does not mean 
>that libvirt should assume that it is a "standard" behavior.

I started to working on those [2] but ended up with quite invasive fixes
which for sure requires some discussion on libvirt-dev list (comments
for [2] more than welcome, I will also start RFC on libvirt-dev for
that).

The simple fix for this issue should:
- suppress the initialization error (more less this is what Dann Frazier does 
in his patch [3] or I'm doing in first patch of the series of [2])
- fix some NULL reference bugs in libvirt (third and fourth patch in the series 
[2]) so libvirt will not crash in case of <interface> config is given for VNIC 
VF netdev, but just throw an error, that due to missing HW support it is not 
able to configure the interface (I didn't introduced proper error messages yet 
in my patch set).

That's the fast fix which I should be able to extract from my fixes
quite easily and it should be upstreamable.

---

Beside the libvirt, the for full fix the ThunderX VNIC kernel driver
need to be enhanced, as it currently does not support VLAN's and VF MAC
setting, which is essentially needed to make ThunderX VNIC a fully
supported device under libvirt. In fact this is the major part of the
work.

The true fix need:
- fix libvirt wrong assumptions about SRIOV netdevs and handling of VF->PF->VF 
mapping by netdev names (instead pci BDF should be used in whole virtnetdev 
layer or some non-netdev name, just generic dev related addressing scheme)
- fix libvirt PF VLAN and MAC handling code to use global port number instead 
of PF name for RTM_SETLINK
- ThunderX VNIC driver need to support VLAN's per VF (MCAM) possibly with 
dynamic VF creation as well as switchdev functionality (currently VF are 
created basing on active port count read from BGX)

---

@dann I understand the idea in your patch (filtering out the
incompatible NIC's), but can You take a look at [4]?

Not sure what was exactly the intention of the code inside 
virNetDevSwitchdevFeature(), but if you look at following line:
pci_device_ptr = pfname ? virNetDevGetPCIDevice(pfname) : 
virNetDevGetPCIDevice(ifname);
It might suggest that the intention of author was that switch functionality 
will be handled either by VF or PF. 

Therefore I'm rather for option that the fix should ignore errors from
virNetDevGetPhysicalFunction(), which will leave pfname = NULL.

At the end (also in case of ThunderX which doe's not support ESWITCH) it
will give the same result as your patch (return 0) without introduction
of additional check/filtering function.

---

[1] https://bugs.linaro.org/show_bug.cgi?id=3778
[2] ssh://g...@git.linaro.org/people/radoslaw.biernacki/libvirt.git 
wip_thunder_fix6
[3] 
https://launchpadlibrarian.net/390574937/libvirt-no-thunderx-switchdev.debdiff
[4] 
https://git.linaro.org/people/radoslaw.biernacki/libvirt.git/commit/?h=wip_thunder_fix6&id=a73772938cec6de16f14e9031bdbf42fe02e0faa

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1771662

Title:
  [bionic] libvirtError: Node device not found: no node device with
  matching name

To manage notifications about this bug go to:
https://bugs.launchpad.net/charm-nova-compute/+bug/1771662/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to