Generally speaking, loopback devices for InfiniBand protocol based equipment is not as trivial as looping back few wires towards the port itself. It is a bit more involved due to the nature of paths static routes the IB network.
I am not aware of any loopback device that is available today for IB user testing.
As for the port mirroring capability, it is not supported on this device.
I pretty much did not help you with what you were looking to achieve, but I welcome you to contact Mellanox support and challenge the group. Maybe they can find another way of helping here.
Also, there is no bash shell configuration option on an SB7700 running MLNX-OS.
Configurations can be done vie the CI or via the web GUI.
If you are simply looking for a simple way to test port and cable functionality prior to installing a switch, you can link up a port using this simple process:
1) Connect two ports on this same switch with a proper 100Gb EDR Mellanox InfiniBand cable
2) Launch Subnet Manager (OpenSM) process on the switch (config# ib sm,,,and see it is enabled with "show ib sm".
3) The ports will link up and you can view port details with "show interface IB 1/x", or "show interface IB 1/x counters" (where x is appropriate port #)
IB ports are enabled by default, and no port configuration is needed. Ports and cables are "clean" if you see no errors or discards in the port statistics output.
You can also connect two IB adapter ports to the switch (using 2 cables), and launch OpenSM on a server (or on the switch). Then you can generate traffic on one adapter port and receive it on another.
I hope this helps,