Skip to content

Commit 160abdb

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

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
@@ -152,10 +152,10 @@ struct Endpoint {
152152

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

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

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

193194
PS_LOG(TRACE) << "qp created: pd=" << pd << " , cq=" << cq
194-
<< ", qp=" << id->qp->qp_num << ", maxInline=" << kMaxInlineSize;
195+
<< ", qp=" << id->qp->qp_num
196+
<< ", maxInline=" << kMaxInlineSize;
195197
if (inited == 0) {
196198
rdma_provider = provider;
197199
InitWRContextHelper(pd, start_ctx, kStartDepth, kRendezvousStartContext,
@@ -386,8 +388,7 @@ class RDMATransport : public Transport {
386388
WRContext *context = nullptr;
387389
endpoint_->free_start_ctx.WaitAndPop(&context);
388390

389-
RendezvousStart *req =
390-
reinterpret_cast<RendezvousStart *>(context->buffer);
391+
RendezvousStart *req = reinterpret_cast<RendezvousStart *>(context->buffer);
391392
req->meta_len = msg_buf->inline_len;
392393
req->origin_addr = reinterpret_cast<uint64_t>(msg_buf);
393394
req->data_num = msg_buf->data.size();
@@ -466,8 +467,7 @@ class RDMATransport : public Transport {
466467

467468
WRContext *reply_ctx_ptr = nullptr;
468469
endpoint_->free_reply_ctx.WaitAndPop(&reply_ctx_ptr);
469-
auto *resp =
470-
reinterpret_cast<RendezvousReply *>(reply_ctx_ptr->buffer);
470+
auto *resp = reinterpret_cast<RendezvousReply *>(reply_ctx_ptr->buffer);
471471

472472
// Populate reply with addresses and rkeys for both buffers
473473
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)