Re: [PATCH net-next 1/2] random32: add prandom_u32_lt_N and convert "misuses" of reciprocal_divide

2014-01-16 Thread Daniel Borkmann
On 01/16/2014 04:14 AM, Eric Dumazet wrote: On Thu, 2014-01-16 at 00:23 +0100, Daniel Borkmann wrote: @@ -1220,7 +1219,7 @@ static unsigned int fanout_demux_hash(struct packet_fanout *f, struct sk_buff *skb, unsigned

RE: [PATCH net-next 1/2] random32: add prandom_u32_lt_N and convert "misuses" of reciprocal_divide

2014-01-16 Thread David Laight
From: Eric Dumazet > On Thu, 2014-01-16 at 00:23 +0100, Daniel Borkmann wrote: > > > @@ -1220,7 +1219,7 @@ static unsigned int fanout_demux_hash(struct > > packet_fanout *f, > > struct sk_buff *skb, > > unsigned int num) > > {

Re: [PATCH net-next 1/2] random32: add prandom_u32_lt_N and convert "misuses" of reciprocal_divide

2014-01-16 Thread Daniel Borkmann
On 01/16/2014 01:29 AM, Joe Perches wrote: On Thu, 2014-01-16 at 00:23 +0100, Daniel Borkmann wrote: Many functions have open coded a function that return a random number in range [0,N-1]. Also, only because we have a function that is named reciprocal_divide(), it has not much to do with the

Re: [PATCH net-next 1/2] random32: add prandom_u32_lt_N and convert misuses of reciprocal_divide

2014-01-16 Thread Daniel Borkmann
On 01/16/2014 01:29 AM, Joe Perches wrote: On Thu, 2014-01-16 at 00:23 +0100, Daniel Borkmann wrote: Many functions have open coded a function that return a random number in range [0,N-1]. Also, only because we have a function that is named reciprocal_divide(), it has not much to do with the

RE: [PATCH net-next 1/2] random32: add prandom_u32_lt_N and convert misuses of reciprocal_divide

2014-01-16 Thread David Laight
From: Eric Dumazet On Thu, 2014-01-16 at 00:23 +0100, Daniel Borkmann wrote: @@ -1220,7 +1219,7 @@ static unsigned int fanout_demux_hash(struct packet_fanout *f, struct sk_buff *skb, unsigned int num) { - return

Re: [PATCH net-next 1/2] random32: add prandom_u32_lt_N and convert misuses of reciprocal_divide

2014-01-16 Thread Daniel Borkmann
On 01/16/2014 04:14 AM, Eric Dumazet wrote: On Thu, 2014-01-16 at 00:23 +0100, Daniel Borkmann wrote: @@ -1220,7 +1219,7 @@ static unsigned int fanout_demux_hash(struct packet_fanout *f, struct sk_buff *skb, unsigned

Re: [PATCH net-next 1/2] random32: add prandom_u32_lt_N and convert "misuses" of reciprocal_divide

2014-01-15 Thread Eric Dumazet
On Thu, 2014-01-16 at 00:23 +0100, Daniel Borkmann wrote: > @@ -1220,7 +1219,7 @@ static unsigned int fanout_demux_hash(struct > packet_fanout *f, > struct sk_buff *skb, > unsigned int num) > { > - return

Re: [PATCH net-next 1/2] random32: add prandom_u32_lt_N and convert "misuses" of reciprocal_divide

2014-01-15 Thread Joe Perches
On Thu, 2014-01-16 at 00:23 +0100, Daniel Borkmann wrote: > Many functions have open coded a function that return a random > number in range [0,N-1]. Also, only because we have a function > that is named reciprocal_divide(), it has not much to do with > the pupose where it is being used when a

Re: [PATCH net-next 1/2] random32: add prandom_u32_lt_N and convert misuses of reciprocal_divide

2014-01-15 Thread Joe Perches
On Thu, 2014-01-16 at 00:23 +0100, Daniel Borkmann wrote: Many functions have open coded a function that return a random number in range [0,N-1]. Also, only because we have a function that is named reciprocal_divide(), it has not much to do with the pupose where it is being used when a

Re: [PATCH net-next 1/2] random32: add prandom_u32_lt_N and convert misuses of reciprocal_divide

2014-01-15 Thread Eric Dumazet
On Thu, 2014-01-16 at 00:23 +0100, Daniel Borkmann wrote: @@ -1220,7 +1219,7 @@ static unsigned int fanout_demux_hash(struct packet_fanout *f, struct sk_buff *skb, unsigned int num) { - return