NTB_HW_PLX(4)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

πŸ’… ntb_hw_plx β€” the PLX/Avago/Broadcom Non-Transparent Bridge driver, bestie edition

okay so grab a snack πŸ“ because this is the ntb_hw_plx(4) page β€” it's a Kernel Interfaces Manual entry, and it's genuinely iconic once u get what it's doing. let's go πŸ’–


✨ NAME ✨

ntb_hw_plx β€” the PLX/Avago/Broadcom Non-Transparent Bridge driver. yes all three names, they're the same company, it's giving corporate rebrand era πŸ’€


🌸 SYNOPSIS 🌸

so to compile this driver into your kernel, u drop these lines into your kernel configuration file:

device ntb
device ntb_hw_plx

or, if ur more of a module-at-boot girlie, put this line in loader.conf(5):

ntb_hw_plx_load="YES"

the following tunables are settable from the loader(8):

  • hint.ntb_hw.X.b2b β€” set it to 1 (that's the default, bestie) and it tells the driver attached to the Virtual Interface of the NTB that it's working in NTB-to-NTB (back-to-back) mode. set it to 0 and it's NTB-to-Root Port instead. 🫢 the driver attached to the Link Interface (the one u can see from the Root Port side) switches to NTB-to-Root Port mode automatically β€” no help needed. but the one attached to the Virtual Interface literally cannot detect what's on the other side, so it requires external knowledge. iykyk πŸ‘€
  • hint.ntb_hw.X.split β€” set this above zero and it splits BAR2 into 2^x memory windows using the Address Lookup Table (A-LUT). math girlie behavior ✨

πŸ¦‹ DESCRIPTION πŸ¦‹

so ntb_hw_plx provides support for the Non-Transparent Bridge (NTB) hardware in PLX PCIe bridge chips. these chips let up to two of their PCIe ports get switched from transparent to non-transparent bridge mode πŸ”₯ and in this mode the bridge does not look like a PCI bridge β€” it looks like a PCI endpoint device. main character energy fr.

the driver hides all the hardware details and exposes the other side's memory windows, scratchpads and doorbells via a hardware independent KPI to the ntb(4) subsystem. the way it just… abstracts it all πŸ’…

every PLX NTB gives u up to 2 64-bit or 4 32-bit memory windows into the other system's memory, 6 or 12 scratchpad registers, and 16 doorbells to interrupt the other system. and if the Address Lookup Table (A-LUT) is enabled, BAR2 can be split into several memory windows β€” up to 128 of them πŸ‘‘

one lil detail: in NTB-to-NTB mode, one of the memory windows (or half of it, if it's bigger then 1MB) is consumed by the driver itself, so it can access the scratchpad and doorbell registers of the other side. it's paying rent basically πŸ™ˆ


πŸ’œ HARDWARE πŸ’œ

these PLX/Avago/Broadcom chips are supported by the ntb_hw_plx driver:

  • PEX 8713
  • PEX 8717
  • PEX 8725
  • PEX 8733
  • PEX 8749

…but ngl it may also work with other compatible ones 🌈


πŸŽ€ CONFIGURATION πŸŽ€

the basic chip configuration should be done by serial EEPROM or via i2c. that covers enabling NTB on one or both sides (choosing between NTB-to-NTB (back-to-back) and NTB-to-Root Port modes) and configuring BARs sizes.

the recommended mode is NTB-to-NTB mode, and here's why: NTB-to-Root Port is generally supported by the driver, but it requires PCI hotplug handling on the Root Port, which may be difficult or cause different kinds of problems 😭 so like… just don't, bestie.


⭐ SEE ALSO ⭐

if_ntb(4), ntb(4), ntb_transport(4) β€” go read them, they're the whole squad 🫢


πŸ‘‘ AUTHORS πŸ‘‘

the ntb_hw_plx driver was written by Alexander Motin <mav@FreeBSD.org>. king behavior, we stan πŸ’–


πŸ’€ BUGS πŸ’€

okay this is the serious part, listen up:

there is no way to protect your system from malicious behavior on the other system once the link is brought up. anyone with root or kernel access on the other system can read or write to any location on your system. in other words: only connect two systems that completely trust each other. periodt. πŸ”₯

and that's the whole page, bestie ✨ this Debian version dropped on November 9, 2019 β€” go off, 2019 πŸ’… πŸ¦‹

πŸ“¦ where this page comes from