2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

hash: New helper functions hash_bytes32() and hash_bytes64().

All of the callers of hash_words() and hash_words64() actually find it
easier to pass in the number of bytes instead of the number of 32-bit
or 64-bit words.  These new functions allow the callers to be a little
simpler.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
This commit is contained in:
Ben Pfaff
2016-01-18 22:52:48 -08:00
parent a2b53dec11
commit 0a96a21b6e
5 changed files with 28 additions and 21 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc.
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -263,8 +263,7 @@ flow_equal(const struct flow *a, const struct flow *b)
static inline size_t
flow_hash(const struct flow *flow, uint32_t basis)
{
return hash_words64((const uint64_t *)flow,
sizeof *flow / sizeof(uint64_t), basis);
return hash_bytes64((const uint64_t *)flow, sizeof *flow, basis);
}
static inline uint16_t