Skip to content

Commit f55d112

Browse files
Daniel Borkmanndavem330
authored andcommitted
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>
1 parent 5df0ddf commit f55d112

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/packet/af_packet.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,7 @@ static unsigned int fanout_demux_hash(struct packet_fanout *f,
11351135
struct sk_buff *skb,
11361136
unsigned int num)
11371137
{
1138-
return (((u64)skb->rxhash) * num) >> 32;
1138+
return reciprocal_divide(skb->rxhash, num);
11391139
}
11401140

11411141
static unsigned int fanout_demux_lb(struct packet_fanout *f,

0 commit comments

Comments
 (0)