aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe/ixgbe_main.c
diff options
context:
space:
mode:
authorAjit Khaparde <ajitkhaparde@gmail.com>2009-10-06 22:43:49 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-08 01:00:26 -0400
commit2d86f1393c62f9c3bae5c1207408ed6559aa3cc4 (patch)
tree631563e972a39da405eb9c3cae59296bb93e8750 /drivers/net/ixgbe/ixgbe_main.c
parent6dc3494183db0b93f49b193ac115073b72453b9c (diff)
ixgbe: Use the instance of net_device_stats from net_device.
Since net_device has an instance of net_device_stats, we can remove the instance of this from the private adapter structure. Signed-off-by: Ajit Khaparde <ajitk@serverengines.com> Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_main.c')
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index cbb143ca1eb8..c91d50e54427 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -372,8 +372,8 @@ static bool ixgbe_clean_tx_irq(struct ixgbe_q_vector *q_vector,
372 tx_ring->total_packets += total_packets; 372 tx_ring->total_packets += total_packets;
373 tx_ring->stats.packets += total_packets; 373 tx_ring->stats.packets += total_packets;
374 tx_ring->stats.bytes += total_bytes; 374 tx_ring->stats.bytes += total_bytes;
375 adapter->net_stats.tx_bytes += total_bytes; 375 netdev->stats.tx_bytes += total_bytes;
376 adapter->net_stats.tx_packets += total_packets; 376 netdev->stats.tx_packets += total_packets;
377 return (count < tx_ring->work_limit); 377 return (count < tx_ring->work_limit);
378} 378}
379 379
@@ -709,6 +709,7 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
709 int *work_done, int work_to_do) 709 int *work_done, int work_to_do)
710{ 710{
711 struct ixgbe_adapter *adapter = q_vector->adapter; 711 struct ixgbe_adapter *adapter = q_vector->adapter;
712 struct net_device *netdev = adapter->netdev;
712 struct pci_dev *pdev = adapter->pdev; 713 struct pci_dev *pdev = adapter->pdev;
713 union ixgbe_adv_rx_desc *rx_desc, *next_rxd; 714 union ixgbe_adv_rx_desc *rx_desc, *next_rxd;
714 struct ixgbe_rx_buffer *rx_buffer_info, *next_buffer; 715 struct ixgbe_rx_buffer *rx_buffer_info, *next_buffer;
@@ -880,8 +881,8 @@ next_desc:
880 881
881 rx_ring->total_packets += total_rx_packets; 882 rx_ring->total_packets += total_rx_packets;
882 rx_ring->total_bytes += total_rx_bytes; 883 rx_ring->total_bytes += total_rx_bytes;
883 adapter->net_stats.rx_bytes += total_rx_bytes; 884 netdev->stats.rx_bytes += total_rx_bytes;
884 adapter->net_stats.rx_packets += total_rx_packets; 885 netdev->stats.rx_packets += total_rx_packets;
885 886
886 return cleaned; 887 return cleaned;
887} 888}
@@ -4403,6 +4404,7 @@ static void ixgbe_shutdown(struct pci_dev *pdev)
4403 **/ 4404 **/
4404void ixgbe_update_stats(struct ixgbe_adapter *adapter) 4405void ixgbe_update_stats(struct ixgbe_adapter *adapter)
4405{ 4406{
4407 struct net_device *netdev = adapter->netdev;
4406 struct ixgbe_hw *hw = &adapter->hw; 4408 struct ixgbe_hw *hw = &adapter->hw;
4407 u64 total_mpc = 0; 4409 u64 total_mpc = 0;
4408 u32 i, missed_rx = 0, mpc, bprc, lxon, lxoff, xon_off_tot; 4410 u32 i, missed_rx = 0, mpc, bprc, lxon, lxoff, xon_off_tot;
@@ -4522,15 +4524,15 @@ void ixgbe_update_stats(struct ixgbe_adapter *adapter)
4522 adapter->stats.bptc += IXGBE_READ_REG(hw, IXGBE_BPTC); 4524 adapter->stats.bptc += IXGBE_READ_REG(hw, IXGBE_BPTC);
4523 4525
4524 /* Fill out the OS statistics structure */ 4526 /* Fill out the OS statistics structure */
4525 adapter->net_stats.multicast = adapter->stats.mprc; 4527 netdev->stats.multicast = adapter->stats.mprc;
4526 4528
4527 /* Rx Errors */ 4529 /* Rx Errors */
4528 adapter->net_stats.rx_errors = adapter->stats.crcerrs + 4530 netdev->stats.rx_errors = adapter->stats.crcerrs +
4529 adapter->stats.rlec; 4531 adapter->stats.rlec;
4530 adapter->net_stats.rx_dropped = 0; 4532 netdev->stats.rx_dropped = 0;
4531 adapter->net_stats.rx_length_errors = adapter->stats.rlec; 4533 netdev->stats.rx_length_errors = adapter->stats.rlec;
4532 adapter->net_stats.rx_crc_errors = adapter->stats.crcerrs; 4534 netdev->stats.rx_crc_errors = adapter->stats.crcerrs;
4533 adapter->net_stats.rx_missed_errors = total_mpc; 4535 netdev->stats.rx_missed_errors = total_mpc;
4534} 4536}
4535 4537
4536/** 4538/**
@@ -5300,10 +5302,8 @@ static netdev_tx_t ixgbe_xmit_frame(struct sk_buff *skb,
5300 **/ 5302 **/
5301static struct net_device_stats *ixgbe_get_stats(struct net_device *netdev) 5303static struct net_device_stats *ixgbe_get_stats(struct net_device *netdev)
5302{ 5304{
5303 struct ixgbe_adapter *adapter = netdev_priv(netdev);
5304
5305 /* only return the current stats */ 5305 /* only return the current stats */
5306 return &adapter->net_stats; 5306 return &netdev->stats;
5307} 5307}
5308 5308
5309/** 5309/**