net: use reciprocal_scale() helper
Replace open codings of (((u64) <x> * <y>) >> 32) with reciprocal_scale(). Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Cc: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
690e36e726
commit
8fc54f6891
@@ -3124,8 +3124,7 @@ static int get_rps_cpu(struct net_device *dev, struct sk_buff *skb,
|
||||
}
|
||||
|
||||
if (map) {
|
||||
tcpu = map->cpus[((u64) hash * map->len) >> 32];
|
||||
|
||||
tcpu = map->cpus[reciprocal_scale(hash, map->len)];
|
||||
if (cpu_online(tcpu)) {
|
||||
cpu = tcpu;
|
||||
goto done;
|
||||
|
Reference in New Issue
Block a user