一直以来查各种资料都没有得到一个很明确的有关MSI中断方式和MSI-X中断方式的区别,今天看Broadcom的网卡手册意外看到这样一句:
MSI Version. This is the Message Signaled Interrupts (MSI) version being used. The option MSI corresponds to the PCI 2.2 specification that supports 32 messages and a single MSI address value. The option MSI-X corresponds to the PCI 3.0 specification that supports 2,048 messages and an independent message address for each message.
大概解释:
MSI方式的中断对应PCI 2.2规范,单个MSI地址,支持32个消息;而MSI-X方式的中断对应PCI3.0规范,支持2048个消息且每个消息可对应一个独立的MSI地址。
总算明白了,实际应用场景中,MSI方式的中断对多核cpu的利用情况不佳,网卡中断全部落在某一个cpu上,即使设置cpu affinity也没有作用,而MSI-X中断方式可以自动在多个cpu上分担中断。