Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Feb 2011 22:58:46 +0000 (UTC)
From:      Pyun YongHyeon <yongari@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r218826 - head/sys/dev/dc
Message-ID:  <201102182258.p1IMwkrQ075625@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yongari
Date: Fri Feb 18 22:58:46 2011
New Revision: 218826
URL: http://svn.freebsd.org/changeset/base/218826

Log:
  Make sure to clear status word of TX descriptor in dc_list_tx_init().
  Do not update if_opackets if the transmission had failed.

Modified:
  head/sys/dev/dc/if_dc.c

Modified: head/sys/dev/dc/if_dc.c
==============================================================================
--- head/sys/dev/dc/if_dc.c	Fri Feb 18 22:25:11 2011	(r218825)
+++ head/sys/dev/dc/if_dc.c	Fri Feb 18 22:58:46 2011	(r218826)
@@ -2466,10 +2466,11 @@ dc_list_tx_init(struct dc_softc *sc)
 			nexti = 0;
 		else
 			nexti = i + 1;
+		ld->dc_tx_list[i].dc_status = 0;
+		ld->dc_tx_list[i].dc_ctl = 0;
+		ld->dc_tx_list[i].dc_data = 0;
 		ld->dc_tx_list[i].dc_next = htole32(DC_TXDESC(sc, nexti));
 		cd->dc_tx_chain[i] = NULL;
-		ld->dc_tx_list[i].dc_data = 0;
-		ld->dc_tx_list[i].dc_ctl = 0;
 	}
 
 	cd->dc_tx_prod = cd->dc_tx_cons = cd->dc_tx_cnt = 0;
@@ -2916,11 +2917,10 @@ dc_txeof(struct dc_softc *sc)
 				dc_init_locked(sc);
 				return;
 			}
-		}
-
+		} else
+			ifp->if_opackets++;
 		ifp->if_collisions += (txstat & DC_TXSTAT_COLLCNT) >> 3;
 
-		ifp->if_opackets++;
 		if (sc->dc_cdata.dc_tx_chain[idx] != NULL) {
 			bus_dmamap_sync(sc->dc_mtag,
 			    sc->dc_cdata.dc_tx_map[idx],



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