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 Count Bad SFD (Start Frame Delimiter). X55...



details:   https://anonhg.NetBSD.org/src/rev/81109f0d2818
branches:  trunk
changeset: 824169:81109f0d2818
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Fri May 26 08:36:41 2017 +0000

description:
Count Bad SFD (Start Frame Delimiter). X550 and newer have this register.

diffstat:

 sys/dev/pci/ixgbe/ixgbe.c        |  10 +++++++++-
 sys/dev/pci/ixgbe/ixgbe_common.c |   4 +++-
 sys/dev/pci/ixgbe/ixgbe_type.h   |   4 +++-
 3 files changed, 15 insertions(+), 3 deletions(-)

diffs (97 lines):

diff -r 900e8a55a42e -r 81109f0d2818 sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Fri May 26 08:26:22 2017 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Fri May 26 08:36:41 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.85 2017/05/26 07:42:15 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.86 2017/05/26 08:36:41 msaitoh Exp $*/
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -896,6 +896,8 @@
        evcnt_detach(&stats->illerrc);
        evcnt_detach(&stats->errbc);
        evcnt_detach(&stats->mspdc);
+       if (hw->mac.type >= ixgbe_mac_X550)
+               evcnt_detach(&stats->mbsdc);
        evcnt_detach(&stats->mpctotal);
        evcnt_detach(&stats->mlfc);
        evcnt_detach(&stats->mrfc);
@@ -4363,6 +4365,8 @@
        stats->illerrc.ev_count += IXGBE_READ_REG(hw, IXGBE_ILLERRC);
        stats->errbc.ev_count += IXGBE_READ_REG(hw, IXGBE_ERRBC);
        stats->mspdc.ev_count += IXGBE_READ_REG(hw, IXGBE_MSPDC);
+       if (hw->mac.type == ixgbe_mac_X550)
+               stats->mbsdc.ev_count += IXGBE_READ_REG(hw, IXGBE_MBSDC);
 
        for (int i = 0; i < __arraycount(stats->qprc); i++) {
                int j = i % adapter->num_queues;
@@ -4998,6 +5002,9 @@
            stats->namebuf, "Byte Errors");
        evcnt_attach_dynamic(&stats->mspdc, EVCNT_TYPE_MISC, NULL,
            stats->namebuf, "MAC Short Packets Discarded");
+       if (hw->mac.type >= ixgbe_mac_X550)
+               evcnt_attach_dynamic(&stats->mbsdc, EVCNT_TYPE_MISC, NULL,
+                   stats->namebuf, "Bad SFD");
        evcnt_attach_dynamic(&stats->mpctotal, EVCNT_TYPE_MISC, NULL,
            stats->namebuf, "Total Packets Missed");
        evcnt_attach_dynamic(&stats->mlfc, EVCNT_TYPE_MISC, NULL,
@@ -5149,6 +5156,7 @@
        stats->illerrc.ev_count = 0;
        stats->errbc.ev_count = 0;
        stats->mspdc.ev_count = 0;
+       stats->mbsdc.ev_count = 0;
        stats->mpctotal.ev_count = 0;
        stats->mlfc.ev_count = 0;
        stats->mrfc.ev_count = 0;
diff -r 900e8a55a42e -r 81109f0d2818 sys/dev/pci/ixgbe/ixgbe_common.c
--- a/sys/dev/pci/ixgbe/ixgbe_common.c  Fri May 26 08:26:22 2017 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe_common.c  Fri May 26 08:36:41 2017 +0000
@@ -31,7 +31,7 @@
 
 ******************************************************************************/
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_common.c 299200 2016-05-06 22:54:56Z pfg $*/
-/*$NetBSD: ixgbe_common.c,v 1.12 2017/01/19 06:56:33 msaitoh Exp $*/
+/*$NetBSD: ixgbe_common.c,v 1.13 2017/05/26 08:36:42 msaitoh Exp $*/
 
 #include "ixgbe_common.h"
 #include "ixgbe_phy.h"
@@ -493,6 +493,8 @@
        IXGBE_READ_REG(hw, IXGBE_ILLERRC);
        IXGBE_READ_REG(hw, IXGBE_ERRBC);
        IXGBE_READ_REG(hw, IXGBE_MSPDC);
+       if (hw->mac.type >= ixgbe_mac_X550)
+               IXGBE_READ_REG(hw, IXGBE_MBSDC);
        for (i = 0; i < 8; i++)
                IXGBE_READ_REG(hw, IXGBE_MPC(i));
 
diff -r 900e8a55a42e -r 81109f0d2818 sys/dev/pci/ixgbe/ixgbe_type.h
--- a/sys/dev/pci/ixgbe/ixgbe_type.h    Fri May 26 08:26:22 2017 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe_type.h    Fri May 26 08:36:41 2017 +0000
@@ -31,7 +31,7 @@
 
 ******************************************************************************/
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_type.h 299200 2016-05-06 22:54:56Z pfg $*/
-/*$NetBSD: ixgbe_type.h,v 1.20 2017/05/18 08:27:19 msaitoh Exp $*/
+/*$NetBSD: ixgbe_type.h,v 1.21 2017/05/26 08:36:42 msaitoh Exp $*/
 
 #ifndef _IXGBE_TYPE_H_
 #define _IXGBE_TYPE_H_
@@ -896,6 +896,7 @@
 #define IXGBE_ILLERRC  0x04004
 #define IXGBE_ERRBC    0x04008
 #define IXGBE_MSPDC    0x04010
+#define IXGBE_MBSDC    0x04018 /* Bad SFD Count */
 #define IXGBE_MPC(_i)  (0x03FA0 + ((_i) * 4)) /* 8 of these 3FA0-3FBC*/
 #define IXGBE_MLFC     0x04034
 #define IXGBE_MRFC     0x04038
@@ -3568,6 +3569,7 @@
        struct evcnt illerrc;
        struct evcnt errbc;
        struct evcnt mspdc;
+       struct evcnt mbsdc;
        struct evcnt mpctotal;
        struct evcnt mpc[8];
        struct evcnt mlfc;



Home | Main Index | Thread Index | Old Index