1.\" 2.\" Copyright (c) 2016-2017 Alexander Motin <mav@FreeBSD.org> 3.\" All rights reserved. 4.\" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 1. Redistributions of source code must retain the above copyright 9.\" notice, this list of conditions and the following disclaimer. 10.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" notice, this list of conditions and the following disclaimer in the 12.\" documentation and/or other materials provided with the distribution. 13.\" 14.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24.\" SUCH DAMAGE. 25.\" 26.Dd October 11, 2020 27.Dt NTB_HW_INTEL 4 28.Os 29.Sh NAME 30.Nm ntb_hw_intel 31.Nd Intel(R) Non-Transparent Bridge driver 32.Sh SYNOPSIS 33To compile this driver into your kernel, 34place the following lines in your kernel configuration file: 35.Bd -ragged -offset indent 36.Cd "device ntb" 37.Cd "device ntb_hw_intel" 38.Ed 39.Pp 40Or, to load the driver as a module at boot, place the following line in 41.Xr loader.conf 5 : 42.Bd -literal -offset indent 43ntb_hw_intel_load="YES" 44.Ed 45.Sh DESCRIPTION 46The 47.Nm ntb_hw_intel 48driver provides support for the Non-Transparent Bridge (NTB) hardware in 49Intel Xeon E3/E5 and S1200 processor families, which allow one of their PCIe 50ports to be switched from transparent to non-transparent bridge mode. 51In this mode the bridge looks not like a PCI bridge, but like a PCI endpoint 52device. 53The driver hides hardware details, exposing memory windows, scratchpads 54and doorbells of the other side via a hardware independent KPI to the 55.Xr ntb 4 56subsystem. 57.Pp 58The hardware provides 2 or 3 memory windows to the other system's memory, 5916 scratchpad registers and 14, 31 or 34 doorbells to interrupt the other 60system, depending on the platform. 61On Xeon processors one of the memory windows is typically consumed by the driver 62itself to work around multiple hardware errata. 63.Sh CONFIGURATION 64The NTB configuration should be set by BIOS. 65It includes enabling NTB, choosing between NTB-to-NTB (back-to-back) or 66NTB-to-Root Port mode, 67enabling split BAR mode (one of two 64-bit BARs can be split into two 32-bit 68ones) and configuring BAR sizes in bits (from 12 to 29/39) for both NTB sides. 69.Pp 70The recommended configuration is NTB-to-NTB mode, split bar enabled and 71all BAR sizes set to 20 (1 MiB). 72This needs to be done on both systems. 73Note, on Xeon SkyLake and newer platforms, split bar mode is not available. 74.Sh SEE ALSO 75.Xr if_ntb 4 , 76.Xr ntb 4 , 77.Xr ntb_transport 4 78.Sh AUTHORS 79.An -nosplit 80The 81.Nm 82driver was developed by Intel and originally written by 83.An Carl Delsey Aq Mt carl@FreeBSD.org . 84Later improvements were done by 85.An Conrad E. Meyer Aq Mt cem@FreeBSD.org 86and 87.An Alexander Motin Aq Mt mav@FreeBSD.org . 88.Sh BUGS 89NTB-to-Root Port mode is not yet supported, but it doesn't look very useful. 90.Pp 91On Xeon v2/v3/v4 processors split BAR mode should be enabled to allow 92SB01BASE_LOCKUP errata workaround to be applied by the driver. 93.Pp 94There is no way to protect your system from malicious behavior on the other 95system once the link is brought up. 96Anyone with root or kernel access on the other system can read or write to 97any location on your system. 98In other words, only connect two systems that completely trust each other. 99