Skip to content

Commit e321b10

Browse files
committed
Merge branch 'pci/endpoint-test'
- Clear pci-epf-test dma_chan_rx, not dma_chan_tx, after freeing dma_chan_rx (Mohamed Khalfella) - Correct the DMA MEMCPY test so it doesn't fail if the Endpoint supports both DMA_PRIVATE and DMA_MEMCPY (Manivannan Sadhasivam) - Add pci-epf-test and pci_endpoint_test support for capabilities (Niklas Cassel) - Add Endpoint test for consecutive BARs (Niklas Cassel) - Remove redundant comparison from Endpoint BAR test because a > 1MB BAR can always be exactly covered by iterating with a 1MB buffer (Hans Zhang) - Correct the PCI Endpoint test IOCTL return value (Manivannan Sadhasivam) - Move PCI Endpoint tests from tools/pci to Kselftests (Manivannan Sadhasivam) - Convert PCI Endpoint tests to the Kselftest framework (Manivannan Sadhasivam) * pci/endpoint-test: selftests: pci_endpoint: Migrate to Kselftest framework selftests: Move PCI Endpoint tests from tools/pci to Kselftests misc: pci_endpoint_test: Fix IOCTL return value misc: pci_endpoint_test: Remove redundant 'remainder' test misc: pci_endpoint_test: Add consecutive BAR test misc: pci_endpoint_test: Add support for capabilities PCI: endpoint: pci-epf-test: Add support for capabilities PCI: endpoint: pci-epf-test: Fix check for DMA MEMCPY test PCI: endpoint: pci-epf-test: Set dma_chan_rx pointer to NULL on error
2 parents 74855f6 + 392188b commit e321b10

File tree

14 files changed

+557
-613
lines changed

14 files changed

+557
-613
lines changed

Documentation/PCI/endpoint/pci-test-howto.rst

Lines changed: 72 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ device, the following commands can be used::
8181

8282
# echo 0x104c > functions/pci_epf_test/func1/vendorid
8383
# echo 0xb500 > functions/pci_epf_test/func1/deviceid
84-
# echo 16 > functions/pci_epf_test/func1/msi_interrupts
85-
# echo 8 > functions/pci_epf_test/func1/msix_interrupts
84+
# echo 32 > functions/pci_epf_test/func1/msi_interrupts
85+
# echo 2048 > functions/pci_epf_test/func1/msix_interrupts
8686

8787

8888
Binding pci-epf-test Device to EP Controller
@@ -123,113 +123,83 @@ above::
123123
Using Endpoint Test function Device
124124
-----------------------------------
125125

126-
pcitest.sh added in tools/pci/ can be used to run all the default PCI endpoint
127-
tests. To compile this tool the following commands should be used::
126+
Kselftest added in tools/testing/selftests/pci_endpoint can be used to run all
127+
the default PCI endpoint tests. To build the Kselftest for PCI endpoint
128+
subsystem, the following commands should be used::
128129

129130
# cd <kernel-dir>
130-
# make -C tools/pci
131+
# make -C tools/testing/selftests/pci_endpoint
131132

132133
or if you desire to compile and install in your system::
133134

134135
# cd <kernel-dir>
135-
# make -C tools/pci install
136+
# make -C tools/testing/selftests/pci_endpoint INSTALL_PATH=/usr/bin install
136137

137-
The tool and script will be located in <rootfs>/usr/bin/
138+
The test will be located in <rootfs>/usr/bin/
138139

139-
140-
pcitest.sh Output
141-
~~~~~~~~~~~~~~~~~
140+
Kselftest Output
141+
~~~~~~~~~~~~~~~~
142142
::
143143

144-
# pcitest.sh
145-
BAR tests
146-
147-
BAR0: OKAY
148-
BAR1: OKAY
149-
BAR2: OKAY
150-
BAR3: OKAY
151-
BAR4: NOT OKAY
152-
BAR5: NOT OKAY
153-
154-
Interrupt tests
155-
156-
SET IRQ TYPE TO LEGACY: OKAY
157-
LEGACY IRQ: NOT OKAY
158-
SET IRQ TYPE TO MSI: OKAY
159-
MSI1: OKAY
160-
MSI2: OKAY
161-
MSI3: OKAY
162-
MSI4: OKAY
163-
MSI5: OKAY
164-
MSI6: OKAY
165-
MSI7: OKAY
166-
MSI8: OKAY
167-
MSI9: OKAY
168-
MSI10: OKAY
169-
MSI11: OKAY
170-
MSI12: OKAY
171-
MSI13: OKAY
172-
MSI14: OKAY
173-
MSI15: OKAY
174-
MSI16: OKAY
175-
MSI17: NOT OKAY
176-
MSI18: NOT OKAY
177-
MSI19: NOT OKAY
178-
MSI20: NOT OKAY
179-
MSI21: NOT OKAY
180-
MSI22: NOT OKAY
181-
MSI23: NOT OKAY
182-
MSI24: NOT OKAY
183-
MSI25: NOT OKAY
184-
MSI26: NOT OKAY
185-
MSI27: NOT OKAY
186-
MSI28: NOT OKAY
187-
MSI29: NOT OKAY
188-
MSI30: NOT OKAY
189-
MSI31: NOT OKAY
190-
MSI32: NOT OKAY
191-
SET IRQ TYPE TO MSI-X: OKAY
192-
MSI-X1: OKAY
193-
MSI-X2: OKAY
194-
MSI-X3: OKAY
195-
MSI-X4: OKAY
196-
MSI-X5: OKAY
197-
MSI-X6: OKAY
198-
MSI-X7: OKAY
199-
MSI-X8: OKAY
200-
MSI-X9: NOT OKAY
201-
MSI-X10: NOT OKAY
202-
MSI-X11: NOT OKAY
203-
MSI-X12: NOT OKAY
204-
MSI-X13: NOT OKAY
205-
MSI-X14: NOT OKAY
206-
MSI-X15: NOT OKAY
207-
MSI-X16: NOT OKAY
208-
[...]
209-
MSI-X2047: NOT OKAY
210-
MSI-X2048: NOT OKAY
211-
212-
Read Tests
213-
214-
SET IRQ TYPE TO MSI: OKAY
215-
READ ( 1 bytes): OKAY
216-
READ ( 1024 bytes): OKAY
217-
READ ( 1025 bytes): OKAY
218-
READ (1024000 bytes): OKAY
219-
READ (1024001 bytes): OKAY
220-
221-
Write Tests
222-
223-
WRITE ( 1 bytes): OKAY
224-
WRITE ( 1024 bytes): OKAY
225-
WRITE ( 1025 bytes): OKAY
226-
WRITE (1024000 bytes): OKAY
227-
WRITE (1024001 bytes): OKAY
228-
229-
Copy Tests
230-
231-
COPY ( 1 bytes): OKAY
232-
COPY ( 1024 bytes): OKAY
233-
COPY ( 1025 bytes): OKAY
234-
COPY (1024000 bytes): OKAY
235-
COPY (1024001 bytes): OKAY
144+
# pci_endpoint_test
145+
TAP version 13
146+
1..16
147+
# Starting 16 tests from 9 test cases.
148+
# RUN pci_ep_bar.BAR0.BAR_TEST ...
149+
# OK pci_ep_bar.BAR0.BAR_TEST
150+
ok 1 pci_ep_bar.BAR0.BAR_TEST
151+
# RUN pci_ep_bar.BAR1.BAR_TEST ...
152+
# OK pci_ep_bar.BAR1.BAR_TEST
153+
ok 2 pci_ep_bar.BAR1.BAR_TEST
154+
# RUN pci_ep_bar.BAR2.BAR_TEST ...
155+
# OK pci_ep_bar.BAR2.BAR_TEST
156+
ok 3 pci_ep_bar.BAR2.BAR_TEST
157+
# RUN pci_ep_bar.BAR3.BAR_TEST ...
158+
# OK pci_ep_bar.BAR3.BAR_TEST
159+
ok 4 pci_ep_bar.BAR3.BAR_TEST
160+
# RUN pci_ep_bar.BAR4.BAR_TEST ...
161+
# OK pci_ep_bar.BAR4.BAR_TEST
162+
ok 5 pci_ep_bar.BAR4.BAR_TEST
163+
# RUN pci_ep_bar.BAR5.BAR_TEST ...
164+
# OK pci_ep_bar.BAR5.BAR_TEST
165+
ok 6 pci_ep_bar.BAR5.BAR_TEST
166+
# RUN pci_ep_basic.CONSECUTIVE_BAR_TEST ...
167+
# OK pci_ep_basic.CONSECUTIVE_BAR_TEST
168+
ok 7 pci_ep_basic.CONSECUTIVE_BAR_TEST
169+
# RUN pci_ep_basic.LEGACY_IRQ_TEST ...
170+
# OK pci_ep_basic.LEGACY_IRQ_TEST
171+
ok 8 pci_ep_basic.LEGACY_IRQ_TEST
172+
# RUN pci_ep_basic.MSI_TEST ...
173+
# OK pci_ep_basic.MSI_TEST
174+
ok 9 pci_ep_basic.MSI_TEST
175+
# RUN pci_ep_basic.MSIX_TEST ...
176+
# OK pci_ep_basic.MSIX_TEST
177+
ok 10 pci_ep_basic.MSIX_TEST
178+
# RUN pci_ep_data_transfer.memcpy.READ_TEST ...
179+
# OK pci_ep_data_transfer.memcpy.READ_TEST
180+
ok 11 pci_ep_data_transfer.memcpy.READ_TEST
181+
# RUN pci_ep_data_transfer.memcpy.WRITE_TEST ...
182+
# OK pci_ep_data_transfer.memcpy.WRITE_TEST
183+
ok 12 pci_ep_data_transfer.memcpy.WRITE_TEST
184+
# RUN pci_ep_data_transfer.memcpy.COPY_TEST ...
185+
# OK pci_ep_data_transfer.memcpy.COPY_TEST
186+
ok 13 pci_ep_data_transfer.memcpy.COPY_TEST
187+
# RUN pci_ep_data_transfer.dma.READ_TEST ...
188+
# OK pci_ep_data_transfer.dma.READ_TEST
189+
ok 14 pci_ep_data_transfer.dma.READ_TEST
190+
# RUN pci_ep_data_transfer.dma.WRITE_TEST ...
191+
# OK pci_ep_data_transfer.dma.WRITE_TEST
192+
ok 15 pci_ep_data_transfer.dma.WRITE_TEST
193+
# RUN pci_ep_data_transfer.dma.COPY_TEST ...
194+
# OK pci_ep_data_transfer.dma.COPY_TEST
195+
ok 16 pci_ep_data_transfer.dma.COPY_TEST
196+
# PASSED: 16 / 16 tests passed.
197+
# Totals: pass:16 fail:0 xfail:0 xpass:0 skip:0 error:0
198+
199+
200+
Testcase 16 (pci_ep_data_transfer.dma.COPY_TEST) will fail for most of the DMA
201+
capable endpoint controllers due to the absence of the MEMCPY over DMA. For such
202+
controllers, it is advisable to skip this testcase using this
203+
command::
204+
205+
# pci_endpoint_test -f pci_ep_bar -f pci_ep_basic -v memcpy -T COPY_TEST -v dma

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18003,7 +18003,7 @@ F: Documentation/PCI/endpoint/*
1800318003
F: Documentation/misc-devices/pci-endpoint-test.rst
1800418004
F: drivers/misc/pci_endpoint_test.c
1800518005
F: drivers/pci/endpoint/
18006-
F: tools/pci/
18006+
F: tools/testing/selftests/pci_endpoint/
1800718007

1800818008
PCI ENHANCED ERROR HANDLING (EEH) FOR POWERPC
1800918009
M: Mahesh J Salgaonkar <mahesh@linux.ibm.com>

0 commit comments

Comments
 (0)