diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2017-04-03 00:51:50 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-04-04 05:04:48 +0300 |
commit | 5a17d9ed9ad702af800f184b13817e056618ba03 (patch) | |
tree | 13ea2d5a11ecd448eab864b5a4120d039c0255b6 /net/core/flow.c | |
parent | d39004ab136ebb6949a7dda9d24376f3d6209295 (diff) | |
download | linux-5a17d9ed9ad702af800f184b13817e056618ba03.tar.xz |
flowcache: make flow_key_size() return "unsigned int"
Flow keys aren't 4GB+ numbers so 64-bit arithmetic is excessive.
Space savings (I'm not sure what CSWTCH is):
add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-48 (-48)
function old new delta
flow_cache_lookup 1163 1159 -4
CSWTCH 75997 75953 -44
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/flow.c')
-rw-r--r-- | net/core/flow.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/core/flow.c b/net/core/flow.c index f765c11d8df5..98f977ec21b1 100644 --- a/net/core/flow.c +++ b/net/core/flow.c @@ -161,7 +161,7 @@ static void flow_new_hash_rnd(struct flow_cache *fc, static u32 flow_hash_code(struct flow_cache *fc, struct flow_cache_percpu *fcp, const struct flowi *key, - size_t keysize) + unsigned int keysize) { const u32 *k = (const u32 *) key; const u32 length = keysize * sizeof(flow_compare_t) / sizeof(u32); @@ -174,7 +174,7 @@ static u32 flow_hash_code(struct flow_cache *fc, * important assumptions that we can here, such as alignment. */ static int flow_key_compare(const struct flowi *key1, const struct flowi *key2, - size_t keysize) + unsigned int keysize) { const flow_compare_t *k1, *k1_lim, *k2; @@ -199,7 +199,7 @@ flow_cache_lookup(struct net *net, const struct flowi *key, u16 family, u8 dir, struct flow_cache_percpu *fcp; struct flow_cache_entry *fle, *tfle; struct flow_cache_object *flo; - size_t keysize; + unsigned int keysize; unsigned int hash; local_bh_disable(); |