Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: packet: use reciprocal_divide in fanout_demux_hash

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>

authored by

Daniel Borkmann and committed by
David S. Miller
f55d112e 5df0ddfb

+1 -1
+1 -1
net/packet/af_packet.c
··· 1135 1135 struct sk_buff *skb, 1136 1136 unsigned int num) 1137 1137 { 1138 - return (((u64)skb->rxhash) * num) >> 32; 1138 + return reciprocal_divide(skb->rxhash, num); 1139 1139 } 1140 1140 1141 1141 static unsigned int fanout_demux_lb(struct packet_fanout *f,