ixgbe: Track instances of buffer available but no DMA resources present
authorAlexander Duyck <alexander.h.duyck@intel.com>
Wed, 28 Mar 2012 08:03:32 +0000 (08:03 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 4 May 2012 10:17:21 +0000 (03:17 -0700)
This change makes it so that we can track instances of where a packet was
dropped due to a packet being received when there are no DMA buffers
available in the ring.

For some reason this was only being enabled with RSC, however it makes
more sense to always have this feature on so that we can track any cases
where we might drop a buffer due to an Rx ring being full.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

index 688c7bb921894beac5d64c2fbfd1ace32ea61873..09409ae9b6886a55e3c511d7a81e04457f04f0c4 100644 (file)
@@ -4967,9 +4967,6 @@ void ixgbe_update_stats(struct ixgbe_adapter *adapter)
        if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) {
                u64 rsc_count = 0;
                u64 rsc_flush = 0;
-               for (i = 0; i < 16; i++)
-                       adapter->hw_rx_no_dma_resources +=
-                               IXGBE_READ_REG(hw, IXGBE_QPRDC(i));
                for (i = 0; i < adapter->num_rx_queues; i++) {
                        rsc_count += adapter->rx_ring[i]->rx_stats.rsc_count;
                        rsc_flush += adapter->rx_ring[i]->rx_stats.rsc_flush;
@@ -5072,6 +5069,9 @@ void ixgbe_update_stats(struct ixgbe_adapter *adapter)
                hwstats->b2ospc += IXGBE_READ_REG(hw, IXGBE_B2OSPC);
                hwstats->b2ogprc += IXGBE_READ_REG(hw, IXGBE_B2OGPRC);
        case ixgbe_mac_82599EB:
+               for (i = 0; i < 16; i++)
+                       adapter->hw_rx_no_dma_resources +=
+                                            IXGBE_READ_REG(hw, IXGBE_QPRDC(i));
                hwstats->gorc += IXGBE_READ_REG(hw, IXGBE_GORCL);
                IXGBE_READ_REG(hw, IXGBE_GORCH); /* to clear */
                hwstats->gotc += IXGBE_READ_REG(hw, IXGBE_GOTCL);