GTS AXI Streaming Intel® FPGA IP for PCI Express* User Guide

ID 813754
Date 8/07/2024
Public
Document Table of Contents

4.5.3. Message Signal Interrupt Extended (MSI-X)

The user application generates MSI-X messages which are single-Dword memory writes. The MSI-X Capability structure points to an MSI-X table structure and an MSI-X Pending Bit Array (PBA) structure which are stored in memory. This scheme is different than the MSI Capability structure, which contains all the control and status information for the interrupts.

The GTS AXI Streaming IP provides a Configuration Intercept Interface. User soft logic monitors this interface to get MSI-X Enable and MSI-X function mask related information. User application logic implements the MSI-X tables for all PFs and VFs at the memory space pointed to by the BARs as a part of your Application Layer. For more information on the MSI-X related information that you can obtain from the Configuration Intercept Interface, refer to the MSI-X Registers section in the PCI Express* Configuration Space section.

MSI-X is an optional feature that allows the user application to support large number of vectors with independent message data and address for each vector. When MSI-X is supported, you must specify the size and the location (BARs and offsets) of the MSI-X table and PBA.

MSI-X can support up to 2048 vectors per function versus 32 vectors per function for MSI. A function is allowed to send MSI-X messages when MSI-X is enabled and the function is not masked. The application uses Configuration Intercept Interface to access this information.

When the application needs to generate an MSI-X, it uses the contents of the MSI-X Table (Address and Data) and generates a Memory Write through the GTS AXI Streaming interface.

If you enable the MSI-X interrupt, you must implement the MSI-X table structures at the memory space pointed to by the BARs as a part of your Application Layer. The MSI-X Capability Structure contains information about the MSI-X Table and PBA Structure. For example, it contains pointers to the bases of the MSI-X Table and PBA Structure, expressed as offsets from the addresses in the function's BARs. The Message Control register within the MSI-X Capability Structure also contains the MSI-X Enable bit, the Function Mask bit, and the size of the MSI-X Table.

MSI-X interrupts are standard Memory Writes, therefore Memory Write ordering rules apply.

Table 13.  MSI-X Configuration Example
MSI-X Vector MSI-X Upper Address MSI-X Lower Address MSI-X Data
0 0x00000001 0xAAAA0000 0x00000001
1 0x00000001 0xBBBB0000 0x00000002
2 0x00000001 0xCCCC0000 0x00000003
Table 14.  PBA Table Example
PBA Table PBA Entries
Offset 0 0x0

If the application needs to generate an MSI-X interrupt (vector 1), it reads the MSI-X Table information, generates a MWR TLP through the Avalon® streaming interface and asserts the corresponding PBA bits (bit[1]) in a similar fashion as for MSI generation.

The generated TLP is sent to address 0x00000001_BBBB0000 and the data is 0x00000002. When the MSI-X has been sent, the application can clear the associated PBA bits. The MSI-X capability structure points to the MSI-X Table structure and MSI-X Pending Bit Array (PBA) registers. The BIOS sets up the starting address offsets and BAR associated with the pointer to the starting address of the MSI-X Table and PBA registers.

Figure 20. MSI-X Interrupt Component
  1. Host software sets up the MSI-X interrupts in the Application Layer by completing the following steps:
    • Host software reads the Message Control register at 0x050 register to determine the MSI-X Table size. The number of table entries is the <value read> + 1. The maximum table size is 2048 entries. Each 16-byte entry is divided in 4 fields as shown in the figure below. For multi-function variants, BAR4 accesses the MSI-X table. For all other variants, any BAR can access the MSI-X table. The base address of the MSI-X table must be aligned to a 4 KB boundary.
    • The host sets up the MSI-X table. It programs MSI-X address, data, and masks bits for each entry as shown in the figure below.
      Figure 21. Format of MSI-X Table
    • The host calculates the address of the <nth> entry using the following formula:
      nth_address = base address[BAR]+16<n>
  2. When Application Layer needs to issue an interrupt, it drives an interrupt request to the IRQ Source module.
  3. 3. The IRQ Sources sets appropriate bit in the MSI-X PBA table. The PBA can use qword or dword accesses. For qword accesses, the IRQ Source calculates the address of the <mth> bit using the following formulas:
    qword address = <PBA base addr> + 8(floor(<m>/64))
    qword bit = <m> mod 64
    
    Figure 22. MSI-X PBA Table
  4. The IRQ Processor reads the entry in the MSI-X Table.
    • If the interrupt is masked by the Vector_Control field of the MSI-X table, the interrupt remains in the pending state.
    • If the interrupt is not masked, IRQ Processor sends Memory Write Request to the TX slave interface. It uses the address and data from the MSI-X table. If Message Upper Address =0, the IRQ Processor creates a three-dword header. If the Message Upper Address > 0, it creates a 4-dword header.
  5. The host interrupt service routine detects the TLP as an interrupt and service it.