Commit 790ba763 authored by Paras Garg's avatar Paras Garg

changed message formats combined to single header for all message type

parent 5cf929e3
......@@ -13,13 +13,13 @@ public:
inline bool operator()(const struct ibv_wc* c1,const struct ibv_wc* c2)
const
{
struct SalRequestHeader *req1 = (struct SalRequestHeader *)c1->wr_id;
struct SalRequestHeader *req2 = (struct SalRequestHeader *)c2->wr_id;
struct MessageHeader *req1 = (struct MessageHeader *)c1->wr_id;
struct MessageHeader *req2 = (struct MessageHeader *)c2->wr_id;
if(req1->keySize != req2->keySize)
return true;
char* key1 = (char*)req1+SalRequestHeaderSize;
char* key2 = (char*)req2+SalRequestHeaderSize;
for(int i=0;i<req1->keySize;i++)
char* key1 = (char*)req1+MessageHeaderSize;
char* key2 = (char*)req2+ MessageHeaderSize;
for(uint32_t i=0;i<req1->keySize;i++)
{
if(key1[i]!=key2[i])
return true;
......
#ifndef __MessageFormats__
#define __MessageFormats__
enum RequestType
enum MessageType
{
GET,
PUT,
DELETE
};
enum ResponseStatus
{
SUCCESS,
FAILURE,
INVALIDATE
GET = (1u << 0),
PUT = (1u << 1),
DELETE = (1u << 2),
INVALIDATE = (1u << 3),
SUCCESS = (1u << 4),
FAILURE = (1u <<5)
};
struct __attribute__ ((__packed__)) SalRequestHeader
struct __attribute__ ((__packed__)) MessageHeader
{
uint32_t id;
enum RequestType type;
enum MessageType type;
uint32_t keySize;
uint32_t valueSize;
};
static const uint32_t MessageHeaderSize = sizeof(MessageHeader);
/*
struct __attribute__ ((__packed__)) SalResponseHeader
{
uint32_t id;
enum ResponseStatus status;
/*
* Note value will be present only in case of response status is success
*/
enum MessageType status;
//Note value will be present only in case of response status is success
uint32_t valueSize;
};
struct __attribute__ ((__packed__)) InvRequestHeader
{
uint32_t id;
enum ResponseStatus type;
enum MessageType type;
uint32_t keySize;
};
......@@ -42,11 +40,12 @@ struct __attribute__ ((__packed__)) InvRequestHeader
struct __attribute__ ((__packed__)) InvResponseHeader
{
uint32_t id;
enum ResponseStatus status;
enum MessageType status; MessageHeader
};
static uint32_t SalRequestHeaderSize = sizeof(SalRequestHeader);
*/
/*
static uint32_t SalResponseHeaderSize = sizeof(SalResponseHeader);
static uint32_t InvRequestHeaderSize = sizeof(InvRequestHeader);
static uint32_t InvResponseHeaderSize = sizeof(InvResponseHeader);
*/
#endif
\ No newline at end of file
......@@ -11,7 +11,6 @@
#include "Executor.hpp"
#include "Logger.hpp"
class RdmaRepCqProcessor
{
public:
......@@ -21,91 +20,12 @@ public:
bool _stop{false};
Executor *_executor{NULL};
RdmaRepCqProcessor(Executor *ex, ibv_context *verbs, int compQueueSize)
: _executor(ex)
{
_compChannel = ibv_create_comp_channel(verbs);
if (_compChannel == NULL)
{
std::cout << "CqProcessr : ibv_create_comp_channel failed\n";
return;
}
_completionQueue = ibv_create_cq(verbs, compQueueSize, NULL, _compChannel, 0);
if (_completionQueue == NULL)
{
std::cout << "CqProcessr : ibv_create_cq failed" << std::endl;
return;
}
int ret = ibv_req_notify_cq(_completionQueue, 0);
if (ret)
{
std::cout << "CqProcessr : ibv_req_notify_cq failed\n";
}
}
struct ibv_cq *getCq()
{
return _completionQueue;
}
void start()
{
std::cout << "CqProcessr : starting process CQ events" << std::endl;
_compQueueThread = new std::thread(&RdmaRepCqProcessor::processCQEvents, this);
pthread_setname_np(_compQueueThread->native_handle(),"RepCQ");
}
void processCQEvents()
{
int ret = 0;
struct ibv_cq *cq;
void *context;
const int nevent = 10;
struct ibv_wc *wc_array = new struct ibv_wc[nevent];
while (!_stop)
{
ret = ibv_get_cq_event(_compChannel, &cq, &context);
if (ret == -1)
{
std::cout << "CqProcessr : ibv_get_cq_event failed\n";
close();
}
ibv_ack_cq_events(cq, 1);
ret = ibv_req_notify_cq(_completionQueue, 0);
if (ret)
{
std::cout << "CqProcessr : ibv_req_notify_cq failed\n";
close();
}
ret = ibv_poll_cq(cq, nevent, wc_array);
if (ret < 0)
{
std::cout << "CqProcessr : ibv_poll_cq failed\n";
close();
}
if (ret == 0)
continue;
for (int i = 0; i < ret; i++)
{
struct ibv_wc *data = new struct ibv_wc(wc_array[i]);
//data->vendor_err = 1;
//_executor->submit(data);
/*
* created new thread because currently we are not getting data from followers
*/
new std::thread(&RdmaRepCqProcessor::processRepEvent, this,data);
}
//_executor->dispatchRepCqEvents(wc_array, ret);
}
}
void processRepEvent(struct ibv_wc* data)
{
std::cout<<"procesing Replication request"<<std::endl;
}
void close()
{
_stop = true;
if (_compQueueThread != NULL)
_compQueueThread->join();
}
RdmaRepCqProcessor(Executor *ex, ibv_context *verbs, int compQueueSize);
struct ibv_cq *getCq();
void start();
void processCQEvents();
void processRepEvent(struct ibv_wc *data);
void close();
};
#endif
......@@ -23,9 +23,9 @@ public:
void processCqEvent(struct ibv_wc wc);
void processSendCompletion(struct ibv_wc *data);
void processRecvCompletion(struct ibv_wc *data);
void processDelete(struct SalRequestHeader *);
void processGet(struct SalRequestHeader *req);
void processPut(struct SalRequestHeader *req);
void processDelete(struct MessageHeader *);
void processGet(struct MessageHeader *req);
void processPut(struct MessageHeader *req);
int sendMessage(const char *buffer, uint32_t size);
void close();
};
......
......@@ -4,7 +4,6 @@
- [] failure detection and recovery
- [] explore multicast
- [x] Added logging api
- [ ] Add future in client
- [ ] add multi server in client
- [ ] add yscb
- [ ] add dynamic hashing in client code
......
......@@ -11,7 +11,7 @@ Executor::Executor(int size, RdmaEndpointGroup *group)
_taskThreads->push_back(thread);
}
}
void Executor::submit(struct ibv_wc *task)
void Executor::submit(struct ibv_wc *task)
{
_taskQueue->push(task);
}
......
......@@ -4,11 +4,11 @@
RdmaCmProcessor::RdmaCmProcessor(RdmaEndpointGroup *group)
: _endpointGroup(group)
{
CPPLOG::LOG_INFO("CMProcessor : Step 1 creating event channel\n");
CPPLog::LOG_INFO("CMProcessor : Step 1 creating event channel\n");
_eventChannel = rdma_create_event_channel();
if (_eventChannel == NULL)
{
CPPLOG::LOG_ERROR( "CMProcesor : error creating event channel\n");
CPPLog::LOG_ERROR( "CMProcesor : error creating event channel\n");
}
}
......@@ -17,7 +17,7 @@ struct rdma_cm_id *RdmaCmProcessor::createId()
struct rdma_cm_id *id = NULL;
int ret = rdma_create_id(_eventChannel, &id, NULL, RDMA_PS_TCP);
if (ret == -1)
CPPLOG::LOG_ERROR("CMProcesor : rdma_create_id failed\n");
CPPLog::LOG_ERROR("CMProcesor : rdma_create_id failed\n");
return id;
}
......@@ -25,20 +25,20 @@ void RdmaCmProcessor::processCmEvent()
{
int ret;
struct rdma_cm_event *event;
CPPLOG::LOG_INFO("CMProcessor : starting cm processing thread\n");
CPPLog::LOG_INFO("CMProcessor : starting cm processing thread\n");
while (!_stop)
{
ret = rdma_get_cm_event(_eventChannel, &event);
if (ret)
{
CPPLOG::LOG_ERROR("CMProcesor : rdma_get_cm_event failed\n");
CPPLog::LOG_ERROR("CMProcesor : rdma_get_cm_event failed\n");
continue;
}
_endpointGroup->processCmEvent(event);
ret = rdma_ack_cm_event(event);
if (ret)
{
CPPLOG::LOG_ERROR("CMProcesor : rdma_ack_cm_event failed\n");
CPPLog::LOG_ERROR("CMProcesor : rdma_ack_cm_event failed\n");
}
}
}
......
#include "RdmaEndpoint.hpp"
#include "Logger.hpp"
int RdmaEndpoint::CONN_STATE_INITIALIZED = 1;
int RdmaEndpoint::CONN_STATE_RESOURCES_ALLOCATED = 2;
int RdmaEndpoint::CONN_STATE_CONNECTED = 3;
......@@ -17,13 +18,13 @@ void RdmaEndpoint::createResources()
{
if (_state != CONN_STATE_INITIALIZED)
{
CPPLOG::LOG_ERROR("RdmaEndpoint : createResource invalid state\n");
CPPLog::LOG_ERROR("RdmaEndpoint : createResource invalid state\n");
}
_protectionDomain = ibv_alloc_pd(_cm_id->verbs);
if (_protectionDomain == NULL)
{
CPPLOG::LOG_ERROR("RdmaEndpoint : ibv_alloc_pd failed \n");
CPPLog::LOG_ERROR("RdmaEndpoint : ibv_alloc_pd failed \n");
return;
}
......@@ -49,28 +50,28 @@ void RdmaEndpoint::createResources()
int ret = rdma_create_qp(_cm_id, _protectionDomain, &qp_init_attr);
if (ret)
{
CPPLOG::LOG_ERROR("RdmaEndpoint : ibv_create_cq failed\n");
CPPLog::LOG_ERROR("RdmaEndpoint : ibv_create_cq failed\n");
}
if (_cm_id->pd == NULL)
{
CPPLOG::LOG_ERROR("RdmaEndpoint : pd not set\n") ;
CPPLog::LOG_ERROR("RdmaEndpoint : pd not set\n") ;
_cm_id->pd = _protectionDomain;
}
_sendBuff = (char*)malloc(_sendMsgSize * _sendQueueSize);
if (_sendBuff == NULL)
CPPLOG::LOG_ERROR("RdmaEndpoint : sendBuff malloc failed\n");
CPPLog::LOG_ERROR("RdmaEndpoint : sendBuff malloc failed\n");
_recvBuff = (char*)malloc(_recvMsgSize * _recvQueueSize);
_sendMr = rdma_reg_write(_cm_id, reinterpret_cast<void *>(_sendBuff), _sendMsgSize * _sendQueueSize);
if (_sendMr == NULL)
CPPLOG::LOG_ERROR("RdmaEndpoint : sendMr reg failed" << std::endl;
CPPLog::LOG_ERROR("RdmaEndpoint : sendMr reg failed\n");
if (_recvBuff == NULL)
CPPLOG::LOG_ERROR("RdmaEndpoint : recvBuff malloc failed\n");
CPPLog::LOG_ERROR("RdmaEndpoint : recvBuff malloc failed\n");
_recvMr = rdma_reg_read(_cm_id, reinterpret_cast<void *>(_recvBuff), _recvMsgSize * _recvQueueSize);
if (_recvMr == NULL)
CPPLOG::LOG_ERROR("RdmaEndpoint : recvMr reg failed\n");
CPPLog::LOG_ERROR("RdmaEndpoint : recvMr reg failed\n");
for (int i = 0; i < _recvQueueSize; i++)
{
......@@ -91,24 +92,24 @@ void RdmaEndpoint::createResources()
void RdmaEndpoint::processCmEvent(struct rdma_cm_event *event)
{
CPPLOG::LOG_INFO("RdmaEndpoint : Event ");
CPPLOG::LOG_INFO(rdma_event_str(event->event));
CPPLog::LOG_INFO("RdmaEndpoint : Event ");
CPPLog::LOG_INFO(rdma_event_str(event->event));
if (event->event == RDMA_CM_EVENT_CONNECT_REQUEST)
{
CPPLOG::LOG_INFO("RdmaEndpoint : Connect request\n");
CPPLog::LOG_INFO("RdmaEndpoint : Connect request\n");
}
else if (event->event == RDMA_CM_EVENT_ESTABLISHED)
{
if (_state != CONN_STATE_RESOURCES_ALLOCATED)
{
CPPLOG::LOG_ERROR( "RdmaEndpoint : EstablishedEvent invalid state \n");
CPPLog::LOG_ERROR( "RdmaEndpoint : EstablishedEvent invalid state \n");
}
CPPLOG::LOG_INFO("RdmaEndpoint : step 6 Connected\n");
CPPLog::LOG_INFO("RdmaEndpoint : step 6 Connected\n");
_state = CONN_STATE_CONNECTED;
}
else if (event->event == RDMA_CM_EVENT_DISCONNECTED)
{
CPPLOG::LOG_INFO("RdmaEndpoint : step 7 disconnected\n");
CPPLog::LOG_INFO("RdmaEndpoint : step 7 disconnected\n");
clientClose();
}
}
......@@ -117,43 +118,43 @@ void RdmaEndpoint::clientClose()
{
if (_state != CONN_STATE_CONNECTED)
{
CPPLOG::LOG_ERROR("RdmaEndpoint : clientClose invalid state\n");
CPPLog::LOG_ERROR("RdmaEndpoint : clientClose invalid state\n");
return;
}
CPPLOG::LOG_INFO("RdmaEndpoint : closing connection qp ");
CPPLOG::LOG_INFO(_cm_id->qp->qp_num);
CPPLog::LOG_INFO("RdmaEndpoint : closing connection qp \n");
// CPPLog::LOG_INFO((_cm_id->qp->qp_num);
int ret;
ret = rdma_disconnect(_cm_id);
if (ret)
{
CPPLOG::LOG_ERROR( "RdmaEndpoint : rdma_disconnect failed\n");
CPPLog::LOG_ERROR( "RdmaEndpoint : rdma_disconnect failed\n");
}
ret = rdma_dereg_mr(_sendMr);
if (ret)
{
CPPLOG::LOG_ERROR("RdmaEndpoint : rdma_dereg_mr send failed\n");
CPPLog::LOG_ERROR("RdmaEndpoint : rdma_dereg_mr send failed\n");
}
free(_sendBuff);
ret = rdma_dereg_mr(_recvMr);
if (ret)
{
CPPLOG::LOG_ERROR("RdmaEndpoint : rdma_dereg_mr recv failed\n");
CPPLog::LOG_ERROR("RdmaEndpoint : rdma_dereg_mr recv failed\n");
}
free(_recvBuff);
rdma_destroy_qp(_cm_id);
CPPLOG::LOG_INFO("des qp\n");
rdma_destroy_id(_cm_id);
CPPLog::LOG_INFO("des qp\n");
//rdma_destroy_id(_cm_id);
// ret = rdma_destroy_id(_cm_id);
CPPLOG::LOG_INFO("des mr\n";
CPPLog::LOG_INFO("des mr\n");
if (ret)
{
CPPLOG::LOG_ERROR("RdmaEndpoint : rdma_destroy_id failed\n");
CPPLog::LOG_ERROR("RdmaEndpoint : rdma_destroy_id failed\n");
}
_state = CONN_STATE_CLOSED;
CPPLOG::LOG_INFO("closed\n");
CPPLog::LOG_INFO("closed\n");
}
#include "RdmaRepCqProcessor.hpp"
\ No newline at end of file
#include "RdmaRepCqProcessor.hpp"
RdmaRepCqProcessor::RdmaRepCqProcessor(Executor *ex, ibv_context *verbs, int compQueueSize)
: _executor(ex)
{
_compChannel = ibv_create_comp_channel(verbs);
if (_compChannel == NULL)
{
std::cout << "CqProcessr : ibv_create_comp_channel failed\n";
return;
}
_completionQueue = ibv_create_cq(verbs, compQueueSize, NULL, _compChannel, 0);
if (_completionQueue == NULL)
{
std::cout << "CqProcessr : ibv_create_cq failed" << std::endl;
return;
}
int ret = ibv_req_notify_cq(_completionQueue, 0);
if (ret)
{
std::cout << "CqProcessr : ibv_req_notify_cq failed\n";
}
}
struct ibv_cq *RdmaRepCqProcessor::getCq()
{
return _completionQueue;
}
void RdmaRepCqProcessor::start()
{
std::cout << "CqProcessr : starting process CQ events" << std::endl;
_compQueueThread = new std::thread(&RdmaRepCqProcessor::processCQEvents, this);
pthread_setname_np(_compQueueThread->native_handle(), "RepCQ");
}
void RdmaRepCqProcessor::processCQEvents()
{
int ret = 0;
struct ibv_cq *cq;
void *context;
const int nevent = 10;
struct ibv_wc *wc_array = new struct ibv_wc[nevent];
while (!_stop)
{
ret = ibv_get_cq_event(_compChannel, &cq, &context);
if (ret == -1)
{
std::cout << "CqProcessr : ibv_get_cq_event failed\n";
close();
}
ibv_ack_cq_events(cq, 1);
ret = ibv_req_notify_cq(_completionQueue, 0);
if (ret)
{
std::cout << "CqProcessr : ibv_req_notify_cq failed\n";
close();
}
ret = ibv_poll_cq(cq, nevent, wc_array);
if (ret < 0)
{
std::cout << "CqProcessr : ibv_poll_cq failed\n";
close();
}
if (ret == 0)
continue;
for (int i = 0; i < ret; i++)
{
struct ibv_wc *data = new struct ibv_wc(wc_array[i]);
// data->vendor_err = 1;
//_executor->submit(data);
/*
* created new thread because currently we are not getting data from followers
*/
new std::thread(&RdmaRepCqProcessor::processRepEvent, this, data);
}
//_executor->dispatchRepCqEvents(wc_array, ret);
}
}
void RdmaRepCqProcessor::processRepEvent(struct ibv_wc *data)
{
std::cout << "procesing Replication request" << std::endl;
}
void RdmaRepCqProcessor::close()
{
_stop = true;
if (_compQueueThread != NULL)
_compQueueThread->join();
}
\ No newline at end of file
......@@ -9,12 +9,12 @@ RdmaReplicationEndpoint::RdmaReplicationEndpoint(struct rdma_cm_id *id, struct i
void RdmaReplicationEndpoint::processSendCompletion(struct ibv_wc *data)
{
CPPLOG::LOG_INFO("send completion\n");
CPPLog::LOG_INFO("send completion\n");
_sendBuffers->push((void *)data->wr_id);
}
void RdmaReplicationEndpoint::processRecvCompletion(struct ibv_wc *data)
{
CPPLOG::LOG_INFO("recv completion\n");
CPPLog::LOG_INFO("recv completion\n");
std::cout << "Replication recieve" << (char *)(data->wr_id) << "\n";
char* request = new char[data->byte_len];
memcpy(request, (void *)data->wr_id,data->byte_len);
......@@ -23,7 +23,7 @@ void RdmaReplicationEndpoint::processRecvCompletion(struct ibv_wc *data)
int RdmaReplicationEndpoint::sendMessage(const char *buffer, uint32_t size)
{
if (size > _sendMsgSize)
if (size > (uint32_t)_sendMsgSize)
return -1;
void* sendBuffer = nullptr;
_sendBuffers->pop(sendBuffer);
......
#include "RdmaSalCqProcessor.hpp"
RdmaSalCqProcessor::RdmaSalCqProcessor(Executor *ex, ibv_context *verbs, int compQueueSize)
: _executor(ex)
: _executor(ex)
{
_compChannel = ibv_create_comp_channel(verbs);
if (_compChannel == NULL)
{
_compChannel = ibv_create_comp_channel(verbs);
if (_compChannel == NULL)
{
CPPLOG::LOG_ERROR( "SalCqProcessr : ibv_create_comp_channel failed\n");
return;
}
_completionQueue = ibv_create_cq(verbs, compQueueSize, NULL, _compChannel, 0);
if (_completionQueue == NULL)
{
CPPLOG::LOG_INFO( "SalCqProcessr : ibv_create_cq failed");
return;
}
int ret = ibv_req_notify_cq(_completionQueue, 0);
if (ret)
{
CPPLOG::LOG_INFO("SalCqProcessr : ibv_req_notify_cq failed\n");
}
CPPLog::LOG_ERROR("SalCqProcessr : ibv_create_comp_channel failed\n");
return;
}
struct ibv_cq *RdmaSalCqProcessor::getCq()
_completionQueue = ibv_create_cq(verbs, compQueueSize, NULL, _compChannel, 0);
if (_completionQueue == NULL)
{
return _completionQueue;
CPPLog::LOG_INFO("SalCqProcessr : ibv_create_cq failed");
return;
}
void RdmaSalCqProcessor::start()
int ret = ibv_req_notify_cq(_completionQueue, 0);
if (ret)
{
CPPLOG::LOG_INFO("SalCqProcessr : starting process CQ events\n" );
_compQueueThread = new std::thread(&RdmaSalCqProcessor::processCQEvents, this);
CPPLog::LOG_INFO("SalCqProcessr : ibv_req_notify_cq failed\n");
}
void RdmaSalCqProcessor::processCQEvents()
}
struct ibv_cq *RdmaSalCqProcessor::getCq()
{
return _completionQueue;
}
void RdmaSalCqProcessor::start()
{
CPPLog::LOG_INFO("SalCqProcessr : starting process CQ events\n");
_compQueueThread = new std::thread(&RdmaSalCqProcessor::processCQEvents, this);
}
void RdmaSalCqProcessor::processCQEvents()
{
int ret = 0;
struct ibv_cq *cq;
void *context;
const int nevent = 10;
struct ibv_wc wc_array[nevent];
while (!_stop)
{
int ret = 0;
struct ibv_cq *cq;
void *context;
const int nevent = 10;
struct ibv_wc wc_array[nevent];
while (!_stop)
/*
* get_CQ_event is a blocking call and it wait save some cpu cycles but.
* it might not be that efficient compared to polling
*/
ret = ibv_get_cq_event(_compChannel, &cq, &context);
if (ret == -1)
{
/*
* get_CQ_event is a blocking call and it wait save some cpu cycles but.
* it might not be that efficient compared to polling
*/
ret = ibv_get_cq_event(_compChannel, &cq, &context);
if (ret == -1)
{
CPPLOG::LOG_ERROR("SalCqProcessr : ibv_get_cq_event failed\n");
close();
}
ibv_ack_cq_events(cq, 1);
/*
* Create a request for next completion cycle
*/
ret = ibv_req_notify_cq(_completionQueue, 0);
if (ret)
{
CPPLOG::LOG_ERROR("SalCqProcessr : ibv_req_notify_cq failed\n");
close();
}
ret = ibv_poll_cq(cq, nevent, wc_array);
if (ret < 0)
CPPLog::LOG_ERROR("SalCqProcessr : ibv_get_cq_event failed\n");
close();
}
ibv_ack_cq_events(cq, 1);
/*
* Create a request for next completion cycle
*/
ret = ibv_req_notify_cq(_completionQueue, 0);
if (ret)
{
CPPLog::LOG_ERROR("SalCqProcessr : ibv_req_notify_cq failed\n");
close();
}
ret = ibv_poll_cq(cq, nevent, wc_array);
if (ret < 0)
{
CPPLog::LOG_ERROR("SalCqProcessr : ibv_poll_cq failed\n");
close();
}
if (ret == 0)
continue;
for (int i = 0; i < ret; i++)
{
if (wc_array[i].status != IBV_WC_SUCCESS)
{
CPPLOG::LOG_ERROR("SalCqProcessr : ibv_poll_cq failed\n");
close();
}
if (ret == 0)
std::ostringstream ss;
ss<< "RdmaSalCqProcessor : failed work completion : ";
ss<<ibv_wc_status_str(wc_array[i].status)<<"on qp"<<wc_array[i].qp_num<<"\n";
CPPLog::LOG_ERROR(ss);
continue;
for (int i = 0; i < ret; i++)
{
struct ibv_wc *data = new struct ibv_wc(wc_array[i]);
/*
* vendor_err is set to check whether the request came from sal or followers
* data->vendor_err = 0;
*/
_executor->submit(data);
}
// _executor->dispatchSalCqEvents(wc_array, ret);
struct ibv_wc *data = new struct ibv_wc(wc_array[i]);
/*
* vendor_err is set to check whether the request came from sal or followers
* data->vendor_err = 0;
*/
_executor->submit(data);
}
}
}
void RdmaSalCqProcessor::close()
{
_stop = true;
if (_compQueueThread != NULL)
_compQueueThread->join();
}
\ No newline at end of file
void RdmaSalCqProcessor::close()
{
_stop = true;
if (_compQueueThread != NULL)
_compQueueThread->join();
}
\ No newline at end of file
......@@ -14,7 +14,7 @@ void RdmaSalEndpoint::processSendCompletion(struct ibv_wc *data)
int RdmaSalEndpoint::sendMessage(const char *buffer, uint32_t size)
{
if (size > _sendMsgSize)
if (size > (uint32_t)_sendMsgSize)
return -1;
void *sendBuffer = nullptr;
_sendBuffers->pop(sendBuffer);
......@@ -28,64 +28,64 @@ void RdmaSalEndpoint::processRecvCompletion(struct ibv_wc *data)
{
char *request = new char[data->byte_len];
memcpy(request, (void *)data->wr_id, data->byte_len);
struct SalRequestHeader *req = (struct SalRequestHeader *)request;