2016-10-18 5 views
0

SR-IOV 기반 PCIe 장치가 있습니다. PCIe PF (물리적 기능)에서 VF (가상 기능)의 수를 복구하는 "지원되는"방법을 찾고 싶습니다. 오라클 설명서에서 찾을 수있는 함수는 priv_vf_config()이며 vf가 포함 된 요소가 포함 된 구조체를 반환 할 수 있습니다. 커널 개발을위한 표준 리눅스 중 하나에이 유형의 함수에 해당하는 일반적인 기능이 있습니까? drivers/pci/iov.c에서linux 커널 드라이버 환경에서 pciv_vf_config와 동일한 기능을 수행합니까?

답변

0

는 :

/** 
* 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.