Skip to content

Commit 26b3a37

Browse files
lsgunthjonmason
authored andcommitted
NTB: Introduce MSI library
The NTB MSI library allows passing MSI interrupts across a memory window. This offers similar functionality to doorbells or messages except will often have much better latency and the client can potentially use significantly more remote interrupts than typical hardware provides for doorbells. (Which can be important in high-multiport setups.) The library utilizes one memory window per peer and uses the highest index memory windows. Before any ntb_msi function may be used, the user must call ntb_msi_init(). It may then setup and tear down the memory windows when the link state changes using ntb_msi_setup_mws() and ntb_msi_clear_mws(). The peer which receives the interrupt must call ntb_msim_request_irq() to assign the interrupt handler (this function is functionally similar to devm_request_irq()) and the returned descriptor must be transferred to the peer which can use it to trigger the interrupt. The triggering peer, once having received the descriptor, can trigger the interrupt by calling ntb_msi_peer_trigger(). Signed-off-by: Logan Gunthorpe <[email protected]> Cc: Dave Jiang <[email protected]> Cc: Allen Hubbe <[email protected]> Signed-off-by: Jon Mason <[email protected]>
1 parent d217e07 commit 26b3a37

File tree

4 files changed

+501
-1
lines changed

4 files changed

+501
-1
lines changed

drivers/ntb/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@ menuconfig NTB
1212

1313
if NTB
1414

15+
config NTB_MSI
16+
bool "MSI Interrupt Support"
17+
depends on PCI_MSI
18+
help
19+
Support using MSI interrupt forwarding instead of (or in addition to)
20+
hardware doorbells. MSI interrupts typically offer lower latency
21+
than doorbells and more MSI interrupts can be made available to
22+
clients. However this requires an extra memory window and support
23+
in the hardware driver for creating the MSI interrupts.
24+
25+
If unsure, say N.
1526
source "drivers/ntb/hw/Kconfig"
1627

1728
source "drivers/ntb/test/Kconfig"

drivers/ntb/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
obj-$(CONFIG_NTB) += ntb.o hw/ test/
22
obj-$(CONFIG_NTB_TRANSPORT) += ntb_transport.o
33

4-
ntb-y := core.o
4+
ntb-y := core.o
5+
ntb-$(CONFIG_NTB_MSI) += msi.o

0 commit comments

Comments
 (0)