Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rdma typo #1398

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/brpc/rdma/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
# Using RDMA
## Compile brpc with RDMA support

To use brpc with RDMA, please make sure you have built brpc with WITH_RDMA option first.

```bash

$ cmake -DWITH_RDMA=on . # in project's directory

$ make -j

```

## Using RDMA

To use rdma, please set the ChannelOptions and ServerOptions like this:

Expand Down
6 changes: 3 additions & 3 deletions src/brpc/rdma/rdma_communication_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ DEFINE_int32(rdma_conn_timeout_ms, 30000,
"The timeout (ms) for RDMA connection establishment.");
#endif

static const int FLOW_CONTROL = 1; // for creating QP
static const int RETRY_COUNT = 1; // for creating QP
static const int RNR_RETRY_COUNT = 0; // for creating QP
static const uint8_t FLOW_CONTROL = 1; // for creating QP
static const uint8_t RETRY_COUNT = 1; // for creating QP
static const uint8_t RNR_RETRY_COUNT = 0; // for creating QP

RdmaCommunicationManager::RdmaCommunicationManager(void* cm_id)
: _cm_id(cm_id)
Expand Down
14 changes: 7 additions & 7 deletions src/brpc/rdma/rdma_completion_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,20 +218,20 @@ void RdmaCompletionQueue::CleanUp() {

if (IsRdmaAvailable()) {
if (cq) {
if (cq_channel) {
IbvAckCqEvents(cq, _cq_events);
}
if (cq_channel) {
IbvAckCqEvents(cq, _cq_events);
}
if (IbvDestroyCq(cq) < 0) {
PLOG(WARNING) << "Fail to destroy rdma cq";
}
_cq = NULL;
if (cq_channel) {
if (cq_channel) {
if (IbvDestroyCompChannel(cq_channel) < 0) {
PLOG(WARNING) << "Fail to destroy rdma cq channel";
}
_cq_channel = NULL;
}
}
_cq_channel = NULL;
}
}
}
_cq_events = 0;
if (_sid > 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/brpc/rdma/rdma_endpoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "brpc/socket.h"
#include "brpc/rdma/rdma_communication_manager.h"
#include "brpc/rdma/rdma_completion_queue.h"
#include <brpc/rdma/spsc_queue.h>
#include "brpc/rdma/spsc_queue.h"

namespace brpc {
namespace rdma {
Expand Down
2 changes: 0 additions & 2 deletions src/brpc/rdma/rdma_traffic_control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ namespace brpc {
namespace rdma {

extern bool g_rdma_traffic_enabled;
extern std::vector<brpc::SocketId> g_disabled_conns;
extern butil::atomic<bool> g_written;

void RdmaTrafficControlServiceImpl::TurnOn(
google::protobuf::RpcController* cntl_base,
Expand Down
2 changes: 1 addition & 1 deletion src/brpc/rdma/spsc_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#ifndef BRPC_RDMA_SPSC_QUEUE_H
#define BRPC_RDMA_SPSC_QUEUE_H

#include <butil/atomicops.h>
#include "butil/atomicops.h"

namespace brpc {
namespace rdma {
Expand Down