Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci/ixgbe Document says M[LR]FC are valid when link ...



details:   https://anonhg.NetBSD.org/src/rev/89b44644f3e0
branches:  trunk
changeset: 824073:89b44644f3e0
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Mon May 22 07:23:55 2017 +0000

description:
Document says M[LR]FC are valid when link is up and 10Gbps, so:
 - Add those values when link is up and 10Gbps
 - Discard those vaules when link becomes up and the speed is 10Gbps

diffstat:

 sys/dev/pci/ixgbe/ixgbe.c |  23 ++++++++++++++++++++---
 1 files changed, 20 insertions(+), 3 deletions(-)

diffs (50 lines):

diff -r cf3cefcc8448 -r 89b44644f3e0 sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Mon May 22 06:35:04 2017 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Mon May 22 07:23:55 2017 +0000
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixgbe.c,v 1.82 2017/05/18 08:27:19 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.83 2017/05/22 07:23:55 msaitoh Exp $*/
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -2379,9 +2379,21 @@
 {
        struct ifnet    *ifp = adapter->ifp;
        device_t dev = adapter->dev;
+       struct ixgbe_hw *hw = &adapter->hw;
 
        if (adapter->link_up){ 
                if (adapter->link_active == FALSE) {
+                       if (adapter->link_speed == IXGBE_LINK_SPEED_10GB_FULL){
+                               /*
+                                *  Discard count for both MAC Local Fault and
+                                * Remote Fault because those registers are
+                                * valid only when the link speed is up and
+                                * 10Gbps.
+                                */
+                               IXGBE_READ_REG(hw, IXGBE_MLFC);
+                               IXGBE_READ_REG(hw, IXGBE_MRFC);
+                       }
+
                        if (bootverbose)
                                device_printf(dev,"Link is up %d Gbps %s \n",
                                    ((adapter->link_speed == 128)? 10:1),
@@ -4352,8 +4364,13 @@
                
        }
        stats->mpctotal.ev_count += total_missed_rx;
-       stats->mlfc.ev_count += IXGBE_READ_REG(hw, IXGBE_MLFC);
-       stats->mrfc.ev_count += IXGBE_READ_REG(hw, IXGBE_MRFC);
+
+       /* Document says M[LR]FC are valid when link is up and 10Gbps */
+       if ((adapter->link_active == TRUE)
+           && (adapter->link_speed == IXGBE_LINK_SPEED_10GB_FULL)) {
+               stats->mlfc.ev_count += IXGBE_READ_REG(hw, IXGBE_MLFC);
+               stats->mrfc.ev_count += IXGBE_READ_REG(hw, IXGBE_MRFC);
+       }
        rlec = IXGBE_READ_REG(hw, IXGBE_RLEC);
        stats->rlec.ev_count += rlec;
 



Home | Main Index | Thread Index | Old Index