Skip to content

Commit 3c13ce7

Browse files
catSully012davem330
authored andcommitted
gve: Fix u64_stats_sync to initialize start
u64_stats_fetch_begin needs to initialize start. Signed-off-by: Catherine Sullivan <[email protected]> Reported-by: kbuild test robot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d62962b commit 3c13ce7

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

drivers/net/ethernet/google/gve/gve_ethtool.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ gve_get_ethtool_stats(struct net_device *netdev,
102102
ring < priv->rx_cfg.num_queues; ring++) {
103103
if (priv->rx) {
104104
do {
105-
u64_stats_fetch_begin(&priv->rx[ring].statss);
105+
start =
106+
u64_stats_fetch_begin(&priv->rx[ring].statss);
106107
rx_pkts += priv->rx[ring].rpackets;
107108
rx_bytes += priv->rx[ring].rbytes;
108109
} while (u64_stats_fetch_retry(&priv->rx[ring].statss,
@@ -113,7 +114,8 @@ gve_get_ethtool_stats(struct net_device *netdev,
113114
ring < priv->tx_cfg.num_queues; ring++) {
114115
if (priv->tx) {
115116
do {
116-
u64_stats_fetch_begin(&priv->tx[ring].statss);
117+
start =
118+
u64_stats_fetch_begin(&priv->tx[ring].statss);
117119
tx_pkts += priv->tx[ring].pkt_done;
118120
tx_bytes += priv->tx[ring].bytes_done;
119121
} while (u64_stats_fetch_retry(&priv->tx[ring].statss,

drivers/net/ethernet/google/gve/gve_main.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ static void gve_get_stats(struct net_device *dev, struct rtnl_link_stats64 *s)
3535
if (priv->rx) {
3636
for (ring = 0; ring < priv->rx_cfg.num_queues; ring++) {
3737
do {
38-
u64_stats_fetch_begin(&priv->rx[ring].statss);
38+
start =
39+
u64_stats_fetch_begin(&priv->rx[ring].statss);
3940
s->rx_packets += priv->rx[ring].rpackets;
4041
s->rx_bytes += priv->rx[ring].rbytes;
4142
} while (u64_stats_fetch_retry(&priv->rx[ring].statss,
@@ -45,7 +46,8 @@ static void gve_get_stats(struct net_device *dev, struct rtnl_link_stats64 *s)
4546
if (priv->tx) {
4647
for (ring = 0; ring < priv->tx_cfg.num_queues; ring++) {
4748
do {
48-
u64_stats_fetch_begin(&priv->tx[ring].statss);
49+
start =
50+
u64_stats_fetch_begin(&priv->tx[ring].statss);
4951
s->tx_packets += priv->tx[ring].pkt_done;
5052
s->tx_bytes += priv->tx[ring].bytes_done;
5153
} while (u64_stats_fetch_retry(&priv->rx[ring].statss,

0 commit comments

Comments
 (0)