Hi Daniel,
Thanks a lot for the quick reply - it's much appreciated.
> IIUC, the high level scenario is as follows
Yes, the high-level description matches the use-case.
The SmartNIC DPU cores may even rely on something else other than PCIe in a
general case: i.e. they could use a platform device or a different I/O
specification to access the network controller while the hypervisor host would
rely on PCIe. The end result is the same though - hypervisor host PCI addresses
cannot be relied upon to identify the so called "port representors"
(
https://lwn.net/Articles/692942/) at the SmartNIC DPU operating system side.
Moreover, there can be multiple SmartNIC DPUs per hypervisor in a general case
each with its own set of PFs and VFs. In order to determine which DPU is going
to handle representor port programming at the control plane level, there needs
to be a way to identify a DPU based on a VF selected by the hypervisor (at
least in Nova, VF selection is driven from the hypervisor side). A board serial
number can be determined both from the hypervisor and the DPU independently
and so the hypervisor services can provide the board serial to the network
control plane for the discovery of a relevant DPU. That's where Libvirt comes
in for helping with serial number retrieval.
> This seems like a reasonable feature request to me, since there is
a piece of info that apps using libvirt need, and libvirt does not
expose this. Requiring the mgmt app like Nova to dig into the host
PCI config space indicates a clear gap in libvirt functionality.
Ack, thanks for confirming.
> Is scenario (2) going to be at all common ? What would be a reason why the
info is not exposed via the standardized VPD - is it just a legacy hardware
issue ?
VPD is an optional capability in the PCI and PCIe specs. While there is hope
that every SmartNIC DPU vendor will implement it seeing the need for it,
there might be some fragmentation because the specs do not mandate its
presence. Scenario (2) is an attempt to have an alternative source for the
same piece of information: if a serial is available via the driver (which may
query NIC firmware instead of reading VPD) it can still be used with the same
end result. The devlink-info API does not mandate that a board serial is
exposed either so there is no guarantee this will be available via devlink.
It will surely be simpler to just implement scenario (1) and add (2)
later if there is a significant need for it. The generally available hardware
I have seen has VPD exposed so I can just focus on (1) while we can decide
on whether to do (2) or not.
Best Regards,
Dmitrii Shcherbakov
LP: ~dmitriis