Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 170487
b: refs/heads/master
c: 2d86f13
h: refs/heads/master
i:
  170485: bdf8740
  170483: c7ddda1
  170479: 84c774d
v: v3
  • Loading branch information
Ajit Khaparde authored and David S. Miller committed Oct 8, 2009
1 parent 3509126 commit d0972d4
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 34 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6dc3494183db0b93f49b193ac115073b72453b9c
refs/heads/master: 2d86f1393c62f9c3bae5c1207408ed6559aa3cc4
1 change: 0 additions & 1 deletion trunk/drivers/net/ixgbe/ixgbe.h
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,6 @@ struct ixgbe_adapter {
/* OS defined structs */
struct net_device *netdev;
struct pci_dev *pdev;
struct net_device_stats net_stats;

u32 test_icr;
struct ixgbe_ring test_tx_ring;
Expand Down
40 changes: 21 additions & 19 deletions trunk/drivers/net/ixgbe/ixgbe_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,38 +48,40 @@ struct ixgbe_stats {

#define IXGBE_STAT(m) sizeof(((struct ixgbe_adapter *)0)->m), \
offsetof(struct ixgbe_adapter, m)
#define IXGBE_NETDEV_STAT(m) sizeof(((struct net_device *)0)->m), \
offsetof(struct net_device, m)
static struct ixgbe_stats ixgbe_gstrings_stats[] = {
{"rx_packets", IXGBE_STAT(net_stats.rx_packets)},
{"tx_packets", IXGBE_STAT(net_stats.tx_packets)},
{"rx_bytes", IXGBE_STAT(net_stats.rx_bytes)},
{"tx_bytes", IXGBE_STAT(net_stats.tx_bytes)},
{"rx_packets", IXGBE_NETDEV_STAT(stats.rx_packets)},
{"tx_packets", IXGBE_NETDEV_STAT(stats.tx_packets)},
{"rx_bytes", IXGBE_NETDEV_STAT(stats.rx_bytes)},
{"tx_bytes", IXGBE_NETDEV_STAT(stats.tx_bytes)},
{"rx_pkts_nic", IXGBE_STAT(stats.gprc)},
{"tx_pkts_nic", IXGBE_STAT(stats.gptc)},
{"rx_bytes_nic", IXGBE_STAT(stats.gorc)},
{"tx_bytes_nic", IXGBE_STAT(stats.gotc)},
{"lsc_int", IXGBE_STAT(lsc_int)},
{"tx_busy", IXGBE_STAT(tx_busy)},
{"non_eop_descs", IXGBE_STAT(non_eop_descs)},
{"rx_errors", IXGBE_STAT(net_stats.rx_errors)},
{"tx_errors", IXGBE_STAT(net_stats.tx_errors)},
{"rx_dropped", IXGBE_STAT(net_stats.rx_dropped)},
{"tx_dropped", IXGBE_STAT(net_stats.tx_dropped)},
{"multicast", IXGBE_STAT(net_stats.multicast)},
{"rx_errors", IXGBE_NETDEV_STAT(stats.rx_errors)},
{"tx_errors", IXGBE_NETDEV_STAT(stats.tx_errors)},
{"rx_dropped", IXGBE_NETDEV_STAT(stats.rx_dropped)},
{"tx_dropped", IXGBE_NETDEV_STAT(stats.tx_dropped)},
{"multicast", IXGBE_NETDEV_STAT(stats.multicast)},
{"broadcast", IXGBE_STAT(stats.bprc)},
{"rx_no_buffer_count", IXGBE_STAT(stats.rnbc[0]) },
{"collisions", IXGBE_STAT(net_stats.collisions)},
{"rx_over_errors", IXGBE_STAT(net_stats.rx_over_errors)},
{"rx_crc_errors", IXGBE_STAT(net_stats.rx_crc_errors)},
{"rx_frame_errors", IXGBE_STAT(net_stats.rx_frame_errors)},
{"collisions", IXGBE_NETDEV_STAT(stats.collisions)},
{"rx_over_errors", IXGBE_NETDEV_STAT(stats.rx_over_errors)},
{"rx_crc_errors", IXGBE_NETDEV_STAT(stats.rx_crc_errors)},
{"rx_frame_errors", IXGBE_NETDEV_STAT(stats.rx_frame_errors)},
{"hw_rsc_count", IXGBE_STAT(rsc_count)},
{"fdir_match", IXGBE_STAT(stats.fdirmatch)},
{"fdir_miss", IXGBE_STAT(stats.fdirmiss)},
{"rx_fifo_errors", IXGBE_STAT(net_stats.rx_fifo_errors)},
{"rx_missed_errors", IXGBE_STAT(net_stats.rx_missed_errors)},
{"tx_aborted_errors", IXGBE_STAT(net_stats.tx_aborted_errors)},
{"tx_carrier_errors", IXGBE_STAT(net_stats.tx_carrier_errors)},
{"tx_fifo_errors", IXGBE_STAT(net_stats.tx_fifo_errors)},
{"tx_heartbeat_errors", IXGBE_STAT(net_stats.tx_heartbeat_errors)},
{"rx_fifo_errors", IXGBE_NETDEV_STAT(stats.rx_fifo_errors)},
{"rx_missed_errors", IXGBE_NETDEV_STAT(stats.rx_missed_errors)},
{"tx_aborted_errors", IXGBE_NETDEV_STAT(stats.tx_aborted_errors)},
{"tx_carrier_errors", IXGBE_NETDEV_STAT(stats.tx_carrier_errors)},
{"tx_fifo_errors", IXGBE_NETDEV_STAT(stats.tx_fifo_errors)},
{"tx_heartbeat_errors", IXGBE_NETDEV_STAT(stats.tx_heartbeat_errors)},
{"tx_timeout_count", IXGBE_STAT(tx_timeout_count)},
{"tx_restart_queue", IXGBE_STAT(restart_queue)},
{"rx_long_length_errors", IXGBE_STAT(stats.roc)},
Expand Down
26 changes: 13 additions & 13 deletions trunk/drivers/net/ixgbe/ixgbe_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,8 @@ static bool ixgbe_clean_tx_irq(struct ixgbe_q_vector *q_vector,
tx_ring->total_packets += total_packets;
tx_ring->stats.packets += total_packets;
tx_ring->stats.bytes += total_bytes;
adapter->net_stats.tx_bytes += total_bytes;
adapter->net_stats.tx_packets += total_packets;
netdev->stats.tx_bytes += total_bytes;
netdev->stats.tx_packets += total_packets;
return (count < tx_ring->work_limit);
}

Expand Down Expand Up @@ -709,6 +709,7 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
int *work_done, int work_to_do)
{
struct ixgbe_adapter *adapter = q_vector->adapter;
struct net_device *netdev = adapter->netdev;
struct pci_dev *pdev = adapter->pdev;
union ixgbe_adv_rx_desc *rx_desc, *next_rxd;
struct ixgbe_rx_buffer *rx_buffer_info, *next_buffer;
Expand Down Expand Up @@ -880,8 +881,8 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,

rx_ring->total_packets += total_rx_packets;
rx_ring->total_bytes += total_rx_bytes;
adapter->net_stats.rx_bytes += total_rx_bytes;
adapter->net_stats.rx_packets += total_rx_packets;
netdev->stats.rx_bytes += total_rx_bytes;
netdev->stats.rx_packets += total_rx_packets;

return cleaned;
}
Expand Down Expand Up @@ -4403,6 +4404,7 @@ static void ixgbe_shutdown(struct pci_dev *pdev)
**/
void ixgbe_update_stats(struct ixgbe_adapter *adapter)
{
struct net_device *netdev = adapter->netdev;
struct ixgbe_hw *hw = &adapter->hw;
u64 total_mpc = 0;
u32 i, missed_rx = 0, mpc, bprc, lxon, lxoff, xon_off_tot;
Expand Down Expand Up @@ -4522,15 +4524,15 @@ void ixgbe_update_stats(struct ixgbe_adapter *adapter)
adapter->stats.bptc += IXGBE_READ_REG(hw, IXGBE_BPTC);

/* Fill out the OS statistics structure */
adapter->net_stats.multicast = adapter->stats.mprc;
netdev->stats.multicast = adapter->stats.mprc;

/* Rx Errors */
adapter->net_stats.rx_errors = adapter->stats.crcerrs +
netdev->stats.rx_errors = adapter->stats.crcerrs +
adapter->stats.rlec;
adapter->net_stats.rx_dropped = 0;
adapter->net_stats.rx_length_errors = adapter->stats.rlec;
adapter->net_stats.rx_crc_errors = adapter->stats.crcerrs;
adapter->net_stats.rx_missed_errors = total_mpc;
netdev->stats.rx_dropped = 0;
netdev->stats.rx_length_errors = adapter->stats.rlec;
netdev->stats.rx_crc_errors = adapter->stats.crcerrs;
netdev->stats.rx_missed_errors = total_mpc;
}

/**
Expand Down Expand Up @@ -5300,10 +5302,8 @@ static netdev_tx_t ixgbe_xmit_frame(struct sk_buff *skb,
**/
static struct net_device_stats *ixgbe_get_stats(struct net_device *netdev)
{
struct ixgbe_adapter *adapter = netdev_priv(netdev);

/* only return the current stats */
return &adapter->net_stats;
return &netdev->stats;
}

/**
Expand Down

0 comments on commit d0972d4

Please sign in to comment.