]> git.baikalelectronics.ru Git - kernel.git/commit
bonding: refine bond_fold_stats() wrap detection
authorEric Dumazet <edumazet@google.com>
Wed, 29 Mar 2017 17:45:44 +0000 (10:45 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 30 Mar 2017 19:40:34 +0000 (12:40 -0700)
commit865d042024881814a5c1ad2e6791d6e56c1fa4c7
treec5f1c429b886d50480e7244d2275e18defa5de22
parent58f160ea16bfd18e890b5b8d970646e00a24fce7
bonding: refine bond_fold_stats() wrap detection

Some device drivers reset their stats at down/up events, possibly
fooling bonding stats, since they operate with relative deltas.

It is nearly not possible to fix drivers, since some of them compute the
tx/rx counters based on per rx/tx queue stats, and the queues can be
reconfigured (ethtool -L) between the down/up sequence.

Lets avoid accumulating 'negative' values that render bonding stats
useless.

It is better to lose small deltas, assuming the bonding stats are
fetched at a reasonable frequency.

Fixes: d714f17a6e01 ("bonding: make global bonding stats more reliable")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_main.c