On 6/26/2019 11:52 AM, Catherine Sullivan wrote: [snip] > +static void > +gve_get_ethtool_stats(struct net_device *netdev, > + struct ethtool_stats *stats, u64 *data) > +{ > + struct gve_priv *priv = netdev_priv(netdev); > + u64 rx_pkts, rx_bytes, tx_pkts, tx_bytes; > + int ring; > + int i; > + > + ASSERT_RTNL(); > + > + if (!netif_carrier_ok(netdev)) > + return; > + > + for (rx_pkts = 0, rx_bytes = 0, ring = 0; > + ring < priv->rx_cfg.num_queues; ring++) { > + rx_pkts += priv->rx[ring].rpackets; > + rx_bytes += priv->rx[ring].rbytes; > + } > + for (tx_pkts = 0, tx_bytes = 0, ring = 0; > + ring < priv->tx_cfg.num_queues; ring++) { > + tx_pkts += priv->tx[ring].pkt_done; > + tx_bytes += priv->tx[ring].bytes_done; > + } Maybe you do not need to support 32-bit guests with that driver, but you might as well be correct and use the include/linux/u64_stats_sync.h primitives to help return consistent 64-bit stats on 32-bit machines. [snip] > +int gve_adjust_queues(struct gve_priv *priv, > + struct gve_queue_config new_rx_config, > + struct gve_queue_config new_tx_config) > +{ > + int err; > + > + if (netif_carrier_ok(priv->dev)) { Should not that be netif_running()? -- Florian
- Re: [net-next 1/4] gve: Add basic driver frame... Catherine Sullivan
- Re: [net-next 1/4] gve: Add basic driver f... Jakub Kicinski
- Re: [net-next 1/4] gve: Add basic driv... Andrew Lunn
- Re: [net-next 1/4] gve: Add basic... Catherine Sullivan
- [RFC PATCH] gve: gve_version_prefix[] can be stati... kbuild test robot
- Re: [net-next 1/4] gve: Add basic driver framework... kbuild test robot
- Re: [net-next 1/4] gve: Add basic driver framework... kbuild test robot
- [net-next 4/4] gve: Add ethtool support Catherine Sullivan
- Re: [net-next 4/4] gve: Add ethtool support Andrew Lunn
- Re: [net-next 4/4] gve: Add ethtool support Catherine Sullivan
- Re: [net-next 4/4] gve: Add ethtool support Florian Fainelli
- Re: [net-next 4/4] gve: Add ethtool support Catherine Sullivan
- Re: [net-next 4/4] gve: Add ethtool support kbuild test robot
- [RFC PATCH] gve: gve_get_channels() can be static kbuild test robot
- [net-next 2/4] gve: Add transmit and receive support Catherine Sullivan
- Re: [net-next 2/4] gve: Add transmit and receive s... Andrew Lunn
- Re: [net-next 2/4] gve: Add transmit and recei... Catherine Sullivan
- Re: [net-next 2/4] gve: Add transmit and receive s... David Miller
- Re: [net-next 2/4] gve: Add transmit and recei... Catherine Sullivan
- Re: [net-next 2/4] gve: Add transmit and receive s... kbuild test robot
- [RFC PATCH] gve: gve_napi_poll() can be static kbuild test robot