This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VM: PCIe Endpoint Mode: Errors when adding more than 1 physical function to endpoint node

Part Number: TDA4VM

Hi,

unfortunately the original thread has been closed meanwhile:

I would like to give feedback to Kishons patch:

1. No patch + 1 PF (physical function): The pcitest functions work.
2. No patch + 6 PF: The RC hangs after boot
3. Patch + 1 PF: The RC hangs after boot
4. Patch + 6 PF: the pcitest functions do *not* return, iE doe not work. I tested this only with the first physcial function though

Kishon, did you test your patch with 6 physical functions and verified it with pcitest?

Thanks and very best regards,
Thomas

  • Hi,

    are there any udpates on this?

    Thanks and best regards,
    Thomas

  • Hi,

    I would really need some support here. I think the issue here is that some MSI-Interrupts from EP to RC are not recognized by RC. I've created a script which reproduces the issue consistently.

    1. This script configures 6 physical functions on EP

    #!/bin/sh
    
    echo "Configure PCIe EP"
    cd /sys/kernel/config/pci_ep/
    mkdir functions/pci_epf_test/func1
    echo 0x104c > functions/pci_epf_test/func1/vendorid
    echo 0xb00d > functions/pci_epf_test/func1/deviceid
    echo 2 > functions/pci_epf_test/func1/msi_interrupts
    echo 2 > functions/pci_epf_test/func1/msix_interrupts
    ln -s functions/pci_epf_test/func1 controllers/2900000.pcie-ep/
    
    cd /sys/kernel/config/pci_ep/
    mkdir functions/pci_epf_test/func2
    echo 0x104c > functions/pci_epf_test/func2/vendorid
    echo 0xb00d > functions/pci_epf_test/func2/deviceid
    echo 2 > functions/pci_epf_test/func2/msi_interrupts
    echo 2 > functions/pci_epf_test/func2/msix_interrupts
    ln -s functions/pci_epf_test/func2 controllers/2900000.pcie-ep/
    
    cd /sys/kernel/config/pci_ep/
    mkdir functions/pci_epf_test/func3
    echo 0x104c > functions/pci_epf_test/func3/vendorid
    echo 0xb00d > functions/pci_epf_test/func3/deviceid
    echo 2 > functions/pci_epf_test/func3/msi_interrupts
    echo 2 > functions/pci_epf_test/func3/msix_interrupts
    ln -s functions/pci_epf_test/func3 controllers/2900000.pcie-ep/
    
    cd /sys/kernel/config/pci_ep/
    mkdir functions/pci_epf_test/func4
    echo 0x104c > functions/pci_epf_test/func4/vendorid
    echo 0xb00d > functions/pci_epf_test/func4/deviceid
    echo 2 > functions/pci_epf_test/func4/msi_interrupts
    echo 2 > functions/pci_epf_test/func4/msix_interrupts
    ln -s functions/pci_epf_test/func4 controllers/2900000.pcie-ep/
    
    cd /sys/kernel/config/pci_ep/
    mkdir functions/pci_epf_test/func5
    echo 0x104c > functions/pci_epf_test/func5/vendorid
    echo 0xb00d > functions/pci_epf_test/func5/deviceid
    echo 2 > functions/pci_epf_test/func5/msi_interrupts
    echo 2 > functions/pci_epf_test/func5/msix_interrupts
    ln -s functions/pci_epf_test/func5 controllers/2900000.pcie-ep/
    
    cd /sys/kernel/config/pci_ep/
    mkdir functions/pci_epf_test/func6
    echo 0x104c > functions/pci_epf_test/func6/vendorid
    echo 0xb00d > functions/pci_epf_test/func6/deviceid
    echo 2 > functions/pci_epf_test/func6/msi_interrupts
    echo 2 > functions/pci_epf_test/func6/msix_interrupts
    ln -s functions/pci_epf_test/func6 controllers/2900000.pcie-ep/
    
    echo 1 > controllers/2900000.pcie-ep/start
    
    echo "Finished PCIe EP configuration"

    2. Execute this in / of RC. I assume, pcitest is also placed in /

    #!/bin/sh
    
    bSize=( 0 1 2 3 4 5 4 3 2 1 0 1 2 2 3 4 5 2 1 2 3 4 5 3 1 4 1 2 3 5 3 2 1 )
    resultDir="pciresults"
    
    action="-m 1"
    #action="-z"
    
    echo "Starting Tests..."
    ./pcitest -D /dev/pci-endpoint-test.0 -i 1
    ./pcitest -D /dev/pci-endpoint-test.1 -i 1
    ./pcitest -D /dev/pci-endpoint-test.2 -i 1
    ./pcitest -D /dev/pci-endpoint-test.3 -i 1
    ./pcitest -D /dev/pci-endpoint-test.4 -i 1
    ./pcitest -D /dev/pci-endpoint-test.5 -i 1
    
    
    echo "Activate MSI interrupts"
    mkdir -p  $resultDir/testsWithDMA
    iter=0
    for bs in "${bSize[@]}"
    do
        printf "Physical Function $bs IR test" 
        ./pcitest -D /dev/pci-endpoint-test.$bs $action
    done
    
    echo "Tests finished!"

    3. My Result:

    root@j7-evm:~# cd /
    root@j7-evm:/# sh executeTestsIR.sh
    Starting Tests...
    SET IRQ TYPE TO MSI:            OKAY
    SET IRQ TYPE TO MSI:            OKAY
    SET IRQ TYPE TO MSI:            OKAY
    SET IRQ TYPE TO MSI:            OKAY
    SET IRQ TYPE TO MSI:            OKAY
    SET IRQ TYPE TO MSI:            OKAY
    Activate MSI interrupts
    Physical Function 0 IR testMSI1:                OKAY
    Physical Function 1 IR testMSI1:                NOT OKAY
    Physical Function 2 IR testMSI1:                OKAY
    Physical Function 3 IR testMSI1:                OKAY
    Physical Function 4 IR testMSI1:                OKAY
    Physical Function 5 IR testMSI1:                OKAY
    Physical Function 4 IR testMSI1:                OKAY
    Physical Function 3 IR testMSI1:                OKAY
    Physical Function 2 IR testMSI1:                OKAY
    Physical Function 1 IR testMSI1:                NOT OKAY
    Physical Function 0 IR testMSI1:                OKAY
    Physical Function 1 IR testMSI1:                NOT OKAY
    Physical Function 2 IR testMSI1:                OKAY
    Physical Function 2 IR testMSI1:                OKAY
    Physical Function 3 IR testMSI1:                OKAY
    Physical Function 4 IR testMSI1:                OKAY
    Physical Function 5 IR testMSI1:                OKAY
    Physical Function 2 IR testMSI1:                OKAY
    Physical Function 1 IR testMSI1:                NOT OKAY
    Physical Function 2 IR testMSI1:                OKAY
    Physical Function 3 IR testMSI1:                OKAY
    Physical Function 4 IR testMSI1:                OKAY
    Physical Function 5 IR testMSI1:                OKAY
    Physical Function 3 IR testMSI1:                OKAY
    Physical Function 1 IR testMSI1:                NOT OKAY
    Physical Function 4 IR testMSI1:                OKAY
    Physical Function 1 IR testMSI1:                NOT OKAY
    Physical Function 2 IR testMSI1:                OKAY
    Physical Function 3 IR testMSI1:                OKAY
    Physical Function 5 IR testMSI1:                OKAY
    Physical Function 3 IR testMSI1:                OKAY
    Physical Function 2 IR testMSI1:                OKAY
    Physical Function 1 IR testMSI1:                NOT OKAY
    Tests finished!
    root@j7-evm:/# 
    

    For me, it seems that physical function "1" does not work when executing the MSI interrupt test. Is my assumption or configuration wrong?

    If you need more details/data please ask.

    Best regards,
    Thomas