diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2014-01-22 02:29:40 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-01-21 23:17:20 -0800 |
commit | 89770b0a69ee0e0e5e99c722192d535115f73778 (patch) | |
tree | a8c96a91c2417dc81f5ce08aa59ebcfd456e0335 /net/packet/af_packet.c | |
parent | f337db64af059c9a94278a8b0ab97d87259ff62f (diff) |
net: introduce reciprocal_scale helper and convert users
As David Laight suggests, we shouldn't necessarily call this
reciprocal_divide() when users didn't requested a reciprocal_value();
lets keep the basic idea and call it reciprocal_scale(). More
background information on this topic can be found in [1].
Joint work with Hannes Frederic Sowa.
[1] http://homepage.cs.uiowa.edu/~jones/bcd/divide.html
Suggested-by: David Laight <david.laight@aculab.com>
Cc: Jakub Zawadzki <darkjames-ws@darkjames.pl>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/packet/af_packet.c')
-rw-r--r-- | net/packet/af_packet.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index df3cbdd585c..97346162803 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -88,7 +88,6 @@ #include <linux/virtio_net.h> #include <linux/errqueue.h> #include <linux/net_tstamp.h> -#include <linux/reciprocal_div.h> #include <linux/percpu.h> #ifdef CONFIG_INET #include <net/inet_common.h> @@ -1262,7 +1261,7 @@ static unsigned int fanout_demux_hash(struct packet_fanout *f, struct sk_buff *skb, unsigned int num) { - return reciprocal_divide(skb->rxhash, num); + return reciprocal_scale(skb->rxhash, num); } static unsigned int fanout_demux_lb(struct packet_fanout *f, |