]> git.baikalelectronics.ru Git - kernel.git/commit
gve: fix gve_get_stats()
authorEric Dumazet <edumazet@google.com>
Wed, 6 Oct 2021 00:30:30 +0000 (17:30 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 6 Oct 2021 14:11:51 +0000 (15:11 +0100)
commitfcdfb122c6b32c4932b1accaafdb027903a00ebf
tree241e39731a4a09e04fc447085c1eb5f080e166d6
parent3589d3d09fc174728d0fc65b2396bb13eb7f08dd
gve: fix gve_get_stats()

gve_get_stats() can report wrong numbers if/when u64_stats_fetch_retry()
returns true.

What is needed here is to sample values in temporary variables,
and only use them after each loop is ended.

Fixes: a4381dfb8043 ("gve: Add transmit and receive support")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Catherine Sullivan <csully@google.com>
Cc: Sagi Shahar <sagis@google.com>
Cc: Jon Olson <jonolson@google.com>
Cc: Willem de Bruijn <willemb@google.com>
Cc: Luigi Rizzo <lrizzo@google.com>
Cc: Jeroen de Borst <jeroendb@google.com>
Cc: Tao Liu <xliutaox@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/google/gve/gve_main.c