Since a RC sample application
ti-sample-vfio based on Linux VFIO driver is implemented for testing and
verification purposes, some tests descripted on Section 5 require the usage. To use
ti-sample-vfio, the following setup needs to be implemented:
- On successful PCIe boot up open Linux terminal and acquire root
privileges:
sudo su
- Determine bus-, device-, and function number of
TMDS243EVM PCIe EP device using lspci command in Linux terminal. Use the vendor
and device ID as set in Sysconfig. Search for it with the following command
which shows related information of all PCIe devices
numerically:
lspci -vtn
- The output of the previous command is shown in the following figure. In that case, the PCIe EP
is assigned the bus 4, device 00 and function 0.
- Load the VFIO-PCI driver using
modprobe:
modprobe vfio-pci
-
Assign TMDS243EVM PCIe EP
vendor and device ID to the VFIO driver.
echo "17cd 0100" > /sys/bus/pci/drivers/vfio-pci/new_id
- Check which IOMMU group the PCIe EP is assigned
to:
readlink /sys/bus/pci/devices/0000:04:00.0/iommu_group
- The output of the
previous command can provide: PCIe EP assigned the IOMMU group.
- Make sure the EP is the only device in this IOMMU
group:
ls -l /sys/bus/pci/devices/0000:04:00.0/iommu_group/devices
As can be seen the
TMDS243EVM PCIe EP is the only device in IOMMU group 60. In case of
additional PCIe devices within the same IOMMU group, these PCIe devices must
be bind to VFIO driver as well.
- Compile ti-sample-vfio (root privileges
are no longer needed for the next
steps):
gcc ti-sample-vfio.c -o ti-sample-vfio -g -O2
- Execute ti-sample-vfio application with
previously determined
parameter:
sudo ./ti-sample-vfio 40 0 60 1 wait
Note: The
ti-sample-vfio application requires
the following parameter for execution:
- [bus]: PCIe EP bus
number
- [device]: PCIe EP device
number
- [function]: PCIe EP function
number
- [IOMMU group]: PCIe EP IOMMU
group
- [test_mode] This parameter is
only required for test case 4.3.2 which refers to an extended inbound
ATU/BAR configuration (see the corresponding description). To start the test
case, the parameter testbars must be passed. Otherwise, this
parameter can be omitted, and the input is interpreted as the subsequent
parameter [Number of MSI IRQs].
- [Number of MSI IRQs]: Number
of to be tested MSI IRQs as descripted on Test 4.5.2. This parameter needs
to be set to 1 if test 4.5.2 is not performed.
- [Number of loops]: Number of
loops the test program can execute. This parameter is optional and can be
left empty. The default value is 10.
- [‘wait’] This parameter
instructs the test program to wait for user input throughout the execution
of the test application.