]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
i40evf: Use net_device_stats from struct net_device
authorTobias Klauser <tklauser@distanz.ch>
Thu, 6 Apr 2017 06:46:28 +0000 (08:46 +0200)
committerJack Vogel <jack.vogel@oracle.com>
Tue, 10 Oct 2017 21:15:22 +0000 (14:15 -0700)
Instead of using a private copy of struct net_device_stats in
struct i40evf_adapter, use stats from struct net_device. Also remove the
now unnecessary .ndo_get_stats function.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Orabug: 26785018
(cherry picked from commit 4a0a3abfd951943f770f5306d32f8640f55568c4)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Reviewed-by: Kyle Fortin <kyle.fortin@oracle.com>
drivers/net/ethernet/intel/i40evf/i40evf.h
drivers/net/ethernet/intel/i40evf/i40evf_main.c
drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c

index 66bd8cf8b0dbda4cb537dfd2c81e05da3e80b366..327543d6e30ae8668c5650f5b3d3c87b4ab509b5 100644 (file)
@@ -246,7 +246,6 @@ struct i40evf_adapter {
        /* OS defined structs */
        struct net_device *netdev;
        struct pci_dev *pdev;
-       struct net_device_stats net_stats;
 
        struct i40e_hw hw; /* defined in i40e_type.h */
 
index f7223bb09e56b5a2da26f4ce0ea0025abe9b79cb..042b0e1b4216697817ddfde900d9b9dce91e4abc 100644 (file)
@@ -2179,21 +2179,6 @@ static int i40evf_close(struct net_device *netdev)
        return 0;
 }
 
-/**
- * i40evf_get_stats - Get System Network Statistics
- * @netdev: network interface device structure
- *
- * Returns the address of the device statistics structure.
- * The statistics are actually updated from the timer callback.
- **/
-static struct net_device_stats *i40evf_get_stats(struct net_device *netdev)
-{
-       struct i40evf_adapter *adapter = netdev_priv(netdev);
-
-       /* only return the current stats */
-       return &adapter->net_stats;
-}
-
 /**
  * i40evf_change_mtu - Change the Maximum Transfer Unit
  * @netdev: network interface device structure
@@ -2300,7 +2285,6 @@ static const struct net_device_ops i40evf_netdev_ops = {
        .ndo_open               = i40evf_open,
        .ndo_stop               = i40evf_close,
        .ndo_start_xmit         = i40evf_xmit_frame,
-       .ndo_get_stats          = i40evf_get_stats,
        .ndo_set_rx_mode        = i40evf_set_rx_mode,
        .ndo_validate_addr      = eth_validate_addr,
        .ndo_set_mac_address    = i40evf_set_mac,
index 09dcf5b97bc22da03055eb98e04c0a1096fe1aec..e2a2cf2d1365592cf9fd8c78ca16a7bda7fdd135 100644 (file)
@@ -957,17 +957,17 @@ void i40evf_virtchnl_completion(struct i40evf_adapter *adapter,
        case I40E_VIRTCHNL_OP_GET_STATS: {
                struct i40e_eth_stats *stats =
                        (struct i40e_eth_stats *)msg;
-               adapter->net_stats.rx_packets = stats->rx_unicast +
-                                                stats->rx_multicast +
-                                                stats->rx_broadcast;
-               adapter->net_stats.tx_packets = stats->tx_unicast +
-                                                stats->tx_multicast +
-                                                stats->tx_broadcast;
-               adapter->net_stats.rx_bytes = stats->rx_bytes;
-               adapter->net_stats.tx_bytes = stats->tx_bytes;
-               adapter->net_stats.tx_errors = stats->tx_errors;
-               adapter->net_stats.rx_dropped = stats->rx_discards;
-               adapter->net_stats.tx_dropped = stats->tx_discards;
+               netdev->stats.rx_packets = stats->rx_unicast +
+                                          stats->rx_multicast +
+                                          stats->rx_broadcast;
+               netdev->stats.tx_packets = stats->tx_unicast +
+                                          stats->tx_multicast +
+                                          stats->tx_broadcast;
+               netdev->stats.rx_bytes = stats->rx_bytes;
+               netdev->stats.tx_bytes = stats->tx_bytes;
+               netdev->stats.tx_errors = stats->tx_errors;
+               netdev->stats.rx_dropped = stats->rx_discards;
+               netdev->stats.tx_dropped = stats->tx_discards;
                adapter->current_stats = *stats;
                }
                break;