Created attachment 203181 [details] This log shows the error returned when trying to enable sriov. A test module was used to make the call to enable sriov. sriov_init() in file iov.c fails with errcode -ENODEV when trying to initialize sriov on a pcie device with type PCI_EXP_TYPE_LEG_END. Discussed the limitation with Bjorn Helgass and others in discussion http://lkml.kernel.org/r/CY1PR12MB026259439AA9689B7326F4B5FED20@CY1PR12MB0262.namprd12.prod.outlook.com and initial discussions at http://lkml.kernel.org/r/B756807489D6244883AC0B799A6EEC15EAB2E8@storexdag02.amd.com sriov_init() specifically checks for PCI_EXP_TYPE_RC_END and PCI_EXP_TYPE_ENDPOINT and rejects all other types. After several discussions is was recommended by Bjorn to remove the check completely rather than just add the LEG_END type.
Created attachment 203191 [details] Patch that removes the PCIE_TYPE check from sriov_init() As per discussions, no reason for including the check for PCIE_TYPE could be determined, therefore instead of adding a new case to check for PCI_EXP_TYPE_LEG_END the check is removed completely.
Created attachment 203201 [details] dmesg log after applying the patch and enabling sriov. sriov is enabled by a test module. Device at 1:0.0 is an sriov capable device. The test module enables sriov with 4 VFs and creates devices 2:0.0, 2:0.1, 2:0.1 and 2:0.3.
Created attachment 203211 [details] lspci before enabling sriov lspci shows only the PF device on the bus
Created attachment 203221 [details] lspci after enabling sriov lspci shows the VF devices on the bus after enabling sriov
Created attachment 203231 [details] lspci details lspci showing sriov config space and the sriov details of the PF