Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 322788
b: refs/heads/master
c: 6862234
h: refs/heads/master
v: v3
  • Loading branch information
Chema Gonzalez authored and David S. Miller committed Sep 8, 2012
1 parent a0b65b9 commit e59bfb1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 777bf135b77071672662c67f0abffcf433450d68
refs/heads/master: 6862234238e84648c305526af2edd98badcad1e0
11 changes: 6 additions & 5 deletions trunk/net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2647,15 +2647,16 @@ void __skb_get_rxhash(struct sk_buff *skb)
if (!skb_flow_dissect(skb, &keys))
return;

if (keys.ports) {
if ((__force u16)keys.port16[1] < (__force u16)keys.port16[0])
swap(keys.port16[0], keys.port16[1]);
if (keys.ports)
skb->l4_rxhash = 1;
}

/* get a consistent hash (same value on both flow directions) */
if ((__force u32)keys.dst < (__force u32)keys.src)
if (((__force u32)keys.dst < (__force u32)keys.src) ||
(((__force u32)keys.dst == (__force u32)keys.src) &&
((__force u16)keys.port16[1] < (__force u16)keys.port16[0]))) {
swap(keys.dst, keys.src);
swap(keys.port16[0], keys.port16[1]);
}

hash = jhash_3words((__force u32)keys.dst,
(__force u32)keys.src,
Expand Down

0 comments on commit e59bfb1

Please sign in to comment.