HV: vdev passthough hidding SRIOV

Support hide SRIOV extend capability for passthough device

Tracked-On: #5041
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
Reviewed-by: Fei Li <fei1.li@intel.com>
This commit is contained in:
yuhong.tao@intel.com
2020-07-15 22:46:33 +08:00
committed by wenlingz
parent 585c652f81
commit eb36337622
6 changed files with 68 additions and 38 deletions

View File

@@ -663,7 +663,7 @@ static inline uint32_t pci_pdev_get_nr_bars(uint8_t hdr_type)
*/
static void pci_enumerate_ext_cap(struct pci_pdev *pdev) {
uint32_t hdr, pos;
uint32_t hdr, pos, pre_pos = 0U;
pos = PCI_ECAP_BASE_PTR;
@@ -673,12 +673,13 @@ static void pci_enumerate_ext_cap(struct pci_pdev *pdev) {
if (PCI_ECAP_ID(hdr) == PCIZ_SRIOV) {
pdev->sriov.capoff = pos;
pdev->sriov.caplen = PCI_SRIOV_CAP_LEN;
pdev->sriov.pre_pos = pre_pos;
}
pre_pos = pos;
pos = PCI_ECAP_NEXT(hdr);
if (pos == 0U) {
break;
}
hdr = pci_pdev_read_cfg(pdev->bdf, pos, 4U);
};
}