buf_ring in HEAD is racy

Adrian Chadd adrian at freebsd.org
Tue Dec 17 16:49:51 UTC 2013


Try:

Index: sys/dev/ixgbe/ixgbe.c
===================================================================
--- sys/dev/ixgbe/ixgbe.c       (revision 2995)
+++ sys/dev/ixgbe/ixgbe.c       (working copy)
@@ -5178,6 +5178,7 @@
        struct ixgbe_hw *hw = &adapter->hw;
        u32  missed_rx = 0, bprc, lxon, lxoff, total;
        u64  total_missed_rx = 0;
+       u64  odrops = 0;

        adapter->stats.crcerrs += IXGBE_READ_REG(hw, IXGBE_CRCERRS);
        adapter->stats.illerrc += IXGBE_READ_REG(hw, IXGBE_ILLERRC);
@@ -5308,6 +5309,11 @@
                adapter->stats.fcoedwtc += IXGBE_READ_REG(hw, IXGBE_FCOEDWTC);
        }

+       /* TX drops */
+       for (int i = 0; i < adapter->num_queues; i++) {
+               odrops += adapter->tx_rings[i].br->br_drops;
+       }
+
        /* Fill out the OS statistics structure */
        ifp->if_ipackets = adapter->stats.gprc;
        ifp->if_opackets = adapter->stats.gptc;
@@ -5317,6 +5323,9 @@
        ifp->if_omcasts = adapter->stats.mptc;
        ifp->if_collisions = 0;

+       /* TX drops are stored in if_snd for now, not the top level counters */
+       ifp->if_snd.ifq_drops = odrops;
+
        /* Rx Errors */
        ifp->if_iqdrops = total_missed_rx;
        ifp->if_ierrors = adapter->stats.crcerrs + adapter->stats.rlec;


-adrian


More information about the freebsd-net mailing list