浏览代码

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>
Daniel Borkmann 12 年之前
父节点
当前提交
f55d112e52
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      net/packet/af_packet.c

+ 1 - 1
net/packet/af_packet.c

@@ -1135,7 +1135,7 @@ static unsigned int fanout_demux_hash(struct packet_fanout *f,
 				      struct sk_buff *skb,
 				      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,