Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

How to request multiply MSI interrupts?

Hi !!!

Developing a network device driver on Arria2 GX (Avalon-ST).

Is it possible to set a vector of 8 MSI interrupts , if the design supports only MSI interrupts, not MSI - X?

From the side of device driver developer - to request 8 separate interrupt handlers, to handle 8 packet queues.

pci_enable_msi_block() returns 1.This means, that it's possible to request only 1 interrupt line.

The capabilities of device:

Capabilities: [78] Power Management version 3

Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)

Status: D0 PME-Enable- DSel=0 DScale=0 PME-

Capabilities: [80] Express (v1) Endpoint, MSI 00

DevCap: MaxPayload 256 bytes, PhantFunc 0, Latency L0s <64ns, L1 <1us

ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-

DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-

RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+

MaxPayload 128 bytes, MaxReadReq 512 bytes

DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-

LnkCap: Port# 1, Speed 2.5GT/s, Width x4, ASPM L0s, Latency L0 unlimited, L1 unlimited

ClockPM- Suprise- LLActRep- BwNot-

LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk+

ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-

LnkSta: Speed 2.5GT/s, Width x4, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-

Developing under Linux.

Best Regards,

Igor

39 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Ok

    I already know about this book. Now my concern is to

    create a simple design which handle MSI for test purpose first.

    Hopefully the Interrupt Request Line (MSI=1) would be enough for the driver to handle several I/O Devices(6 UARTs, 1 CAN, others).

    That is for my Internship.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Linux Device Driver Third Edition , Essential Linux Device drivers will help you

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    MSI = 1 means that the driver if able to request 1 interrupt line.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    You have to choose MSI-X or MSI in Quartus. Also to set number of vectors. Driver than is able to request irqs, which you have specified in yours design. Are you writing driver for Linux?

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Ok but with my Cyclone IV GX I have MSI= 1

    1) what that means? Vector or just one Interrupt?

    can handled multiple Interrupts with this capabilty parameter?

    2) Secondly How can I set the MSIx Interrupt Handling instead of MSI with ALTERA.(with my software or is there any configuration setting with PCI Express Compiler)
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    HI

    pci_enable_msi (struct pci_dev * dev);

    pci_enable_msi_block (struct pci_dev * dev, unsigned int nvec); (On x86 arch patch is needed).

    If H/W is capable, use MSI-X interrupts instead MSI.

    Regards,

    Igor
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi

    please I am newbie on MSI with ALTERA:

    Do you have a piece of code as example implementing PCIe Driver with MSI?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi,

    Thank's for reply

    I've missed that piece of lspci.

    Capabilities: [50] Message Signalled Interrupts: Mask- 64bit+ Queue=0/5 Enable+

    Address: 00000000fee0300c Data: 41a1

    Now I am able to request multiply MSI's.

    There is a kernel patch , which allow's multiply MSI's on x86 arch.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    The Capabilities' field imply that you only have one MSI enabled on your FPGA. It should read MSI 07 instead of MSI 00.