Skip to content

Commit a6a0851

Browse files
committed
Lint clean
Signed-off-by: Guangguan Wang <[email protected]>
1 parent 3140498 commit a6a0851

File tree

3 files changed

+24
-23
lines changed

3 files changed

+24
-23
lines changed

src/rdma_provider.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@
1818

1919
#ifdef DMLC_USE_RDMA
2020

21-
#include <string>
2221
#include <rdma/rdma_cma.h>
2322

24-
#include "dmlc/logging.h"
23+
#include <string>
24+
2525
#include "./ibvwarp.h"
26+
#include "dmlc/logging.h"
2627

2728
namespace ps {
2829

@@ -31,14 +32,14 @@ class RDMAProvider {
3132
static RDMAProvider *GetProvider(struct ibv_context *context);
3233

3334
virtual int InlineSize() = 0;
34-
virtual int SetQPLag(struct ibv_qp* qp, int port_num) = 0;
35+
virtual int SetQPLag(struct ibv_qp *qp, int port_num) = 0;
3536
virtual int ErrIgnore(struct ibv_wc *wc) = 0;
3637

3738
protected:
3839
RDMAProvider() {}
3940
};
4041

41-
class eRDMAProvider: public RDMAProvider {
42+
class eRDMAProvider : public RDMAProvider {
4243
public:
4344
static inline RDMAProvider *Get() {
4445
static RDMAProvider *inst_ptr = new eRDMAProvider();
@@ -62,12 +63,11 @@ class eRDMAProvider: public RDMAProvider {
6263
}
6364

6465
private:
65-
explicit eRDMAProvider() {}
66+
eRDMAProvider() {}
6667
};
6768

68-
class Mlx5Provider: public RDMAProvider {
69+
class Mlx5Provider : public RDMAProvider {
6970
public:
70-
7171
static inline RDMAProvider *Get() {
7272
static RDMAProvider *inst_ptr = new Mlx5Provider();
7373
return inst_ptr;
@@ -94,7 +94,7 @@ class Mlx5Provider: public RDMAProvider {
9494
}
9595

9696
private:
97-
explicit Mlx5Provider() {
97+
Mlx5Provider() {
9898
if (wrap_ibv_symbols() != 1) {
9999
PS_LOG(WARNING) << "Load mlx5 symbols fails.";
100100
}

src/rdma_transport.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,10 @@ struct Endpoint {
151151

152152
void SetNodeID(int id) { node_id = id; }
153153

154-
void InitWRContextHelper(struct ibv_pd *pd, WRContext *ctx,
155-
size_t num, WRContextType type,
156-
struct ibv_mr **mr, unsigned int access,
157-
ThreadsafeQueue<WRContext *> *queue = nullptr) {
154+
void InitWRContextHelper(struct ibv_pd *pd, WRContext *ctx, size_t num,
155+
WRContextType type, struct ibv_mr **mr,
156+
unsigned int access,
157+
ThreadsafeQueue<WRContext *> *queue = nullptr) {
158158
char *buf;
159159
aligned_malloc(reinterpret_cast<void **>(&buf), kMempoolChunkSize * num);
160160
PS_CHECK(buf);
@@ -172,7 +172,8 @@ struct Endpoint {
172172
}
173173
}
174174

175-
void Init(struct ibv_cq *cq, struct ibv_pd *pd, RDMAProvider *provider, rdma_cm_id *id = nullptr) {
175+
void Init(struct ibv_cq *cq, struct ibv_pd *pd, RDMAProvider *provider,
176+
rdma_cm_id *id = nullptr) {
176177
struct ibv_qp_init_attr attr;
177178
memset(&attr, 0, sizeof(ibv_qp_init_attr));
178179
attr.send_cq = cq;
@@ -190,7 +191,8 @@ struct Endpoint {
190191
kMaxInlineSize = attr.cap.max_inline_data;
191192

192193
PS_LOG(TRACE) << "qp created: pd=" << pd << " , cq=" << cq
193-
<< ", qp=" << id->qp->qp_num << ", maxInline=" << kMaxInlineSize;
194+
<< ", qp=" << id->qp->qp_num
195+
<< ", maxInline=" << kMaxInlineSize;
194196
if (inited == 0) {
195197
rdma_provider = provider;
196198
InitWRContextHelper(pd, start_ctx, kStartDepth, kRendezvousStartContext,
@@ -383,8 +385,7 @@ class RDMATransport : public Transport {
383385
WRContext *context = nullptr;
384386
endpoint_->free_start_ctx.WaitAndPop(&context);
385387

386-
RendezvousStart *req =
387-
reinterpret_cast<RendezvousStart *>(context->buffer);
388+
RendezvousStart *req = reinterpret_cast<RendezvousStart *>(context->buffer);
388389
req->meta_len = msg_buf->inline_len;
389390
req->origin_addr = reinterpret_cast<uint64_t>(msg_buf);
390391
req->data_num = msg_buf->data.size();
@@ -463,8 +464,7 @@ class RDMATransport : public Transport {
463464

464465
WRContext *reply_ctx_ptr = nullptr;
465466
endpoint_->free_reply_ctx.WaitAndPop(&reply_ctx_ptr);
466-
auto *resp =
467-
reinterpret_cast<RendezvousReply *>(reply_ctx_ptr->buffer);
467+
auto *resp = reinterpret_cast<RendezvousReply *>(reply_ctx_ptr->buffer);
468468

469469
// Populate reply with addresses and rkeys for both buffers
470470
resp->meta_addr = reinterpret_cast<uint64_t>(buf_ctx->meta_buffer);

src/rdma_van.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -782,14 +782,15 @@ class RDMAVan : public Van {
782782
continue;
783783
}
784784
PS_LOG(FATAL) << "Failed status \n"
785-
<< ibv_wc_status_str(wc[i].status) << " " << wc[i].status << " "
786-
<< static_cast<uint64_t>(wc[i].wr_id) << " " << wc[i].vendor_err
787-
<< " " << wc[i].opcode << " "
785+
<< ibv_wc_status_str(wc[i].status) << " "
786+
<< wc[i].status << " "
787+
<< static_cast<uint64_t>(wc[i].wr_id) << " "
788+
<< wc[i].vendor_err << " " << wc[i].opcode << " "
788789
<< (wc[i].opcode == IBV_WC_RECV ? "RECV" : "OTHER")
789-
<< " postoffice ptr: " << reinterpret_cast<void *>(postoffice_);
790+
<< " postoffice ptr: "
791+
<< reinterpret_cast<void *>(postoffice_);
790792
}
791793

792-
793794
// IBV_WC_RDMA_WRITE use msg_buf as the wr_id
794795
// so there won't be context and endpoint for this op
795796
if (wc[i].opcode == IBV_WC_RDMA_WRITE) {

0 commit comments

Comments
 (0)