Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f55d112e authored by Daniel Borkmann's avatar Daniel Borkmann Committed by David S. Miller
Browse files

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: default avatarDaniel Borkmann <dborkman@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5df0ddfb
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1135,7 +1135,7 @@ static unsigned int fanout_demux_hash(struct packet_fanout *f,
				      struct sk_buff *skb,
				      struct sk_buff *skb,
				      unsigned int num)
				      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,
static unsigned int fanout_demux_lb(struct packet_fanout *f,