Bug 112221 - Cannot enable sriov on graphics adapter with PCIE type of PCI_EXP_TYPE_LEG_END
Summary: Cannot enable sriov on graphics adapter with PCIE type of PCI_EXP_TYPE_LEG_END
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: PCI (show other bugs)
Hardware: All Linux
: P1 blocking
Assignee: drivers_pci@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-09 14:11 UTC by Kelly
Modified: 2016-02-29 17:38 UTC (History)
3 users (show)

See Also:
Kernel Version: all Linux versions between 3.4.9 and 4.5.0-rc2
Subsystem:
Regression: No
Bisected commit-id:


Attachments
This log shows the error returned when trying to enable sriov. A test module was used to make the call to enable sriov. (62.95 KB, text/plain)
2016-02-09 14:11 UTC, Kelly
Details
Patch that removes the PCIE_TYPE check from sriov_init() (598 bytes, patch)
2016-02-09 14:27 UTC, Kelly
Details | Diff
dmesg log after applying the patch and enabling sriov. (65.46 KB, text/plain)
2016-02-09 14:29 UTC, Kelly
Details
lspci before enabling sriov (2.44 KB, text/plain)
2016-02-09 14:36 UTC, Kelly
Details
lspci after enabling sriov (2.77 KB, text/plain)
2016-02-09 14:37 UTC, Kelly
Details
lspci details (3.94 KB, text/plain)
2016-02-09 14:40 UTC, Kelly
Details

Description Kelly 2016-02-09 14:11:22 UTC
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.
Comment 1 Kelly 2016-02-09 14:27:05 UTC
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.
Comment 2 Kelly 2016-02-09 14:29:53 UTC
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.
Comment 3 Kelly 2016-02-09 14:36:10 UTC
Created attachment 203211 [details]
lspci before enabling sriov

lspci shows only the PF device on the bus
Comment 4 Kelly 2016-02-09 14:37:39 UTC
Created attachment 203221 [details]
lspci after enabling sriov

lspci shows the VF devices on the bus after enabling sriov
Comment 5 Kelly 2016-02-09 14:40:15 UTC
Created attachment 203231 [details]
lspci details

lspci showing sriov config space and the sriov details of the PF

Note You need to log in before you can comment on or make changes to this bug.