Module Name:    src
Committed By:   thorpej
Date:           Sun Mar 15 22:19:01 UTC 2020

Modified Files:
        src/sys/dev/ic: aic6915.c dp83932.c gem.c sgec.c smc83c170.c tulip.c

Log Message:
Don't bother with IFF_OACTIVE.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/dev/ic/aic6915.c
cvs rdiff -u -r1.45 -r1.46 src/sys/dev/ic/dp83932.c
cvs rdiff -u -r1.129 -r1.130 src/sys/dev/ic/gem.c
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/ic/sgec.c
cvs rdiff -u -r1.94 -r1.95 src/sys/dev/ic/smc83c170.c
cvs rdiff -u -r1.203 -r1.204 src/sys/dev/ic/tulip.c

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/ic/aic6915.c
diff -u src/sys/dev/ic/aic6915.c:1.43 src/sys/dev/ic/aic6915.c:1.44
--- src/sys/dev/ic/aic6915.c:1.43	Thu Mar 12 03:01:46 2020
+++ src/sys/dev/ic/aic6915.c	Sun Mar 15 22:19:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: aic6915.c,v 1.43 2020/03/12 03:01:46 thorpej Exp $	*/
+/*	$NetBSD: aic6915.c,v 1.44 2020/03/15 22:19:00 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aic6915.c,v 1.43 2020/03/12 03:01:46 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aic6915.c,v 1.44 2020/03/15 22:19:00 thorpej Exp $");
 
 
 #include <sys/param.h>
@@ -469,11 +469,6 @@ sf_start(struct ifnet *ifp)
 		bpf_mtap(ifp, m0, BPF_D_OUT);
 	}
 
-	if (sc->sc_txpending == (SF_NTXDESC - 1)) {
-		/* No more slots left; notify upper layer. */
-		ifp->if_flags |= IFF_OACTIVE;
-	}
-
 	if (sc->sc_txpending != opending) {
 		KASSERT(last != -1);
 		/*
@@ -638,8 +633,6 @@ sf_txintr(struct sf_softc *sc)
 	if (consumer == producer)
 		return;
 
-	ifp->if_flags &= ~IFF_OACTIVE;
-
 	while (consumer != producer) {
 		SF_CDTXCSYNC(sc, consumer, BUS_DMASYNC_POSTREAD);
 		tcd = le32toh(sc->sc_txcomp[consumer].tcd_word0);
@@ -1097,11 +1090,10 @@ sf_init(struct ifnet *ifp)
 	 * Note that the interface is now running.
 	 */
 	ifp->if_flags |= IFF_RUNNING;
-	ifp->if_flags &= ~IFF_OACTIVE;
 
  out:
 	if (error) {
-		ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+		ifp->if_flags &= ~IFF_RUNNING;
 		ifp->if_timer = 0;
 		printf("%s: interface not running\n", device_xname(sc->sc_dev));
 	}
@@ -1168,7 +1160,7 @@ sf_stop(struct ifnet *ifp, int disable)
 	/*
 	 * Mark the interface down and cancel the watchdog timer.
 	 */
-	ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+	ifp->if_flags &= ~IFF_RUNNING;
 	ifp->if_timer = 0;
 
 	if (disable)

Index: src/sys/dev/ic/dp83932.c
diff -u src/sys/dev/ic/dp83932.c:1.45 src/sys/dev/ic/dp83932.c:1.46
--- src/sys/dev/ic/dp83932.c:1.45	Wed Jan 29 14:14:55 2020
+++ src/sys/dev/ic/dp83932.c	Sun Mar 15 22:19:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dp83932.c,v 1.45 2020/01/29 14:14:55 thorpej Exp $	*/
+/*	$NetBSD: dp83932.c,v 1.46 2020/03/15 22:19:00 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dp83932.c,v 1.45 2020/01/29 14:14:55 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dp83932.c,v 1.46 2020/03/15 22:19:00 thorpej Exp $");
 
 
 #include <sys/param.h>
@@ -287,7 +287,7 @@ sonic_start(struct ifnet *ifp)
 	int error, olasttx, nexttx, opending, totlen, olseg;
 	int seg = 0;	/* XXX: gcc */
 
-	if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING)
+	if ((ifp->if_flags & IFF_RUNNING) != IFF_RUNNING)
 		return;
 
 	/*
@@ -471,11 +471,6 @@ sonic_start(struct ifnet *ifp)
 		bpf_mtap(ifp, m0, BPF_D_OUT);
 	}
 
-	if (sc->sc_txpending == (SONIC_NTXDESC - 1)) {
-		/* No more slots left; notify upper layer. */
-		ifp->if_flags |= IFF_OACTIVE;
-	}
-
 	if (sc->sc_txpending != opending) {
 		/*
 		 * We enqueued packets.  If the transmitter was idle,
@@ -634,8 +629,6 @@ sonic_txintr(struct sonic_softc *sc)
 	uint16_t status, totstat = 0;
 	int i;
 
-	ifp->if_flags &= ~IFF_OACTIVE;
-
 	for (i = sc->sc_txdirty; sc->sc_txpending != 0;
 	     i = SONIC_NEXTTX(i), sc->sc_txpending--) {
 		ds = &sc->sc_txsoft[i];
@@ -1017,7 +1010,6 @@ sonic_init(struct ifnet *ifp)
 	 * ...all done!
 	 */
 	ifp->if_flags |= IFF_RUNNING;
-	ifp->if_flags &= ~IFF_OACTIVE;
 
  out:
 	if (error)
@@ -1090,7 +1082,7 @@ sonic_stop(struct ifnet *ifp, int disabl
 	/*
 	 * Mark the interface down and cancel the watchdog timer.
 	 */
-	ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+	ifp->if_flags &= ~IFF_RUNNING;
 	ifp->if_timer = 0;
 
 	if (disable)

Index: src/sys/dev/ic/gem.c
diff -u src/sys/dev/ic/gem.c:1.129 src/sys/dev/ic/gem.c:1.130
--- src/sys/dev/ic/gem.c:1.129	Sun Mar  1 05:50:56 2020
+++ src/sys/dev/ic/gem.c	Sun Mar 15 22:19:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: gem.c,v 1.129 2020/03/01 05:50:56 thorpej Exp $ */
+/*	$NetBSD: gem.c,v 1.130 2020/03/15 22:19:00 thorpej Exp $ */
 
 /*
  *
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.129 2020/03/01 05:50:56 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.130 2020/03/15 22:19:00 thorpej Exp $");
 
 #include "opt_inet.h"
 
@@ -745,7 +745,7 @@ gem_stop(struct ifnet *ifp, int disable)
 	/*
 	 * Mark the interface down and cancel the watchdog timer.
 	 */
-	ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+	ifp->if_flags &= ~IFF_RUNNING;
 	sc->sc_if_flags = ifp->if_flags;
 	ifp->if_timer = 0;
 
@@ -1228,7 +1228,6 @@ gem_init(struct ifnet *ifp)
 
 	sc->sc_flags &= ~GEM_LINK;
 	ifp->if_flags |= IFF_RUNNING;
-	ifp->if_flags &= ~IFF_OACTIVE;
 	ifp->if_timer = 0;
 	sc->sc_if_flags = ifp->if_flags;
 out:
@@ -1371,7 +1370,7 @@ gem_start(struct ifnet *ifp)
 #endif
 	uint64_t flags = 0;
 
-	if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING)
+	if ((ifp->if_flags & IFF_RUNNING) != IFF_RUNNING)
 		return;
 
 	/*
@@ -1459,16 +1458,8 @@ next:
 		     (sc->sc_txfree - 1) : sc->sc_txfree)) {
 			/*
 			 * Not enough free descriptors to transmit this
-			 * packet.  We haven't committed to anything yet,
-			 * so just unload the DMA map, put the packet
-			 * back on the queue, and punt.  Notify the upper
-			 * layer that there are no more slots left.
-			 *
-			 * XXX We could allocate an mbuf and copy, but
-			 * XXX it is worth it?
+			 * packet.
 			 */
-			ifp->if_flags |= IFF_OACTIVE;
-			sc->sc_if_flags = ifp->if_flags;
 			bus_dmamap_unload(sc->sc_dmatag, dmamap);
 			if (m != NULL)
 				m_freem(m);
@@ -1608,12 +1599,6 @@ next:
 		bpf_mtap(ifp, m0, BPF_D_OUT);
 	}
 
-	if (txs == NULL || sc->sc_txfree == 0) {
-		/* No more slots left; notify upper layer. */
-		ifp->if_flags |= IFF_OACTIVE;
-		sc->sc_if_flags = ifp->if_flags;
-	}
-
 	if (sc->sc_txfree != ofree) {
 		DPRINTF(sc, ("%s: packets enqueued, IC on %d, OWN on %d\n",
 		    device_xname(sc->sc_dev), lasttx, otxnext));
@@ -1748,9 +1733,6 @@ gem_tint(struct gem_softc *sc)
 		if (sc->sc_txfree == GEM_NTXDESC - 1)
 			sc->sc_txwin = 0;
 
-		/* Freed some descriptors, so reset IFF_OACTIVE and restart. */
-		ifp->if_flags &= ~IFF_OACTIVE;
-		sc->sc_if_flags = ifp->if_flags;
 		ifp->if_timer = SIMPLEQ_EMPTY(&sc->sc_txdirtyq) ? 0 : 5;
 		if_schedule_deferred_start(ifp);
 	}

Index: src/sys/dev/ic/sgec.c
diff -u src/sys/dev/ic/sgec.c:1.52 src/sys/dev/ic/sgec.c:1.53
--- src/sys/dev/ic/sgec.c:1.52	Thu Jan 30 04:56:11 2020
+++ src/sys/dev/ic/sgec.c	Sun Mar 15 22:19:00 2020
@@ -1,4 +1,4 @@
-/*      $NetBSD: sgec.c,v 1.52 2020/01/30 04:56:11 thorpej Exp $ */
+/*      $NetBSD: sgec.c,v 1.53 2020/03/15 22:19:00 thorpej Exp $ */
 /*
  * Copyright (c) 1999 Ludd, University of Lule}, Sweden. All rights reserved.
  *
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sgec.c,v 1.52 2020/01/30 04:56:11 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sgec.c,v 1.53 2020/03/15 22:19:00 thorpej Exp $");
 
 #include "opt_inet.h"
 
@@ -301,7 +301,6 @@ zeinit(struct ze_softc *sc)
 	    ZE_NICSR6_SR | ZE_NICSR6_DC);
 
 	ifp->if_flags |= IFF_RUNNING;
-	ifp->if_flags &= ~IFF_OACTIVE;
 
 	/*
 	 * Send a setup frame.
@@ -356,7 +355,6 @@ zestart(struct ifnet *ifp)
 
 		if ((map->dm_nsegs + sc->sc_inq) >= (TXDESCS - 1)) {
 			bus_dmamap_unload(sc->sc_dmat, map);
-			ifp->if_flags |= IFF_OACTIVE;
 			goto out;
 		}
 
@@ -416,8 +414,6 @@ zestart(struct ifnet *ifp)
 
 		bpf_mtap(ifp, m, BPF_D_OUT);
 	}
-	if (sc->sc_inq == (TXDESCS - 1))
-		ifp->if_flags |= IFF_OACTIVE;
 
 out:	if (old_inq < sc->sc_inq)
 		ifp->if_timer = 5; /* If transmit logic dies */
@@ -508,7 +504,6 @@ sgec_intr(struct ze_softc *sc)
 			sc->sc_lastack = lastack;
 			if (sc->sc_inq == 0)
 				ifp->if_timer = 0;
-			ifp->if_flags &= ~IFF_OACTIVE;
 			zestart(ifp); /* Put in more in queue */
 		}
 	}

Index: src/sys/dev/ic/smc83c170.c
diff -u src/sys/dev/ic/smc83c170.c:1.94 src/sys/dev/ic/smc83c170.c:1.95
--- src/sys/dev/ic/smc83c170.c:1.94	Thu Mar 12 03:01:46 2020
+++ src/sys/dev/ic/smc83c170.c	Sun Mar 15 22:19:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: smc83c170.c,v 1.94 2020/03/12 03:01:46 thorpej Exp $	*/
+/*	$NetBSD: smc83c170.c,v 1.95 2020/03/15 22:19:00 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: smc83c170.c,v 1.94 2020/03/12 03:01:46 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smc83c170.c,v 1.95 2020/03/15 22:19:00 thorpej Exp $");
 
 
 #include <sys/param.h>
@@ -499,11 +499,6 @@ epic_start(struct ifnet *ifp)
 		bpf_mtap(ifp, m0, BPF_D_OUT);
 	}
 
-	if (sc->sc_txpending == EPIC_NTXDESC) {
-		/* No more slots left; notify upper layer. */
-		ifp->if_flags |= IFF_OACTIVE;
-	}
-
 	if (sc->sc_txpending != opending) {
 		/*
 		 * We enqueued packets.	 If the transmitter was idle,
@@ -740,7 +735,6 @@ epic_intr(void *arg)
 	 * Check for transmission complete interrupts.
 	 */
 	if (intstat & (INTSTAT_TXC | INTSTAT_TXU)) {
-		ifp->if_flags &= ~IFF_OACTIVE;
 		for (i = sc->sc_txdirty; sc->sc_txpending != 0;
 		     i = EPIC_NEXTTX(i), sc->sc_txpending--) {
 			txd = EPIC_CDTX(sc, i);
@@ -1035,7 +1029,6 @@ epic_init(struct ifnet *ifp)
 	 * ...all done!
 	 */
 	ifp->if_flags |= IFF_RUNNING;
-	ifp->if_flags &= ~IFF_OACTIVE;
 
 	/*
 	 * Start the one second clock.
@@ -1124,7 +1117,7 @@ epic_stop(struct ifnet *ifp, int disable
 	/*
 	 * Mark the interface down and cancel the watchdog timer.
 	 */
-	ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+	ifp->if_flags &= ~IFF_RUNNING;
 	ifp->if_timer = 0;
 
 	if (disable)

Index: src/sys/dev/ic/tulip.c
diff -u src/sys/dev/ic/tulip.c:1.203 src/sys/dev/ic/tulip.c:1.204
--- src/sys/dev/ic/tulip.c:1.203	Wed Mar 11 16:20:57 2020
+++ src/sys/dev/ic/tulip.c	Sun Mar 15 22:19:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: tulip.c,v 1.203 2020/03/11 16:20:57 msaitoh Exp $	*/
+/*	$NetBSD: tulip.c,v 1.204 2020/03/15 22:19:00 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2002 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.203 2020/03/11 16:20:57 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.204 2020/03/15 22:19:00 thorpej Exp $");
 
 
 #include <sys/param.h>
@@ -683,9 +683,9 @@ tlp_start(struct ifnet *ifp)
 	 * itself into the ring.
 	 */
 	if (sc->sc_flags & TULIPF_WANT_SETUP)
-		ifp->if_flags |= IFF_OACTIVE;
+		return;
 
-	if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING)
+	if ((ifp->if_flags & IFF_RUNNING) != IFF_RUNNING)
 		return;
 
 	if (sc->sc_tick == tlp_2114x_nway_tick &&
@@ -768,15 +768,8 @@ tlp_start(struct ifnet *ifp)
 		if (dmamap->dm_nsegs > sc->sc_txfree) {
 			/*
 			 * Not enough free descriptors to transmit this
-			 * packet.  We haven't committed to anything yet,
-			 * so just unload the DMA map, put the packet
-			 * back on the queue, and punt.  Notify the upper
-			 * layer that there are no more slots left.
-			 *
-			 * XXX We could allocate an mbuf and copy, but
-			 * XXX it is worth it?
+			 * packet.
 			 */
-			ifp->if_flags |= IFF_OACTIVE;
 			bus_dmamap_unload(sc->sc_dmat, dmamap);
 			if (m != NULL)
 				m_freem(m);
@@ -877,11 +870,6 @@ tlp_start(struct ifnet *ifp)
 		bpf_mtap(ifp, m0, BPF_D_OUT);
 	}
 
-	if (txs == NULL || sc->sc_txfree == 0) {
-		/* No more slots left; notify upper layer. */
-		ifp->if_flags |= IFF_OACTIVE;
-	}
-
 	if (sc->sc_txfree != ofree) {
 		DPRINTF(sc, ("%s: packets enqueued, IC on %d, OWN on %d\n",
 		    device_xname(sc->sc_dev), lasttx, firsttx));
@@ -1414,8 +1402,6 @@ tlp_txintr(struct tulip_softc *sc)
 	DPRINTF(sc, ("%s: tlp_txintr: sc_flags 0x%08x\n",
 	    device_xname(sc->sc_dev), sc->sc_flags));
 
-	ifp->if_flags &= ~IFF_OACTIVE;
-
 	/*
 	 * Go through our Tx list and free mbufs for those
 	 * frames that have been transmitted.
@@ -1947,12 +1933,11 @@ tlp_init(struct ifnet *ifp)
 	 * Note that the interface is now running.
 	 */
 	ifp->if_flags |= IFF_RUNNING;
-	ifp->if_flags &= ~IFF_OACTIVE;
 	sc->sc_if_flags = ifp->if_flags;
 
  out:
 	if (error) {
-		ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+		ifp->if_flags &= ~IFF_RUNNING;
 		ifp->if_timer = 0;
 		printf("%s: interface not running\n", device_xname(sc->sc_dev));
 	}
@@ -2062,7 +2047,7 @@ tlp_stop(struct ifnet *ifp, int disable)
 	/*
 	 * Mark the interface down and cancel the watchdog timer.
 	 */
-	ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+	ifp->if_flags &= ~IFF_RUNNING;
 	sc->sc_if_flags = ifp->if_flags;
 	ifp->if_timer = 0;
 

Reply via email to