2016-10-18 17 views
0

我有一個基於SR-IOV的PCIe設備。我想找到一種「受支持」的方法來恢復PCIe PF(物理功能)中VF的數量(虛擬功能)。我在oracle文檔中發現,有一個函數叫做priv_vf_config(),它可以返回一個包含一個包含vf個數的元素的結構。在標準的Linux包括內核開發之一中是否有這種類型的函數的通用等價物?在Linux內核驅動程序環境中是否存在pciv_vf_config的通用等效物

回答

0

drivers/pci/iov.c

/** 
* pci_num_vf - return number of VFs associated with a PF device_release_driver 
* @dev: the PCI device 
* 
* Returns number of VFs, or 0 if SR-IOV is not enabled. 
*/ 
int pci_num_vf(struct pci_dev *dev) 

包括<linux/pci.h>頭你的模塊聲明上述功能研究。

而且一定要在你的內核配置,使CONFIG_PCI_IOV

config PCI_IOV 
    bool "PCI IOV support" 
    depends on PCI 
    help 
     I/O Virtualization is a PCI feature supported by some devices 
     which allows them to create virtual devices which share their 
     physical resources. 
相關問題