37rpr::Core::Core(
const std::string& deviceName,
43 deviceName_(deviceName),
46 maxPayload_(maxPayload) {
56 struct ibv_device** devList = ibv_get_device_list(&numDevices);
57 if (!devList || numDevices == 0) {
58 if (devList) ibv_free_device_list(devList);
60 "No RDMA devices found on this host"));
63 struct ibv_device* dev =
nullptr;
64 for (
int i = 0; i < numDevices; ++i) {
65 if (
deviceName_ == ibv_get_device_name(devList[i])) {
72 ibv_free_device_list(devList);
74 "RDMA device '%s' not found",
78 ctx_ = ibv_open_device(dev);
79 ibv_free_device_list(devList);
83 "Failed to open RDMA device '%s'",
94 ibv_close_device(
ctx_);
97 "Failed to allocate protection domain"));
100 log_->info(
"Opened RoCEv2 device '%s', port %u, GID index %u",