2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-25 15:07:05 +00:00
Commit Graph

12 Commits

Author SHA1 Message Date
Ben Pfaff
9879b94f43 hash: Introduce an implementation of murmurhash.
Murmurhash is generally superior to the Jenkins lookup3 hash according to
the available figures.  Perhaps we should generally replace our current
hashes by murmurhash.

For now, I'm introducing a parallel implementation to allow it to be used
in cases where an incremental one-word-at-a-time hash is desirable.  The
first user will be added in an upcoming commit.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
2012-09-04 12:24:28 -07:00
Raju Subramanian
e0edde6fee Global replace of Nicira Networks.
Replaced all instances of Nicira Networks(, Inc) to Nicira, Inc.

Feature #10593
Signed-off-by: Raju Subramanian <rsubramanian@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-02 17:08:02 -07:00
Ben Pfaff
d556327b38 hash: Convert macros to inline functions.
I always assumed that macros would generate better code.  I was wrong.  The
generated code was identical with inline functions, with GCC version 4.4.5.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-02-02 09:33:46 -08:00
Casey Barker
43d1478b16 lib: Adapt headers for use in C++.
This commit makes several library headers suitable for inclusion in C++.

It adds [extern "C"] guards and makes minor changes to fix casting and
keyword issues.
2011-08-04 16:20:04 -07:00
Ben Pfaff
1f26e79678 hash: Make functions for hashing a few words easier to use.
It's easier for the client to pass in data directly than it is for the
client to stuff it into an array.

These functions will have new users in upcoming commits.
2010-12-17 14:31:40 -08:00
Jesse Gross
91f227cad7 hash: Prevent warnings about strict aliasing rules.
Some versions of GCC complain about violations of strict aliasing
rules due to a cast between different pointer types.  This avoids
any aliasing by copying the value first.
2010-01-20 14:02:50 -05:00
Ben Pfaff
44528c5463 hash: Improve hash function for integers.
As previously defined, the following both returned the same value for
given values of 'basis':
	hash_int(0, hash_int(1, basis))
	hash_int(1, hash_int(0, basis))
because hash_int(0, basis) evaluated to basis and hash_int(1, basis)
evaluated to c + basis for some constant c.

This commit fixes the problem, by eliminating any simple linear
relationship between basis and the hash value.

We should write some tests for hash function quality.
2009-11-04 15:01:02 -08:00
Ben Pfaff
8e5421180d hash: Implement hash function for Boolean values.
This will be used by the configuration database, and it's generally useful
to have around.
2009-11-04 15:01:00 -08:00
Ben Pfaff
cce1d8bd8e hash: Implement hash function for "double" values.
This will be used by the configuration database, which can store real
numbers.
2009-11-04 15:00:30 -08:00
Ben Pfaff
0064467516 hash: Implement hash function for pointer values.
This will be used by an upcoming commit, and it's generally useful to
have around.
2009-11-04 15:00:28 -08:00
Ben Pfaff
a14bc59fb8 Update primary code license to Apache 2.0. 2009-06-15 15:11:30 -07:00
Ben Pfaff
064af42167 Import from old repository commit 61ef2b42a9c4ba8e1600f15bb0236765edc2ad45. 2009-07-08 13:19:16 -07:00