You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by ww...@apache.org on 2022/11/10 09:29:40 UTC
[incubator-brpc] branch master updated: Fall back to libibverbs.so.1 (#1985)
This is an automated email from the ASF dual-hosted git repository.
wwbmmm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-brpc.git
The following commit(s) were added to refs/heads/master by this push:
new 2a00420a Fall back to libibverbs.so.1 (#1985)
2a00420a is described below
commit 2a00420addf6e920c06100d85404337d5b84231f
Author: 372046933 <37...@users.noreply.github.com>
AuthorDate: Thu Nov 10 17:29:30 2022 +0800
Fall back to libibverbs.so.1 (#1985)
---
docs/cn/rdma.md | 4 ++--
docs/en/rdma.md | 4 ++--
src/brpc/rdma/rdma_helper.cpp | 10 ++++++++--
3 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/docs/cn/rdma.md b/docs/cn/rdma.md
index 645b285e..57a13964 100644
--- a/docs/cn/rdma.md
+++ b/docs/cn/rdma.md
@@ -24,9 +24,9 @@ make
使用bazel:
```bash
# Server
-bazel build example:rdma_performance_server
+bazel build --define=BRPC_WITH_RDMA=true example:rdma_performance_server
# Client
-bazel build example:rdma_performance_client
+bazel build --define=BRPC_WITH_RDMA=true example:rdma_performance_client
```
# 基本实现
diff --git a/docs/en/rdma.md b/docs/en/rdma.md
index e76a01de..e187807f 100644
--- a/docs/en/rdma.md
+++ b/docs/en/rdma.md
@@ -24,9 +24,9 @@ make
With bazel:
```bash
# Server
-bazel build example:rdma_performance_server
+bazel build --define=BRPC_WITH_RDMA=true example:rdma_performance_server
# Client
-bazel build example:rdma_performance_client
+bazel build --define=BRPC_WITH_RDMA=true example:rdma_performance_client
```
# Basic Implementation
diff --git a/src/brpc/rdma/rdma_helper.cpp b/src/brpc/rdma/rdma_helper.cpp
index 75de2e4f..536398c9 100644
--- a/src/brpc/rdma/rdma_helper.cpp
+++ b/src/brpc/rdma/rdma_helper.cpp
@@ -326,8 +326,14 @@ static void OnRdmaAsyncEvent(Socket* m) {
static int ReadRdmaDynamicLib() {
g_handle_ibverbs = dlopen("libibverbs.so", RTLD_LAZY);
if (!g_handle_ibverbs) {
- LOG(ERROR) << "Fail to load libibverbs.so due to " << dlerror();
- return -1;
+ LOG(WARNING) << "Failed to load libibverbs.so " << dlerror() << " try libibverbs.so.1";
+ // Clear existing error
+ dlerror();
+ g_handle_ibverbs = dlopen("libibverbs.so.1", RTLD_LAZY);
+ if (!g_handle_ibverbs) {
+ LOG(ERROR) << "Fail to load libibverbs.so.1 due to " << dlerror();
+ return -1;
+ }
}
LoadSymbol(g_handle_ibverbs, IbvGetDeviceList, "ibv_get_device_list");
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org