OSDN Git Service
(root)
/
tomoyo
/
tomoyo-test1.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5df0ddf
)
net: packet: use reciprocal_divide in fanout_demux_hash
author
Daniel Borkmann
<dborkman@redhat.com>
Wed, 28 Aug 2013 20:13:10 +0000
(22:13 +0200)
committer
David S. Miller
<davem@davemloft.net>
Thu, 29 Aug 2013 20:43:29 +0000
(16:43 -0400)
Instead of hard-coding reciprocal_divide function, use the inline
function from reciprocal_div.h.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/packet/af_packet.c
patch
|
blob
|
history
diff --git
a/net/packet/af_packet.c
b/net/packet/af_packet.c
index
bee9bfd
..
2e8286b
100644
(file)
--- a/
net/packet/af_packet.c
+++ b/
net/packet/af_packet.c
@@
-1135,7
+1135,7
@@
static unsigned int fanout_demux_hash(struct packet_fanout *f,
struct sk_buff *skb,
unsigned int num)
{
- return
(((u64)skb->rxhash) * num) >> 32
;
+ return
reciprocal_divide(skb->rxhash, num)
;
}
static unsigned int fanout_demux_lb(struct packet_fanout *f,