Skip to contentSkip to conversation

PCI-Express Non-Transparent Bridge Support

RFC Superseded Jon Mason 1 participant 1 message Sep 27, 2012

Subsystems (4)

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Jon Mason

author
#0 lore raw

RFC v4 1/2 PCI-Express Non-Transparent Bridge Support

A PCI-Express non-transparent bridge (NTB) is a point-to-point PCIe bus connecting 2 systems, providing electrical isolation between the two subsystems. A non-transparent bridge is functionally similar to a transparent bridge except that both sides of the bridge have their own independent address domains. The host on one side of the bridge will not have the visibility of the complete memory or I/O space on the other side of the bridge. To communicate across the non-transparent bridge, each NTB endpoint has one (or more) apertures exposed to the local system. Writes to these apertures are mirrored to memory on the remote system. Communications can also occur through the use of doorbell registers that initiate interrupts to the alternate domain, and scratch-pad registers accessible from both sides.

The NTB device driver is needed to configure these memory windows, doorbell, and scratch-pad registers as well as use them in such a way as they can be turned into a viable communication channel to the remote system. ntb_hw.[ch] determines the usage model (NTB to NTB or NTB to Root Port) and abstracts away the underlying hardware to provide access and a common interface to the doorbell registers, scratch pads, and memory windows. These hardware interfaces are exported so that other, non-mainlined kernel drivers can access these. ntb_transport.[ch] also uses the exported interfaces in ntb_hw.[ch] to setup a communication channel(s) and provide a reliable way of transferring data from one side to the other, which it then exports so that "client" drivers can access them. These client drivers are used to provide a standard kernel interface (i.e., Ethernet device) to NTB, such that Linux can transfer data from one system to the other in a standard way.

---
 MAINTAINERS                 |    6 +
 drivers/Kconfig             |    2 +
 drivers/Makefile            |    1 +
 drivers/ntb/Kconfig         |   13 +
 drivers/ntb/Makefile        |    3 +
 drivers/ntb/ntb_hw.c        | 1167 +++++++++++++++++++++++++++++++++++
 drivers/ntb/ntb_hw.h        |  195 ++++++
 drivers/ntb/ntb_regs.h      |  139 +++++
 drivers/ntb/ntb_transport.c | 1401 +++++++++++++++++++++++++++++++++++++++++++
 include/linux/ntb.h         |   81 +++
 10 files changed, 3008 insertions(+)
 create mode 100644 drivers/ntb/Kconfig
 create mode 100644 drivers/ntb/Makefile
 create mode 100644 drivers/ntb/ntb_hw.c
 create mode 100644 drivers/ntb/ntb_hw.h
 create mode 100644 drivers/ntb/ntb_regs.h
 create mode 100644 drivers/ntb/ntb_transport.c
 create mode 100644 include/linux/ntb.h
MAINTAINERS +6 -0
index 53cc13c..a634314 100644
@@ -4849,6 +4849,12 @@ S:	Maintained
 F:	Documentation/scsi/NinjaSCSI.txt
 F:	drivers/scsi/nsp32*
 
+NTB DRIVER
+M:	Jon Mason <[email protected]>
+S:	Supported
+F:	drivers/ntb/
+F:	include/linux/ntb.h
+
 NTFS FILESYSTEM
 M:	Anton Altaparmakov <[email protected]>
 L:	[email protected]
drivers/Kconfig +2 -0
index ece958d..dccaa52 100644
@@ -152,4 +152,6 @@ source "drivers/vme/Kconfig"
 
 source "drivers/pwm/Kconfig"
 
+source "drivers/ntb/Kconfig"
+
 endmenu
drivers/Makefile +1 -0
index 5b42184..dfa5978 100644
@@ -139,3 +139,4 @@ obj-$(CONFIG_EXTCON)		+= extcon/
 obj-$(CONFIG_MEMORY)		+= memory/
 obj-$(CONFIG_IIO)		+= iio/
 obj-$(CONFIG_VME_BUS)		+= vme/
+obj-$(CONFIG_NTB)		+= ntb/
drivers/ntb/Kconfig new file +13 -0
new file mode 100644
index 0000000..f69df793
@@ -0,0 +1,13 @@
+config NTB
+       tristate "Intel Non-Transparent Bridge support"
+       depends on PCI
+       depends on X86
+       help
+        The PCI-E Non-transparent bridge hardware is a point-to-point PCI-E bus
+        connecting 2 systems.  When configured, writes to the device's PCI
+        mapped memory will be mirrored to a buffer on the remote system.  The
+        ntb Linux driver uses this point-to-point communication as a method to
+        transfer data from one system to the other.
+
+        If unsure, say N.
+
drivers/ntb/Makefile new file +3 -0
new file mode 100644
index 0000000..15cb59f
@@ -0,0 +1,3 @@
+obj-$(CONFIG_NTB) += ntb.o
+
+ntb-objs := ntb_hw.o ntb_transport.o
drivers/ntb/ntb_hw.c new file +1167 -0

1,167 lines not on this page · raw message

drivers/ntb/ntb_hw.h new file +195 -0

195 lines not on this page · raw message

drivers/ntb/ntb_regs.h new file +139 -0

139 lines not on this page · raw message

drivers/ntb/ntb_transport.c new file +1401 -0

1,401 lines not on this page · raw message

include/linux/ntb.h new file +81 -0

60 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.7.9.5

Part of the diff is not shown here. View the raw message.