Skip to content

Commit

Permalink
NTB: Introduce MSI library
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
lsgunth authored and jonmason committed Jun 13, 2019
1 parent d217e07 commit 26b3a37
Show file tree
Hide file tree
Showing 4 changed files with 501 additions and 1 deletion.
11 changes: 11 additions & 0 deletions drivers/ntb/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ menuconfig NTB

if NTB

config NTB_MSI
bool "MSI Interrupt Support"
depends on PCI_MSI
help
Support using MSI interrupt forwarding instead of (or in addition to)
hardware doorbells. MSI interrupts typically offer lower latency
than doorbells and more MSI interrupts can be made available to
clients. However this requires an extra memory window and support
in the hardware driver for creating the MSI interrupts.

If unsure, say N.
source "drivers/ntb/hw/Kconfig"

source "drivers/ntb/test/Kconfig"
Expand Down
3 changes: 2 additions & 1 deletion drivers/ntb/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
obj-$(CONFIG_NTB) += ntb.o hw/ test/
obj-$(CONFIG_NTB_TRANSPORT) += ntb_transport.o

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

0 comments on commit 26b3a37

Please sign in to comment.