Skip to content

Commit

Permalink
net: packet: use reciprocal_divide in fanout_demux_hash
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Daniel Borkmann authored and David S. Miller committed Aug 29, 2013
1 parent 5df0ddf commit f55d112
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/packet/af_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f55d112

Please sign in to comment.