BIND 10 trac1958, updated. 98c3fe102ae4b4e8769d2bf9412a5e5ab9225926 [1958] Use hashing function for indexing and unordered search.
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Jul 23 14:22:58 UTC 2012
The branch, trac1958 has been updated
via 98c3fe102ae4b4e8769d2bf9412a5e5ab9225926 (commit)
from a14dd1bb813a03e9cedecc44b237c24fc0dbe08e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 98c3fe102ae4b4e8769d2bf9412a5e5ab9225926
Author: Marcin Siodelski <marcin at isc.org>
Date: Mon Jul 23 16:22:42 2012 +0200
[1958] Use hashing function for indexing and unordered search.
-----------------------------------------------------------------------
Summary of changes:
tests/tools/perfdhcp/stats_mgr.h | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
-----------------------------------------------------------------------
diff --git a/tests/tools/perfdhcp/stats_mgr.h b/tests/tools/perfdhcp/stats_mgr.h
index cae1029..7732bce 100644
--- a/tests/tools/perfdhcp/stats_mgr.h
+++ b/tests/tools/perfdhcp/stats_mgr.h
@@ -131,7 +131,7 @@ public:
class ExchangeStats {
public:
- static uint32_t transid_hash(const boost::shared_ptr<T> packet) {
+ static uint32_t hashTransid(const boost::shared_ptr<T> packet) {
return packet->getTransid() & 1023;
}
@@ -148,7 +148,7 @@ public:
boost::multi_index::global_fun<
boost::shared_ptr<T>,
uint32_t,
- &ExchangeStats::transid_hash
+ &ExchangeStats::hashTransid
>
>
>
@@ -259,7 +259,7 @@ public:
/// \param transid transaction id of the packet to search
/// \return packet having specified transaction or NULL if packet
/// not found
- boost::shared_ptr<T> findSent(const uint32_t transid) {
+ boost::shared_ptr<T> findSent(const boost::shared_ptr<T> rcvd_packet) {
if (sent_packets_.size() == 0) {
// List of sent packets is empty so there is no sense
// to continue looking fo the packet. It also means
@@ -283,7 +283,7 @@ public:
// incoming packet. We are successful if there is no
// packet drop or out of order packets sent. This is actually
// the fastest way to look for packets.
- if ((*sent_packets_cache_)->getTransid() == transid) {
+ if ((*sent_packets_cache_)->getTransid() == rcvd_packet->getTransid()) {
++ordered_lookups_;
packet_found = true;
} else {
@@ -299,7 +299,7 @@ public:
// bucket of packets and we need to iterate through the bucket
// to find the one that has desired transaction id.
std::pair<PktListTransidIterator,PktListTransidIterator> p =
- idx.equal_range(transid & 1023);
+ idx.equal_range(hashTransid(rcvd_packet));
// We want to keep statistics of unordered lookups to make
// sure that there is a right balance between number of
// unordered lookups and ordered lookups. If number of unordered
@@ -312,7 +312,7 @@ public:
unordered_lookup_size_sum_ += std::distance(p.first, p.second);
for (PktListTransidIterator it = p.first; it != p.second;
++it) {
- if ((*it)->getTransid() == transid) {
+ if ((*it)->getTransid() == rcvd_packet->getTransid()) {
packet_found = true;
sent_packets_cache_ =
sent_packets_.template project<0>(it);
@@ -592,7 +592,7 @@ public:
const boost::shared_ptr<T> packet) {
ExchangeStatsPtr xchg_stats = getExchangeStats(xchg_type);
boost::shared_ptr<T> sent_packet
- = xchg_stats->findSent(packet->getTransid());
+ = xchg_stats->findSent(packet);
if (sent_packet) {
xchg_stats->updateDelays(sent_packet, packet);
More information about the bind10-changes
mailing list