Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dataplane/globalbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ using wan_ht = hashtable_mod_spinlock_dynamic<nat64stateful_wan_key, nat64statef

namespace balancer
{
using state_ht = hashtable_mod_spinlock_dynamic<balancer_state_key_t, balancer_state_value_t, 16>;
using state_ht = hashtable_mod_spinlock_dynamic<balancer_state_key_t, balancer_state_value_t, 16, dataplane::calculate_hash_city<balancer_state_key_t>>;
}

class atomic
Expand Down
7 changes: 7 additions & 0 deletions dataplane/hashtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#include "common.h"

#include "ext/city.h"
#include "ext/murmurhash3.h"
#include "ext/xxhash32.h"

Expand Down Expand Up @@ -73,6 +74,12 @@ inline uint32_t calculate_hash_xxh32(const key_t& key)
return XXHash32::hash(&key, sizeof(key), 19);
}

template<typename key_t>
inline uint32_t calculate_hash_city(const key_t& key)
{
return CityHash32((char*)&key, sizeof(key));
Comment thread
ol-imorozko marked this conversation as resolved.
}

class spinlock_t final
{
public:
Expand Down
Loading