在DOCA virtio、dma、PCIe中都涉及到了VUID的概念,他到底什么?
在PCIe技术中,VUID(Virtual Unique Identifier)是一个持久的标识符,用于标识PCIe设备。与BDF(Bus, Device, Function)不同,VUID在不同的系统运行之间保持不变,这使得它非常适合作为PCIe函数的标识符。VUID是NVIDIA设备添加到PCIe属性中的一个扩展,用于解决BDF值可能在不同系统运行之间变化的问题,因此VUID可以作为一个更稳定的标识符来使用。比如在DOCA中涉及到HOST和DPU沟通需要使用某个PCIe设备时候就要用到。
PCI BDF 和 VUID 使用 ‘lspci’ 命令从另一个中提取:
lspci -s 2d:00.0 -vvv|grep -i VU
通过vuid获取pciebdf方法:需要遍历
[host] ./get_bdf.py <VUID>
[host] cat ./get_bdf.py
#!/usr/bin/python3
import subprocess
import sys
vuid = sys.argv[1]
# Split the output into individual PCI function entries
lspci_output = subprocess.check_output(['lspci']).decode().strip().split('\n')
# Create an empty dictionary to store the results
pci_functions = {}
# Loop through each PCI function and extract the BDF and full info
for line in lspci_output:
bdf = line.split()[0]
if vuid in subprocess.check_output(['lspci', '-s', bdf, '-vvv']).decode():
print(bdf)
exit(0)
print("Not Found")
https://docs.nvidia.com/networking/display/bluefield3snap431/appendix+%E2%80%93+pcie+bdf+to+vuid+translation
因篇幅问题不能全部显示,请点此查看更多更全内容