Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pci_devices test: device should be conneted to downstream port using device number 0 #1557

Open
rayx opened this issue Nov 13, 2018 · 3 comments

Comments

@rayx
Copy link
Contributor

rayx commented Nov 13, 2018

See this test for example:


065-type_specific.io-github-autotest-qemu.pci_devices.three_devices.xhci_controller.bus_in_bus.bridge_switch_switch

(BTW, its name is confusing. It should be called "root_switch_switch" test. But that's another issue and I filed #1543 against it).

It generates this command line:


MALLOC_PERTURB_=1  /usr/bin/qemu-system-aarch64 \
    ...
    -device ioh3420,id=test_pci_root1,bus=pcie.0, addr=0x1 \
    -device x3130-upstream,id=test_pci_switch1,bus=test_pci_root1,addr=0x0 \
    -device xio3130-downstream,bus=test_pci_switch1,id=test_pci_switch1.0,addr=0x0,chassis=1 \
    -device x3130-upstream,id=test_pci_switch2,bus=test_pci_switch1.0,addr=0x0  \
    -device xio3130-downstream,bus=test_pci_switch2,id=test_pci_switch2.0,addr=0x0,chassis=2 \
    -device nec-usb-xhci,id=test_xhci1,addr=0x0,bus=test_pci_switch2.0 \
    -device xio3130-downstream,bus=test_pci_switch2,id=test_pci_switch2.27,addr=0x1b,chassis=3 \
    -device nec-usb-xhci,id=test_xhci2,addr=0x1b,bus=test_pci_switch2.27 \
    -device xio3130-downstream,bus=test_pci_switch2,id=test_pci_switch2.31,addr=0x1f,chassis=4 \
    -device nec-usb-xhci,id=test_xhci3,addr=0x1f,bus=test_pci_switch2.31 \
    ...

And then test fails. The symptom is that the second and third xhci controller is not seen by guest kernel.

I believe the issue is with their attr value. Downstream port can have only one slot. The device plugged into that slot should have its device number as 0. So, their attr value in QEMU CLI should be something like "0x0".

@rayx
Copy link
Contributor Author

rayx commented Nov 13, 2018

I did a quick look at the code and found the code that caused the issue was in virtest. I managed to change it and got the test working. I'll post a PR in avocado-vt repo later today.

@vivianQizhu
Copy link
Contributor

@rayx Thanks for reporting it, this test is out of date, we might abandon this x3130-upstream and xio3130-downstream structure, have something else replacing them. @jingzhao84 Do we plan to replace it with new devices or remove the test?

@rayx
Copy link
Contributor Author

rayx commented Nov 13, 2018

@vivianQizhu Thanks for the information. I'll leave the issue open to help to track test failures and the change to be made. Feel free to close it if you like.

The issue in virttest QPCISwitchBus class code seems to be a common one. I'll file a separate issue in that repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants