android_kernel_motorola_sm6225/drivers/net/team
Daniel Borkmann f337db64af random32: add prandom_u32_max and convert open coded users
Many functions have open coded a function that returns a random
number in range [0,N-1]. Under the assumption that we have a PRNG
such as taus113 with being well distributed in [0, ~0U] space,
we can implement such a function as uword t = (n*m')>>32, where
m' is a random number obtained from PRNG, n the right open interval
border and t our resulting random number, with n,m',t in u32 universe.

Lets go with Joe and simply call it prandom_u32_max(), although
technically we have an right open interval endpoint, but that we
have documented. Other users can further be migrated to the new
prandom_u32_max() function later on; for now, we need to make sure
to migrate reciprocal_divide() users for the reciprocal_divide()
follow-up fixup since their function signatures are going to change.

Joint work with Hannes Frederic Sowa.

Cc: Jakub Zawadzki <darkjames-ws@darkjames.pl>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-01-21 23:17:20 -08:00
..
Kconfig team: introduce random mode 2013-03-06 14:55:20 -05:00
Makefile team: introduce random mode 2013-03-06 14:55:20 -05:00
team.c team: block mtu change before it happens via NETDEV_PRECHANGEMTU 2014-01-16 17:15:42 -08:00
team_mode_activebackup.c team: ab: set active port option as changed when port is leaving 2013-02-04 14:55:45 -05:00
team_mode_broadcast.c team: introduce two default team_modeop functions and use them in modes 2013-03-06 14:55:20 -05:00
team_mode_loadbalance.c net: Explicitly initialize u64_stats_sync structures for lockdep 2013-11-06 12:40:25 +01:00
team_mode_random.c random32: add prandom_u32_max and convert open coded users 2014-01-21 23:17:20 -08:00
team_mode_roundrobin.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-06-19 16:49:39 -07:00