As I understand it, the subnet manager of an Infiniband network calculates the best routes between each pair of nodes on the network and provides these routes to the nodes when they want to communicate. Is there any way to get the subnet manager (and in particular, OpenSM) to print out these routing tables in a human-readable fashion?
At the moment this is purely for my own curiosity, but I can imagine cases where this would be useful for debugging.
In OpenFabrics, the infiniband-diags package comes with a tool called "ibroute" that should do exactly what you're asking for. There is a script called "dump_lfts.sh" in infiniband-diags that wraps around ibroute and will output the routing tables for all the switches in your fabric.
There are other scripts out there to wrap around these for further debugging/routing analysis, but I'll leave that for another answer.
Update:
A colleague reminded me there is a mechanism in OpenSM to do this too. I haven't personally used it, but for completeness, here's the relevant portion from the OpenSM manpage:
The command
will create the file
/var/tmp/ibdiagnet2/ibdiagnet2.fdbs
, which contains the unicast routing tables of all switches and the file/var/tmp/ibdiagnet2/ibdiagnet2.mcfdbs
, which contains the multicast routing tables of all switches. To facilitate the interpretation one should remove all lines ending in UNREACHABLE.