Author: erj
Date: Thu Jan  2 22:57:21 2020
New Revision: 356302
URL: https://svnweb.freebsd.org/changeset/base/356302

Log:
  MFC isc_pause_frame field fixes to Intel ethernet drivers
  
  This MFC includes: r353656, r353657, r353658, and r353661
  
  Sponsored by: Intel Corporation

Modified:
  stable/12/sys/dev/e1000/if_em.c
  stable/12/sys/dev/ixgbe/if_ix.c
  stable/12/sys/dev/ixl/ixl_pf_main.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/e1000/if_em.c
==============================================================================
--- stable/12/sys/dev/e1000/if_em.c     Thu Jan  2 22:52:31 2020        
(r356301)
+++ stable/12/sys/dev/e1000/if_em.c     Thu Jan  2 22:57:21 2020        
(r356302)
@@ -3903,6 +3903,7 @@ em_disable_aspm(struct adapter *adapter)
 static void
 em_update_stats_counters(struct adapter *adapter)
 {
+       u64 prev_xoffrxc = adapter->stats.xoffrxc;
 
        if(adapter->hw.phy.media_type == e1000_media_type_copper ||
           (E1000_READ_REG(&adapter->hw, E1000_STATUS) & E1000_STATUS_LU)) {
@@ -3926,7 +3927,8 @@ em_update_stats_counters(struct adapter *adapter)
         ** For watchdog management we need to know if we have been
         ** paused during the last interval, so capture that here.
        */
-       adapter->shared->isc_pause_frames = adapter->stats.xoffrxc;
+       if (adapter->stats.xoffrxc != prev_xoffrxc)
+               adapter->shared->isc_pause_frames = 1;
        adapter->stats.xofftxc += E1000_READ_REG(&adapter->hw, E1000_XOFFTXC);
        adapter->stats.fcruc += E1000_READ_REG(&adapter->hw, E1000_FCRUC);
        adapter->stats.prc64 += E1000_READ_REG(&adapter->hw, E1000_PRC64);

Modified: stable/12/sys/dev/ixgbe/if_ix.c
==============================================================================
--- stable/12/sys/dev/ixgbe/if_ix.c     Thu Jan  2 22:52:31 2020        
(r356301)
+++ stable/12/sys/dev/ixgbe/if_ix.c     Thu Jan  2 22:57:21 2020        
(r356302)
@@ -1392,6 +1392,7 @@ ixgbe_update_stats_counters(struct adapter *adapter)
        struct ixgbe_hw       *hw = &adapter->hw;
        struct ixgbe_hw_stats *stats = &adapter->stats.pf;
        u32                   missed_rx = 0, bprc, lxon, lxoff, total;
+       u32                   lxoffrxc;
        u64                   total_missed_rx = 0;
 
        stats->crcerrs += IXGBE_READ_REG(hw, IXGBE_CRCERRS);
@@ -1421,15 +1422,24 @@ ixgbe_update_stats_counters(struct adapter *adapter)
                stats->tor += IXGBE_READ_REG(hw, IXGBE_TORL) +
                    ((u64)IXGBE_READ_REG(hw, IXGBE_TORH) << 32);
                stats->lxonrxc += IXGBE_READ_REG(hw, IXGBE_LXONRXCNT);
-               stats->lxoffrxc += IXGBE_READ_REG(hw, IXGBE_LXOFFRXCNT);
+               lxoffrxc = IXGBE_READ_REG(hw, IXGBE_LXOFFRXCNT);
+               stats->lxoffrxc += lxoffrxc;
        } else {
                stats->lxonrxc += IXGBE_READ_REG(hw, IXGBE_LXONRXC);
-               stats->lxoffrxc += IXGBE_READ_REG(hw, IXGBE_LXOFFRXC);
+               lxoffrxc = IXGBE_READ_REG(hw, IXGBE_LXOFFRXC);
+               stats->lxoffrxc += lxoffrxc;
                /* 82598 only has a counter in the high register */
                stats->gorc += IXGBE_READ_REG(hw, IXGBE_GORCH);
                stats->gotc += IXGBE_READ_REG(hw, IXGBE_GOTCH);
                stats->tor += IXGBE_READ_REG(hw, IXGBE_TORH);
        }
+
+       /*
+        * For watchdog management we need to know if we have been paused
+        * during the last interval, so capture that here.
+       */
+       if (lxoffrxc)
+               adapter->shared->isc_pause_frames = 1;
 
        /*
         * Workaround: mprc hardware is incorrectly counting

Modified: stable/12/sys/dev/ixl/ixl_pf_main.c
==============================================================================
--- stable/12/sys/dev/ixl/ixl_pf_main.c Thu Jan  2 22:52:31 2020        
(r356301)
+++ stable/12/sys/dev/ixl/ixl_pf_main.c Thu Jan  2 22:57:21 2020        
(r356302)
@@ -2604,6 +2604,7 @@ ixl_update_stats_counters(struct ixl_pf *pf)
        struct i40e_hw  *hw = &pf->hw;
        struct ixl_vsi  *vsi = &pf->vsi;
        struct ixl_vf   *vf;
+       u64 prev_link_xoff_rx = pf->stats.link_xoff_rx;
 
        struct i40e_hw_port_stats *nsd = &pf->stats;
        struct i40e_hw_port_stats *osd = &pf->stats_offsets;
@@ -2688,6 +2689,13 @@ ixl_update_stats_counters(struct ixl_pf *pf)
        ixl_stat_update32(hw, I40E_GLPRT_LXOFFTXC(hw->port),
                           pf->stat_offsets_loaded,
                           &osd->link_xoff_tx, &nsd->link_xoff_tx);
+
+       /*
+        * For watchdog management we need to know if we have been paused
+        * during the last interval, so capture that here.
+        */
+       if (pf->stats.link_xoff_rx != prev_link_xoff_rx)
+               vsi->shared->isc_pause_frames = 1;
 
        /* Packet size stats rx */
        ixl_stat_update48(hw, I40E_GLPRT_PRC64H(hw->port),
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to