Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 06 Jul 1999 20:39:47 PDT
From:      Craig Leres <leres@ee.lbl.gov>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/12543: [PATCH] cumulative error stats for fxp(4)
Message-ID:  <199907070339.UAA53077@fun.ee.lbl.gov>

next in thread | raw e-mail | index | archive | help

>Number:         12543
>Category:       kern
>Synopsis:       [PATCH] cumulative error counters for fxp(4)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul  6 20:40:02 PDT 1999
>Closed-Date:
>Last-Modified:
>Originator:     Craig Leres
>Release:        FreeBSD 3.2-RELEASE i386
>Organization:
Lawrence Berkeley National Laboratory
>Environment:

>Description:

	It would be really sweet if one could look at the long term
	error counters for the intel 10/100 card. This information
	can be invaluable in debugging network problems.

>How-To-Repeat:

	The fxp driver only keeps around the last set of incremental
	changes to the error counters.

>Fix:
	
	Add a new fxp_stats struct and add in new amounts fxp_stats_update().

RCS file: RCS/if_fxpvar.h,v
retrieving revision 1.1
diff -c -r1.1 if_fxpvar.h
*** /tmp/,RCSt1X53005	Tue Jul  6 20:33:45 1999
- --- if_fxpvar.h	Tue Jul  6 20:33:36 1999
***************
*** 56,61 ****
- --- 56,62 ----
  	int need_mcsetup;		/* multicast filter needs programming */
  	struct fxp_cb_tx *cbl_last;	/* last active TxCB in list */
  	struct fxp_stats *fxp_stats;	/* Pointer to interface stats */
+ 	struct fxp_stats fxp_tstats;	/* interface stats totals */
  	int rx_idle_secs;		/* # of seconds RX has been idle */
  	struct callout_handle stat_ch;	/* Handle for canceling our stat timeout */
  	struct fxp_cb_tx *cbl_base;	/* base of TxCB list */
*** if_fxp.c.virgin	Tue Jul  6 20:34:12 1999
- --- if_fxp.c.new	Tue Jul  6 20:36:00 1999
***************
*** 1058,1069 ****
- --- 1058,1073 ----
  					    FXP_RFA_STATUS_IAMATCH) &&
  					    (eh->ether_dhost[0] & 1)
  					    == 0) {
+ #ifdef BRIDGE
  dropit:
+ #endif
  					    if (m)
  						m_freem(m);
  					    goto rcvloop;
  					}
+ #ifdef BRIDGE
  getit:
+ #endif
  					m->m_data +=
  					    sizeof(struct ether_header);
  					m->m_len -=
***************
*** 1105,1111 ****
  {
  	struct fxp_softc *sc = arg;
  	struct ifnet *ifp = &sc->sc_if;
! 	struct fxp_stats *sp = sc->fxp_stats;
  	struct fxp_cb_tx *txp;
  	int s;
  
- --- 1109,1115 ----
  {
  	struct fxp_softc *sc = arg;
  	struct ifnet *ifp = &sc->sc_if;
! 	struct fxp_stats *sp = sc->fxp_stats, *sp2 = &sc->fxp_tstats;
  	struct fxp_cb_tx *txp;
  	int s;
  
***************
*** 1134,1139 ****
- --- 1138,1162 ----
  		if (tx_threshold < 192)
  			tx_threshold += 64;
  	}
+ 
+ 	/* Update totals */
+ 	sp2->tx_good += sp->tx_good;
+ 	sp2->tx_maxcols += sp->tx_maxcols;
+ 	sp2->tx_latecols += sp->tx_latecols;
+ 	sp2->tx_underruns += sp->tx_underruns;
+ 	sp2->tx_lostcrs += sp->tx_lostcrs;
+ 	sp2->tx_deffered += sp->tx_deffered;
+ 	sp2->tx_single_collisions += sp->tx_single_collisions;
+ 	sp2->tx_multiple_collisions += sp->tx_multiple_collisions;
+ 	sp2->tx_total_collisions += sp->tx_total_collisions;
+ 	sp2->rx_good += sp->rx_good;
+ 	sp2->rx_crc_errors += sp->rx_crc_errors;
+ 	sp2->rx_alignment_errors += sp->rx_alignment_errors;
+ 	sp2->rx_rnr_errors += sp->rx_rnr_errors;
+ 	sp2->rx_overrun_errors += sp->rx_overrun_errors;
+ 	sp2->rx_cdt_errors += sp->rx_cdt_errors;
+ 	sp2->rx_shortframes += sp->rx_shortframes;
+ 
  	s = splimp();
  	/*
  	 * Release any xmit buffers that have completed DMA. This isn't

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBN4LL2L2JLbUEFcrxAQHcwQQAtENXZEtPG9GCEiCrkbOh6f0455BV4ujJ
Jh7G4iPN66uqhOs3NemfPSvbLm5gLrnAM5Rhto/TDfi2LTdDZcH7B9dYZEMvPm59
bgRY1AvMKdwvtpjcg6ucuA6vN9gq6lSy3kArx9q3oYSVvETCdWdw2KMlVjk2jBfE
f7cc5n2FjlA=
=RtNR
-----END PGP SIGNATURE-----

>Release-Note:
>Audit-Trail:
>Unformatted:
 -----BEGIN PGP SIGNED MESSAGE-----
 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199907070339.UAA53077>