OSDN Git Service

Merge branch 'netem-use-a-seeded-prng-for-loss-and-corruption-events'
authorJakub Kicinski <kuba@kernel.org>
Fri, 18 Aug 2023 02:15:07 +0000 (19:15 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 18 Aug 2023 02:15:08 +0000 (19:15 -0700)
commit0c2d8227ba7881306d8404a3a2ffd97ac479fc0a
treef27f4197ec501dabebe659449643875005102fff
parenta5e5b2cd47bc7ac853b3ae9d4af97d08caaf585d
parent3cad70bc74ef8471e30a05a90798904ce8f8feb5
Merge branch 'netem-use-a-seeded-prng-for-loss-and-corruption-events'

François Michel says:

====================
netem: use a seeded PRNG for loss and corruption events

In order to reproduce bugs or performance evaluation of
network protocols and applications, it is useful to have
reproducible test suites and tools. This patch adds
a way to specify a PRNG seed through the
TCA_NETEM_PRNG_SEED attribute for generating netem
loss and corruption events. Initializing the qdisc
with the same seed leads to the exact same loss
and corruption patterns. If no seed is explicitly
specified, the qdisc generates a random seed using
get_random_u64().

This patch can be and has been tested using tc from
the following iproute2-next fork:
https://github.com/francoismichel/iproute2-next

For instance, setting the seed 42424242 on the loopback
with a loss rate of 10% will systematically drop the 5th,
12th and 24th packet when sending 25 packets.
====================

Link: https://lore.kernel.org/r/20230815092348.1449179-1-francois.michel@uclouvain.be
Signed-off-by: Jakub Kicinski <kuba@kernel.org>