aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe/ixgbe_main.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-01-14 16:25:30 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-14 16:25:30 -0500
commitd018b6f4f1539f3679fbdc2d02d58d09e76be84a (patch)
tree317b9e04d8e7a73a4d07c69a5cb5455ec34f47e5 /drivers/net/ixgbe/ixgbe_main.c
parent18bce371ae09af6c20ee62c1092a4d1d0e84dd49 (diff)
parent0f73f2c5a3ebb957ee66718c903c17ed71a4fc2e (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (47 commits) GRETH: resolve SMP issues and other problems GRETH: handle frame error interrupts GRETH: avoid writing bad speed/duplex when setting transfer mode GRETH: fixed skb buffer memory leak on frame errors GRETH: GBit transmit descriptor handling optimization GRETH: fix opening/closing GRETH: added raw AMBA vendor/device number to match against. cassini: Fix build bustage on x86. e1000e: consistent use of Rx/Tx vs. RX/TX/rx/tx in comments/logs e1000e: update Copyright for 2011 e1000: Avoid unhandled IRQ r8169: keep firmware in memory. netdev: tilepro: Use is_unicast_ether_addr helper etherdevice.h: Add is_unicast_ether_addr function ks8695net: Use default implementation of ethtool_ops::get_link ks8695net: Disable non-working ethtool operations USB CDC NCM: Don't deref NULL in cdc_ncm_rx_fixup() and don't use uninitialized variable. vxge: Remember to release firmware after upgrading firmware netdev: bfin_mac: Remove is_multicast_ether_addr use in netdev_for_each_mc_addr ipsec: update MAX_AH_AUTH_LEN to support sha512 ...
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_main.c')
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index a060610a42d..602078b8489 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -6667,8 +6667,6 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb,
6667 struct ixgbe_adapter *adapter, 6667 struct ixgbe_adapter *adapter,
6668 struct ixgbe_ring *tx_ring) 6668 struct ixgbe_ring *tx_ring)
6669{ 6669{
6670 struct net_device *netdev = tx_ring->netdev;
6671 struct netdev_queue *txq;
6672 unsigned int first; 6670 unsigned int first;
6673 unsigned int tx_flags = 0; 6671 unsigned int tx_flags = 0;
6674 u8 hdr_len = 0; 6672 u8 hdr_len = 0;
@@ -6765,9 +6763,6 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb,
6765 /* add the ATR filter if ATR is on */ 6763 /* add the ATR filter if ATR is on */
6766 if (test_bit(__IXGBE_TX_FDIR_INIT_DONE, &tx_ring->state)) 6764 if (test_bit(__IXGBE_TX_FDIR_INIT_DONE, &tx_ring->state))
6767 ixgbe_atr(tx_ring, skb, tx_flags, protocol); 6765 ixgbe_atr(tx_ring, skb, tx_flags, protocol);
6768 txq = netdev_get_tx_queue(netdev, tx_ring->queue_index);
6769 txq->tx_bytes += skb->len;
6770 txq->tx_packets++;
6771 ixgbe_tx_queue(tx_ring, tx_flags, count, skb->len, hdr_len); 6766 ixgbe_tx_queue(tx_ring, tx_flags, count, skb->len, hdr_len);
6772 ixgbe_maybe_stop_tx(tx_ring, DESC_NEEDED); 6767 ixgbe_maybe_stop_tx(tx_ring, DESC_NEEDED);
6773 6768
@@ -6925,8 +6920,6 @@ static struct rtnl_link_stats64 *ixgbe_get_stats64(struct net_device *netdev,
6925 struct ixgbe_adapter *adapter = netdev_priv(netdev); 6920 struct ixgbe_adapter *adapter = netdev_priv(netdev);
6926 int i; 6921 int i;
6927 6922
6928 /* accurate rx/tx bytes/packets stats */
6929 dev_txq_stats_fold(netdev, stats);
6930 rcu_read_lock(); 6923 rcu_read_lock();
6931 for (i = 0; i < adapter->num_rx_queues; i++) { 6924 for (i = 0; i < adapter->num_rx_queues; i++) {
6932 struct ixgbe_ring *ring = ACCESS_ONCE(adapter->rx_ring[i]); 6925 struct ixgbe_ring *ring = ACCESS_ONCE(adapter->rx_ring[i]);
@@ -6943,6 +6936,22 @@ static struct rtnl_link_stats64 *ixgbe_get_stats64(struct net_device *netdev,
6943 stats->rx_bytes += bytes; 6936 stats->rx_bytes += bytes;
6944 } 6937 }
6945 } 6938 }
6939
6940 for (i = 0; i < adapter->num_tx_queues; i++) {
6941 struct ixgbe_ring *ring = ACCESS_ONCE(adapter->tx_ring[i]);
6942 u64 bytes, packets;
6943 unsigned int start;
6944
6945 if (ring) {
6946 do {
6947 start = u64_stats_fetch_begin_bh(&ring->syncp);
6948 packets = ring->stats.packets;
6949 bytes = ring->stats.bytes;
6950 } while (u64_stats_fetch_retry_bh(&ring->syncp, start));
6951 stats->tx_packets += packets;
6952 stats->tx_bytes += bytes;
6953 }
6954 }
6946 rcu_read_unlock(); 6955 rcu_read_unlock();
6947 /* following stats updated by ixgbe_watchdog_task() */ 6956 /* following stats updated by ixgbe_watchdog_task() */
6948 stats->multicast = netdev->stats.multicast; 6957 stats->multicast = netdev->stats.multicast;