hololink::module::ibv_device_for_peer
hololink::module::ibv_device_for_peer
Find the InfiniBand verbs device and port through which this host reaches a device.
A RoCE receiver must use the network adapter that is actually connected to the device it receives from. When the host has more than one adapter, this identifies the right one: the adapter on the network interface used to reach peer_ip. Pass the result as the ibv_name and ibv_port of RoceReceiverInterfaceV1::start().
Only RoCE builds provide this function, since it uses the ibverbs library.
Returns: The device name (for example "roceP5p3s0f0") and the port number on that device. If more than one device and port match, the first one the system lists is returned.
Throws: std::runtime_error if the list of devices cannot be read, or no device and port is bound to the network interface. The message names peer_ip and, in the second case, the interface.
Parameters
IP address of the device. It is used to identify the network interface only when interface is not given; it is also named in error messages.
Name of the host’s network interface that is connected to the device, as recorded in the enumeration metadata under “interface” (the interface on which the device’s enumeration message arrived). Pass it whenever it is available. If empty, the interface is chosen by the host’s routing table for peer_ip, which gives the wrong answer when two devices share the same default data-plane subnet (192.168.0.x): both resolve to the same adapter, and frames from the other device are never received.