Module Name:    src
Committed By:   msaitoh
Date:           Fri May 26 08:36:42 UTC 2017

Modified Files:
        src/sys/dev/pci/ixgbe: ixgbe.c ixgbe_common.c ixgbe_type.h

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


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.86 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/pci/ixgbe/ixgbe_type.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.85 src/sys/dev/pci/ixgbe/ixgbe.c:1.86
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.85	Fri May 26 07:42:15 2017
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Fri May 26 08:36:41 2017
@@ -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 @@ ixgbe_detach(device_t dev, int flags)
 	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 @@ ixgbe_update_stats_counters(struct adapt
 	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 @@ ixgbe_add_hw_stats(struct adapter *adapt
 	    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 @@ ixgbe_clear_evcnt(struct adapter *adapte
 	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;

Index: src/sys/dev/pci/ixgbe/ixgbe_common.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_common.c:1.12 src/sys/dev/pci/ixgbe/ixgbe_common.c:1.13
--- src/sys/dev/pci/ixgbe/ixgbe_common.c:1.12	Thu Jan 19 06:56:33 2017
+++ src/sys/dev/pci/ixgbe/ixgbe_common.c	Fri May 26 08:36:42 2017
@@ -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 @@ s32 ixgbe_clear_hw_cntrs_generic(struct 
 	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));
 

Index: src/sys/dev/pci/ixgbe/ixgbe_type.h
diff -u src/sys/dev/pci/ixgbe/ixgbe_type.h:1.20 src/sys/dev/pci/ixgbe/ixgbe_type.h:1.21
--- src/sys/dev/pci/ixgbe/ixgbe_type.h:1.20	Thu May 18 08:27:19 2017
+++ src/sys/dev/pci/ixgbe/ixgbe_type.h	Fri May 26 08:36:42 2017
@@ -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 @@ struct ixgbe_dmac_config {
 #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 ixgbe_hw_stats {
 	struct evcnt illerrc;
 	struct evcnt errbc;
 	struct evcnt mspdc;
+	struct evcnt mbsdc;
 	struct evcnt mpctotal;
 	struct evcnt mpc[8];
 	struct evcnt mlfc;

Reply via email to