You can use the ibdiagnet command to determine which links are at 1x bandwidth, 2.5 Gbps, or 5 Gbps data rate.
# ibdiagnet -lw 4x -ls 10 -pc -pm -skip all
In this instance of the ibdiagnet command, there is a check for all links to be at 4x QDR (-lw 4x -ls 10), and if not, to report those links that are not 4x QDR.
Note - Additionally, the ibdiagnet.log file contains the log of the testing.
Switch Reference, ibdiagnet command