OSDN Git Service

ntb_hw_switchtec: Add initialization code for crosslink
authorLogan Gunthorpe <logang@deltatee.com>
Wed, 29 Nov 2017 17:55:29 +0000 (10:55 -0700)
committerJon Mason <jdmason@kudzu.us>
Mon, 29 Jan 2018 03:17:23 +0000 (22:17 -0500)
commit01752501820277d217a7b52548d9c948f98d2c56
tree41b9a2ccd2cd66122e97bde970454ace30302c7a
parent45f447deb29081a7df7b81f2cd9cc8121994d988
ntb_hw_switchtec: Add initialization code for crosslink

Crosslink is a feature of the Switchtec switches that is similar to
the B2B mode of other NTB devices. It allows a system to be designed
that is perfectly symmetric with two identical switches that link
two hosts together.

In order for the system to be symmetric, there is an empty host-less
partition between the two switches which the host must enumerate and
assign BAR addresses to. The firmware in the switch manages this
specially so that the BAR addresses on both sides of the empty
partition will be identical despite being in the same partition with
the same address space.

The driver determines whether crosslink is enabled by a flag set in
the NTB partition info registers which are set by the switch's
configuration file.

When crosslink is enabled, a reserved LUT window is setup to point to
the peer's switch's NTB registers and the local MWs are set to forward
to the host-less partition's BARs. (Yes, this hurts my brain too.)
Once this is setup, largely the same NTB infrastructure is used to
communicate between the two hosts.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
drivers/ntb/hw/mscc/ntb_hw_switchtec.c
include/linux/ntb.h