MCPcopy Create free account
hub / github.com/apache/brpc / DoPostRecv

Method DoPostRecv

src/brpc/rdma/rdma_endpoint.cpp:1049–1066  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1047}
1048
1049int RdmaEndpoint::DoPostRecv(void* block, size_t block_size) {
1050 ibv_recv_wr wr;
1051 memset(&wr, 0, sizeof(wr));
1052 ibv_sge sge;
1053 sge.addr = (uint64_t)block;
1054 sge.length = block_size;
1055 sge.lkey = GetRegionId(block);
1056 wr.num_sge = 1;
1057 wr.sg_list = &sge;
1058
1059 ibv_recv_wr* bad = NULL;
1060 int err = ibv_post_recv(_resource->qp, &wr, &bad);
1061 if (err != 0) {
1062 LOG(WARNING) << "Fail to ibv_post_recv: " << berror(err);
1063 return -1;
1064 }
1065 return 0;
1066}
1067
1068int RdmaEndpoint::PostRecv(uint32_t num, bool zerocopy) {
1069 // We do the post repeatedly from the _rbuf[_rq_received].

Callers

nothing calls this directly

Calls 2

GetRegionIdFunction · 0.85
berrorFunction · 0.85

Tested by

no test coverage detected