diff options
| author | Andrew Stitcher <astitcher@apache.org> | 2010-12-23 17:11:57 +0000 |
|---|---|---|
| committer | Andrew Stitcher <astitcher@apache.org> | 2010-12-23 17:11:57 +0000 |
| commit | c3d6047e94210bd35f7c35b9bba0bc2e60841fa7 (patch) | |
| tree | 6e6ab77a94534863b37069f7b48c82b2bd411f51 /cpp/src/qpid | |
| parent | ff152807775cf3ad146742a59bbe44146cbb9a34 (diff) | |
| download | qpid-python-c3d6047e94210bd35f7c35b9bba0bc2e60841fa7.tar.gz | |
Rename Rdma send buffer operations.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1052331 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid')
| -rw-r--r-- | cpp/src/qpid/client/RdmaConnector.cpp | 4 | ||||
| -rw-r--r-- | cpp/src/qpid/sys/RdmaIOPlugin.cpp | 4 | ||||
| -rw-r--r-- | cpp/src/qpid/sys/rdma/RdmaClient.cpp | 4 | ||||
| -rw-r--r-- | cpp/src/qpid/sys/rdma/RdmaIO.cpp | 10 | ||||
| -rw-r--r-- | cpp/src/qpid/sys/rdma/RdmaIO.h | 12 | ||||
| -rw-r--r-- | cpp/src/qpid/sys/rdma/RdmaServer.cpp | 4 | ||||
| -rw-r--r-- | cpp/src/qpid/sys/rdma/rdma_wrap.cpp | 4 | ||||
| -rw-r--r-- | cpp/src/qpid/sys/rdma/rdma_wrap.h | 4 |
8 files changed, 23 insertions, 23 deletions
diff --git a/cpp/src/qpid/client/RdmaConnector.cpp b/cpp/src/qpid/client/RdmaConnector.cpp index e08ced0abc..6af607198c 100644 --- a/cpp/src/qpid/client/RdmaConnector.cpp +++ b/cpp/src/qpid/client/RdmaConnector.cpp @@ -356,7 +356,7 @@ void RdmaConnector::writebuff(Rdma::AsynchIO&) { if (!codec->canEncode()) { return; } - Rdma::Buffer* buffer = aio->getBuffer(); + Rdma::Buffer* buffer = aio->getSendBuffer(); if (buffer) { size_t encoded = codec->encode(buffer->bytes(), buffer->byteCount()); buffer->dataCount(encoded); @@ -415,7 +415,7 @@ size_t RdmaConnector::decode(const char* buffer, size_t size) } void RdmaConnector::writeDataBlock(const AMQDataBlock& data) { - Rdma::Buffer* buff = aio->getBuffer(); + Rdma::Buffer* buff = aio->getSendBuffer(); framing::Buffer out(buff->bytes(), buff->byteCount()); data.encode(out); buff->dataCount(data.encodedSize()); diff --git a/cpp/src/qpid/sys/RdmaIOPlugin.cpp b/cpp/src/qpid/sys/RdmaIOPlugin.cpp index c2ea815d31..9eb2eb7b5d 100644 --- a/cpp/src/qpid/sys/RdmaIOPlugin.cpp +++ b/cpp/src/qpid/sys/RdmaIOPlugin.cpp @@ -116,7 +116,7 @@ void RdmaIOHandler::start(Poller::shared_ptr poller) { void RdmaIOHandler::write(const framing::ProtocolInitiation& data) { QPID_LOG(debug, "Rdma: SENT [" << identifier << "] INIT(" << data << ")"); - Rdma::Buffer* buff = aio->getBuffer(); + Rdma::Buffer* buff = aio->getSendBuffer(); assert(buff); framing::Buffer out(buff->bytes(), buff->byteCount()); data.encode(out); @@ -146,7 +146,7 @@ void RdmaIOHandler::idle(Rdma::AsynchIO&) { if (!codec->canEncode()) { return; } - Rdma::Buffer* buff = aio->getBuffer(); + Rdma::Buffer* buff = aio->getSendBuffer(); if (buff) { size_t encoded=codec->encode(buff->bytes(), buff->byteCount()); buff->dataCount(encoded); diff --git a/cpp/src/qpid/sys/rdma/RdmaClient.cpp b/cpp/src/qpid/sys/rdma/RdmaClient.cpp index e53ebb0520..38e9b59541 100644 --- a/cpp/src/qpid/sys/rdma/RdmaClient.cpp +++ b/cpp/src/qpid/sys/rdma/RdmaClient.cpp @@ -94,7 +94,7 @@ Xor128Generator input; void write(Rdma::AsynchIO& aio) { while (aio.writable() && smsgs < target) { - Rdma::Buffer* b = aio.getBuffer(); + Rdma::Buffer* b = aio.getSendBuffer(); if (!b) break; b->dataCount(msgsize); uint32_t* ip = reinterpret_cast<uint32_t*>(b->bytes()); @@ -143,7 +143,7 @@ void full(Rdma::AsynchIO& a, Rdma::Buffer* b) { sbytes -= b->dataCount(); // Give buffer back - a.returnBuffer(b); + a.returnSendBuffer(b); } void idle(Poller::shared_ptr p, Rdma::AsynchIO& aio) { diff --git a/cpp/src/qpid/sys/rdma/RdmaIO.cpp b/cpp/src/qpid/sys/rdma/RdmaIO.cpp index 74ceceffad..c80c94cba6 100644 --- a/cpp/src/qpid/sys/rdma/RdmaIO.cpp +++ b/cpp/src/qpid/sys/rdma/RdmaIO.cpp @@ -198,7 +198,7 @@ namespace Rdma { switch (protocolVersion) { case 0: if (!buff) { - Buffer* ob = getBuffer(); + Buffer* ob = getSendBuffer(); // Have to send something as adapters hate it when you try to transfer 0 bytes *reinterpret_cast< uint32_t* >(ob->bytes()) = htonl(credit); ob->dataCount(sizeof(uint32_t)); @@ -210,7 +210,7 @@ namespace Rdma { } break; case 1: - Buffer* ob = buff ? buff : getBuffer(); + Buffer* ob = buff ? buff : getSendBuffer(); // Add FrameHeader after frame data FrameHeader header(credit); ::memcpy(ob->bytes()+ob->dataCount(), &header, FrameHeaderSize); @@ -266,7 +266,7 @@ namespace Rdma { fullCallback(*this, buff); } else { QPID_LOG(error, "RDMA: qp=" << qp << ": Write queue full, but no callback, throwing buffer away"); - returnBuffer(buff); + returnSendBuffer(buff); } } } @@ -375,7 +375,7 @@ namespace Rdma { if (dir == SEND) { Buffer* b = e.getBuffer(); ++sendEvents; - returnBuffer(b); + returnSendBuffer(b); --outstandingWrites; } else { ++recvEvents; @@ -426,7 +426,7 @@ namespace Rdma { } else { Buffer* b = e.getBuffer(); ++sendEvents; - returnBuffer(b); + returnSendBuffer(b); --outstandingWrites; } } while (true); diff --git a/cpp/src/qpid/sys/rdma/RdmaIO.h b/cpp/src/qpid/sys/rdma/RdmaIO.h index 330c2395bd..ec9caaf08d 100644 --- a/cpp/src/qpid/sys/rdma/RdmaIO.h +++ b/cpp/src/qpid/sys/rdma/RdmaIO.h @@ -93,8 +93,8 @@ namespace Rdma { void stop(NotifyCallback); void requestCallback(RequestCallback); int incompletedWrites() const; - Buffer* getBuffer(); - void returnBuffer(Buffer*); + Buffer* getSendBuffer(); + void returnSendBuffer(Buffer*); private: const static int maxSupportedProtocolVersion = 1; @@ -133,12 +133,12 @@ namespace Rdma { return outstandingWrites; } - inline Buffer* AsynchIO::getBuffer() { - return qp->getBuffer(); + inline Buffer* AsynchIO::getSendBuffer() { + return qp->getSendBuffer(); } - inline void AsynchIO::returnBuffer(Buffer* b) { - qp->returnBuffer(b); + inline void AsynchIO::returnSendBuffer(Buffer* b) { + qp->returnSendBuffer(b); } // These are the parameters necessary to start the conversation diff --git a/cpp/src/qpid/sys/rdma/RdmaServer.cpp b/cpp/src/qpid/sys/rdma/RdmaServer.cpp index 33bb8247a1..9b0710fd8f 100644 --- a/cpp/src/qpid/sys/rdma/RdmaServer.cpp +++ b/cpp/src/qpid/sys/rdma/RdmaServer.cpp @@ -80,7 +80,7 @@ void dataError(Rdma::AsynchIO&) { void idle(ConRec* cr, Rdma::AsynchIO& a) { // Need to make sure full is not called as it would reorder messages while (!cr->queuedWrites.empty() && a.writable()) { - Rdma::Buffer* rbuf = a.getBuffer(); + Rdma::Buffer* rbuf = a.getSendBuffer(); if (!rbuf) break; Buffer* buf = cr->queuedWrites.front(); cr->queuedWrites.pop(); @@ -95,7 +95,7 @@ void data(ConRec* cr, Rdma::AsynchIO& a, Rdma::Buffer* b) { // Echo data back Rdma::Buffer* buf = 0; if (cr->queuedWrites.empty() && a.writable()) { - buf = a.getBuffer(); + buf = a.getSendBuffer(); } if (buf) { std::copy(b->bytes(), b->bytes()+b->dataCount(), buf->bytes()); diff --git a/cpp/src/qpid/sys/rdma/rdma_wrap.cpp b/cpp/src/qpid/sys/rdma/rdma_wrap.cpp index a51244a7dc..6d38c42502 100644 --- a/cpp/src/qpid/sys/rdma/rdma_wrap.cpp +++ b/cpp/src/qpid/sys/rdma/rdma_wrap.cpp @@ -182,7 +182,7 @@ namespace Rdma { } } - Buffer* QueuePair::getBuffer() { + Buffer* QueuePair::getSendBuffer() { qpid::sys::ScopedLock<qpid::sys::Mutex> l(bufferLock); if (freeBuffers.empty()) return 0; @@ -194,7 +194,7 @@ namespace Rdma { return b; } - void QueuePair::returnBuffer(Buffer* b) { + void QueuePair::returnSendBuffer(Buffer* b) { qpid::sys::ScopedLock<qpid::sys::Mutex> l(bufferLock); int i = b - &sendBuffers[0]; assert(i >= 0 && i < int(sendBuffers.size())); diff --git a/cpp/src/qpid/sys/rdma/rdma_wrap.h b/cpp/src/qpid/sys/rdma/rdma_wrap.h index a3cd584102..59d87822d4 100644 --- a/cpp/src/qpid/sys/rdma/rdma_wrap.h +++ b/cpp/src/qpid/sys/rdma/rdma_wrap.h @@ -139,10 +139,10 @@ namespace Rdma { void createSendBuffers(int sendBufferCount, int bufferSize); // Get a send buffer - Buffer* getBuffer(); + Buffer* getSendBuffer(); // Return buffer to pool after use - void returnBuffer(Buffer* b); + void returnSendBuffer(Buffer* b); // Create and post recv buffers void allocateRecvBuffers(int recvBufferCount, int bufferSize); |
