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