aboutsummaryrefslogtreecommitdiffstats
path: root/net/packet
diff options
context:
space:
mode:
authorDaniel Borkmann <dborkman@redhat.com>2014-01-21 20:29:40 -0500
committerDavid S. Miller <davem@davemloft.net>2014-01-22 02:17:20 -0500
commit89770b0a69ee0e0e5e99c722192d535115f73778 (patch)
treea8c96a91c2417dc81f5ce08aa59ebcfd456e0335 /net/packet
parentf337db64af059c9a94278a8b0ab97d87259ff62f (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')
-rw-r--r--net/packet/af_packet.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index df3cbdd585c7..97346162803d 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -88,7 +88,6 @@
88#include <linux/virtio_net.h> 88#include <linux/virtio_net.h>
89#include <linux/errqueue.h> 89#include <linux/errqueue.h>
90#include <linux/net_tstamp.h> 90#include <linux/net_tstamp.h>
91#include <linux/reciprocal_div.h>
92#include <linux/percpu.h> 91#include <linux/percpu.h>
93#ifdef CONFIG_INET 92#ifdef CONFIG_INET
94#include <net/inet_common.h> 93#include <net/inet_common.h>
@@ -1262,7 +1261,7 @@ static unsigned int fanout_demux_hash(struct packet_fanout *f,
1262 struct sk_buff *skb, 1261 struct sk_buff *skb,
1263 unsigned int num) 1262 unsigned int num)
1264{ 1263{
1265 return reciprocal_divide(skb->rxhash, num); 1264 return reciprocal_scale(skb->rxhash, num);
1266} 1265}
1267 1266
1268static unsigned int fanout_demux_lb(struct packet_fanout *f, 1267static unsigned int fanout_demux_lb(struct packet_fanout *f,