Guest wrote:>> On the other hand, the NTB needs a BAR segment to control its behavior, e.g. sending doorbells to the other side. This is (maybe) also called "configuration" but it's actually regular memory mapped BAR registers.
This shed light. The message & doorbell registers are within the 4K config space of the NT function. You are saying that a BAR may be used for memory-mapping the config-space such that the other side "knows" where the registers of this side are. And vice-versa.
No, I'm actually saying something much simpler. The host needs to access these e.g. doorbells control registers somehow, so they have to be registers mapped on the host's memory map. So it's just a plain BAR, mapped by the BIOS like any peripheral's registers. Aside from that, there's this gateway region, which is another BAR, which is subject to traversing the bridge and having the addresses translated.
Guest wrote:>> The real catch is if the NTB's infrastructure (i.e. the PCIe lanes) may be used as a root port. In that case, the BIOS needs to be aware of the user's choice at bootup, and set some register accordingly. This is implementation-specific.
I don't think the BIOS needs to know. In fact, the NT is just another function for that same root port. The NTB transfers data via the NT function. The transparent bridge transfers data via the regular P2P function.
If the infrastructure is used as an NTB, then the outer world expects to see a bus device. If no NTB is used, why waste the hardware lines, when they can be used as a root port to connect other devices to it? In that case, the BIOS needs to enumerate whatever is attached to these lines. Hence the BIOS has to know at bootup what the choice was. But this is really not the topic here.
Eli