Skip to content

Commit

Permalink
Fixed two bugs introduced in the previous commit (hash 4319853)
Browse files Browse the repository at this point in the history
The first bug is that packet buffers arriving out-of-order are not returned to
the driver properly; this will exhaust the driver's rx buffers eventually. The
second bug is some experimental junk left in the homa benchmark code.
  • Loading branch information
yilongli committed Apr 28, 2019
1 parent 4319853 commit 0412e2b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions apps/ClusterPerf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3024,13 +3024,13 @@ echo_basic()
double probability;
inFile >> avgMessageSize;
while (inFile >> size >> probability) {
outgoingSizes.push_back(30);
outgoingSizes.push_back(size);
incomingSizes.push_back(size);
ids.push_back(std::to_string(size));
}
} else {
outgoingSizes = {30, 30, 30, 30, 30};
incomingSizes = {100, 1024, 10*1024, 100*1024, 1024*1024};
incomingSizes = {100, 1000, 10*1000, 100*1000, 1000000};
ids = {"100", "1K", "10K", "100K", "1M"};
}

Expand Down
5 changes: 5 additions & 0 deletions src/BasicTransport.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1617,6 +1617,11 @@ BasicTransport::MessageAccumulator::addPacket(DataHeader *header,
} else {
buffer->appendCopy(payload + sizeof32(DataHeader),
fragment.length);
if (fragment.header != header) {
// This packet was retained earlier due to out-of-order
// arrival and must be returned to driver now.
t->driver->returnPacket(payload);
}
}
FragmentMap::iterator it = fragments.find(buffer->size());
if (it == fragments.end()) {
Expand Down
4 changes: 1 addition & 3 deletions src/DpdkDriver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -411,12 +411,10 @@ DpdkDriver::sendPacket(const Address* addr,
struct rte_mbuf* mbuf = rte_pktmbuf_alloc(mbufPool);
#endif
if (unlikely(NULL == mbuf)) {
RAMCLOUD_CLOG(WARNING,
"Failed to allocate a packet buffer; dropping packet; "
DIE("Failed to allocate a packet buffer; dropping packet; "
"%u mbufs available, %u mbufs in use",
rte_mempool_avail_count(mbufPool),
rte_mempool_in_use_count(mbufPool));
return;
}

#if TESTING
Expand Down
5 changes: 5 additions & 0 deletions src/HomaTransport.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1818,6 +1818,11 @@ HomaTransport::MessageAccumulator::addPacket(DataHeader *header,
} else {
buffer->appendCopy(payload + sizeof32(DataHeader),
fragment.length);
if (fragment.header != header) {
// This packet was retained earlier due to out-of-order
// arrival and must be returned to driver now.
t->driver->returnPacket(payload);
}
}
FragmentMap::iterator it = fragments.find(buffer->size());
if (it == fragments.end()) {
Expand Down

0 comments on commit 0412e2b

Please sign in to comment.