svn commit: r272721 - in head/sys/dev: alc ale

Pyun YongHyeon yongari at FreeBSD.org
Wed Oct 8 01:03:33 UTC 2014


Author: yongari
Date: Wed Oct  8 01:03:32 2014
New Revision: 272721
URL: https://svnweb.freebsd.org/changeset/base/272721

Log:
  Fix a long standing bug in MAC statistics register access.  One
  additional register was erroneously added in the MAC register set
  such that 7 TX statistics counters were wrong.

Modified:
  head/sys/dev/alc/if_alc.c
  head/sys/dev/alc/if_alcreg.h
  head/sys/dev/ale/if_ale.c
  head/sys/dev/ale/if_alereg.h

Modified: head/sys/dev/alc/if_alc.c
==============================================================================
--- head/sys/dev/alc/if_alc.c	Tue Oct  7 21:50:28 2014	(r272720)
+++ head/sys/dev/alc/if_alc.c	Wed Oct  8 01:03:32 2014	(r272721)
@@ -1287,8 +1287,6 @@ alc_sysctl_node(struct alc_softc *sc)
 	    &stats->tx_late_colls, "Late collisions");
 	ALC_SYSCTL_STAT_ADD32(ctx, child, "excess_colls",
 	    &stats->tx_excess_colls, "Excessive collisions");
-	ALC_SYSCTL_STAT_ADD32(ctx, child, "abort",
-	    &stats->tx_abort, "Aborted frames due to Excessive collisions");
 	ALC_SYSCTL_STAT_ADD32(ctx, child, "underruns",
 	    &stats->tx_underrun, "FIFO underruns");
 	ALC_SYSCTL_STAT_ADD32(ctx, child, "desc_underruns",
@@ -2599,7 +2597,6 @@ alc_stats_update(struct alc_softc *sc)
 	stat->tx_multi_colls += smb->tx_multi_colls;
 	stat->tx_late_colls += smb->tx_late_colls;
 	stat->tx_excess_colls += smb->tx_excess_colls;
-	stat->tx_abort += smb->tx_abort;
 	stat->tx_underrun += smb->tx_underrun;
 	stat->tx_desc_underrun += smb->tx_desc_underrun;
 	stat->tx_lenerrs += smb->tx_lenerrs;
@@ -2612,17 +2609,10 @@ alc_stats_update(struct alc_softc *sc)
 
 	if_inc_counter(ifp, IFCOUNTER_COLLISIONS, smb->tx_single_colls +
 	    smb->tx_multi_colls * 2 + smb->tx_late_colls +
-	    smb->tx_abort * HDPX_CFG_RETRY_DEFAULT);
+	    smb->tx_excess_colls * HDPX_CFG_RETRY_DEFAULT);
 
-	/*
-	 * XXX
-	 * tx_pkts_truncated counter looks suspicious. It constantly
-	 * increments with no sign of Tx errors. This may indicate
-	 * the counter name is not correct one so I've removed the
-	 * counter in output errors.
-	 */
-	if_inc_counter(ifp, IFCOUNTER_OERRORS,
-	    smb->tx_abort + smb->tx_late_colls + smb->tx_underrun);
+	if_inc_counter(ifp, IFCOUNTER_OERRORS, smb->tx_late_colls +
+	    smb->tx_excess_colls + smb->tx_underrun + smb->tx_pkts_truncated);
 
 	if_inc_counter(ifp, IFCOUNTER_IPACKETS, smb->rx_frames);
 

Modified: head/sys/dev/alc/if_alcreg.h
==============================================================================
--- head/sys/dev/alc/if_alcreg.h	Tue Oct  7 21:50:28 2014	(r272720)
+++ head/sys/dev/alc/if_alcreg.h	Wed Oct  8 01:03:32 2014	(r272721)
@@ -860,7 +860,6 @@ struct smb {
 	uint32_t tx_multi_colls;
 	uint32_t tx_late_colls;
 	uint32_t tx_excess_colls;
-	uint32_t tx_abort;
 	uint32_t tx_underrun;
 	uint32_t tx_desc_underrun;
 	uint32_t tx_lenerrs;

Modified: head/sys/dev/ale/if_ale.c
==============================================================================
--- head/sys/dev/ale/if_ale.c	Tue Oct  7 21:50:28 2014	(r272720)
+++ head/sys/dev/ale/if_ale.c	Wed Oct  8 01:03:32 2014	(r272721)
@@ -946,8 +946,6 @@ ale_sysctl_node(struct ale_softc *sc)
 	    &stats->tx_late_colls, "Late collisions");
 	ALE_SYSCTL_STAT_ADD32(ctx, child, "excess_colls",
 	    &stats->tx_excess_colls, "Excessive collisions");
-	ALE_SYSCTL_STAT_ADD32(ctx, child, "abort",
-	    &stats->tx_abort, "Aborted frames due to Excessive collisions");
 	ALE_SYSCTL_STAT_ADD32(ctx, child, "underruns",
 	    &stats->tx_underrun, "FIFO underruns");
 	ALE_SYSCTL_STAT_ADD32(ctx, child, "desc_underruns",
@@ -2197,7 +2195,6 @@ ale_stats_update(struct ale_softc *sc)
 	stat->tx_multi_colls += smb->tx_multi_colls;
 	stat->tx_late_colls += smb->tx_late_colls;
 	stat->tx_excess_colls += smb->tx_excess_colls;
-	stat->tx_abort += smb->tx_abort;
 	stat->tx_underrun += smb->tx_underrun;
 	stat->tx_desc_underrun += smb->tx_desc_underrun;
 	stat->tx_lenerrs += smb->tx_lenerrs;
@@ -2210,17 +2207,10 @@ ale_stats_update(struct ale_softc *sc)
 
 	if_inc_counter(ifp, IFCOUNTER_COLLISIONS, smb->tx_single_colls +
 	    smb->tx_multi_colls * 2 + smb->tx_late_colls +
-	    smb->tx_abort * HDPX_CFG_RETRY_DEFAULT);
+	    smb->tx_excess_colls * HDPX_CFG_RETRY_DEFAULT);
 
-	/*
-	 * XXX
-	 * tx_pkts_truncated counter looks suspicious. It constantly
-	 * increments with no sign of Tx errors. This may indicate
-	 * the counter name is not correct one so I've removed the
-	 * counter in output errors.
-	 */
-	if_inc_counter(ifp, IFCOUNTER_OERRORS,
-	    smb->tx_abort + smb->tx_late_colls + smb->tx_underrun);
+	if_inc_counter(ifp, IFCOUNTER_OERRORS, smb->tx_late_colls +
+	    smb->tx_excess_colls + smb->tx_underrun + smb->tx_pkts_truncated);
 
 	if_inc_counter(ifp, IFCOUNTER_IPACKETS, smb->rx_frames);
 

Modified: head/sys/dev/ale/if_alereg.h
==============================================================================
--- head/sys/dev/ale/if_alereg.h	Tue Oct  7 21:50:28 2014	(r272720)
+++ head/sys/dev/ale/if_alereg.h	Wed Oct  8 01:03:32 2014	(r272721)
@@ -605,7 +605,6 @@ struct smb {
 	uint32_t tx_multi_colls;
 	uint32_t tx_late_colls;
 	uint32_t tx_excess_colls;
-	uint32_t tx_abort;
 	uint32_t tx_underrun;
 	uint32_t tx_desc_underrun;
 	uint32_t tx_lenerrs;


More information about the svn-src-head mailing list