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:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc.
|
||||
* Copyright (c) 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.
|
||||
@@ -4529,8 +4529,7 @@ uint32_t
|
||||
odp_flow_key_hash(const struct nlattr *key, size_t key_len)
|
||||
{
|
||||
BUILD_ASSERT_DECL(!(NLA_ALIGNTO % sizeof(uint32_t)));
|
||||
return hash_words(ALIGNED_CAST(const uint32_t *, key),
|
||||
key_len / sizeof(uint32_t), 0);
|
||||
return hash_bytes32(ALIGNED_CAST(const uint32_t *, key), key_len, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Reference in New Issue
Block a user