Module Name: src
Committed By: thorpej
Date: Sun Mar 15 22:20:32 UTC 2020
Modified Files:
src/sys/dev/pci: if_pcn.c if_sip.c if_ste.c if_stge.c
Log Message:
Don't bother with IFF_OACTIVE.
To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/dev/pci/if_pcn.c
cvs rdiff -u -r1.180 -r1.181 src/sys/dev/pci/if_sip.c
cvs rdiff -u -r1.61 -r1.62 src/sys/dev/pci/if_ste.c
cvs rdiff -u -r1.85 -r1.86 src/sys/dev/pci/if_stge.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/pci/if_pcn.c
diff -u src/sys/dev/pci/if_pcn.c:1.74 src/sys/dev/pci/if_pcn.c:1.75
--- src/sys/dev/pci/if_pcn.c:1.74 Fri Feb 7 00:04:28 2020
+++ src/sys/dev/pci/if_pcn.c Sun Mar 15 22:20:31 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: if_pcn.c,v 1.74 2020/02/07 00:04:28 thorpej Exp $ */
+/* $NetBSD: if_pcn.c,v 1.75 2020/03/15 22:20:31 thorpej Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@@ -65,7 +65,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_pcn.c,v 1.74 2020/02/07 00:04:28 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_pcn.c,v 1.75 2020/03/15 22:20:31 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -922,7 +922,7 @@ pcn_start(struct ifnet *ifp)
bus_dmamap_t dmamap;
int error, nexttx, lasttx = -1, ofree, seg;
- if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING)
+ if ((ifp->if_flags & IFF_RUNNING) != IFF_RUNNING)
return;
/*
@@ -999,15 +999,8 @@ pcn_start(struct ifnet *ifp)
if (dmamap->dm_nsegs > (sc->sc_txfree - 1)) {
/*
* Not enough free descriptors to transmit this
- * packet. We haven't committed anything yet,
- * so just unload the DMA map, put the packet
- * back on the queue, and punt. Notify the upper
- * layer that there are not more slots left.
- *
- * XXX We could allocate an mbuf and copy, but
- * XXX is it worth it?
+ * packet.
*/
- ifp->if_flags |= IFF_OACTIVE;
bus_dmamap_unload(sc->sc_dmat, dmamap);
if (m != NULL)
m_freem(m);
@@ -1134,11 +1127,6 @@ pcn_start(struct ifnet *ifp)
bpf_mtap(ifp, m0, BPF_D_OUT);
}
- if (sc->sc_txsfree == 0 || sc->sc_txfree == 0) {
- /* No more slots left; notify upper layer. */
- ifp->if_flags |= IFF_OACTIVE;
- }
-
if (sc->sc_txfree != ofree) {
/* Set a watchdog timer in case the chip flakes out. */
ifp->if_timer = 5;
@@ -1325,8 +1313,6 @@ pcn_txintr(struct pcn_softc *sc)
uint32_t tmd1, tmd2, tmd;
int i, j;
- ifp->if_flags &= ~IFF_OACTIVE;
-
/*
* Go through our Tx list and free mbufs for those
* frames which have been transmitted.
@@ -1817,7 +1803,6 @@ pcn_init(struct ifnet *ifp)
/* ...all done! */
ifp->if_flags |= IFF_RUNNING;
- ifp->if_flags &= ~IFF_OACTIVE;
out:
if (error)
@@ -1880,7 +1865,7 @@ pcn_stop(struct ifnet *ifp, int disable)
}
/* Mark the interface as 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/pci/if_sip.c
diff -u src/sys/dev/pci/if_sip.c:1.180 src/sys/dev/pci/if_sip.c:1.181
--- src/sys/dev/pci/if_sip.c:1.180 Fri Mar 13 00:45:59 2020
+++ src/sys/dev/pci/if_sip.c Sun Mar 15 22:20:31 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: if_sip.c,v 1.180 2020/03/13 00:45:59 thorpej Exp $ */
+/* $NetBSD: if_sip.c,v 1.181 2020/03/15 22:20:31 thorpej Exp $ */
/*-
* Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_sip.c,v 1.180 2020/03/13 00:45:59 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_sip.c,v 1.181 2020/03/15 22:20:31 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1557,9 +1557,9 @@ sipcom_start(struct ifnet *ifp)
* If we've been told to pause, don't transmit any more packets.
*/
if (!sc->sc_gigabit && sc->sc_paused)
- 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;
/*
@@ -1647,15 +1647,8 @@ sipcom_start(struct ifnet *ifp)
if (dmamap->dm_nsegs > (sc->sc_txfree - 1)) {
/*
* Not enough free descriptors to transmit this
- * packet. We haven't committed anything yet,
- * so just unload the DMA map, put the packet
- * back on the queue, and punt. Notify the upper
- * layer that there are not more slots left.
- *
- * XXX We could allocate an mbuf and copy, but
- * XXX is it worth it?
+ * packet.
*/
- ifp->if_flags |= IFF_OACTIVE;
bus_dmamap_unload(sc->sc_dmat, dmamap);
if (m != NULL)
m_freem(m);
@@ -1747,11 +1740,6 @@ sipcom_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) {
/*
* Start the transmit process. Note, the manual says
@@ -2008,11 +1996,9 @@ sipcom_intr(void *arg)
if (isr & ISR_PAUSE_ST) {
sc->sc_paused = 1;
SIP_EVCNT_INCR(&sc->sc_ev_rxpause);
- ifp->if_flags |= IFF_OACTIVE;
}
if (isr & ISR_PAUSE_END) {
sc->sc_paused = 0;
- ifp->if_flags &= ~IFF_OACTIVE;
}
}
@@ -2068,9 +2054,6 @@ sipcom_txintr(struct sip_softc *sc)
struct sip_txsoft *txs;
uint32_t cmdsts;
- if (sc->sc_paused == 0)
- ifp->if_flags &= ~IFF_OACTIVE;
-
/*
* Go through our Tx list and free mbufs for those
* frames which have been transmitted.
@@ -2858,7 +2841,6 @@ sipcom_init(struct ifnet *ifp)
* ...all done!
*/
ifp->if_flags |= IFF_RUNNING;
- ifp->if_flags &= ~IFF_OACTIVE;
sc->sc_if_flags = ifp->if_flags;
sc->sc_prev.ec_capenable = sc->sc_ethercom.ec_capenable;
sc->sc_prev.is_vlan = VLAN_ATTACHED(&(sc)->sc_ethercom);
@@ -2956,7 +2938,7 @@ sipcom_stop(struct ifnet *ifp, int disab
/*
* 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/pci/if_ste.c
diff -u src/sys/dev/pci/if_ste.c:1.61 src/sys/dev/pci/if_ste.c:1.62
--- src/sys/dev/pci/if_ste.c:1.61 Fri Mar 13 00:41:24 2020
+++ src/sys/dev/pci/if_ste.c Sun Mar 15 22:20:31 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ste.c,v 1.61 2020/03/13 00:41:24 thorpej Exp $ */
+/* $NetBSD: if_ste.c,v 1.62 2020/03/15 22:20:31 thorpej Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ste.c,v 1.61 2020/03/13 00:41:24 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ste.c,v 1.62 2020/03/15 22:20:31 thorpej Exp $");
#include <sys/param.h>
@@ -656,7 +656,7 @@ ste_start(struct ifnet *ifp)
bus_dmamap_t dmamap;
int error, olasttx, nexttx, opending, seg, totlen;
- if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING)
+ if ((ifp->if_flags & IFF_RUNNING) != IFF_RUNNING)
return;
/*
@@ -775,11 +775,6 @@ ste_start(struct ifnet *ifp)
bpf_mtap(ifp, m0, BPF_D_OUT);
}
- if (sc->sc_txpending == STE_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,
@@ -995,8 +990,6 @@ ste_txintr(struct ste_softc *sc)
uint32_t control;
int i;
- ifp->if_flags &= ~IFF_OACTIVE;
-
/*
* Go through our Tx list and free mbufs for those
* frames which have been transmitted.
@@ -1402,7 +1395,6 @@ ste_init(struct ifnet *ifp)
* ...all done!
*/
ifp->if_flags |= IFF_RUNNING;
- ifp->if_flags &= ~IFF_OACTIVE;
out:
if (error)
@@ -1484,7 +1476,7 @@ ste_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/pci/if_stge.c
diff -u src/sys/dev/pci/if_stge.c:1.85 src/sys/dev/pci/if_stge.c:1.86
--- src/sys/dev/pci/if_stge.c:1.85 Fri Mar 13 03:45:58 2020
+++ src/sys/dev/pci/if_stge.c Sun Mar 15 22:20:31 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: if_stge.c,v 1.85 2020/03/13 03:45:58 thorpej Exp $ */
+/* $NetBSD: if_stge.c,v 1.86 2020/03/15 22:20:31 thorpej Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_stge.c,v 1.85 2020/03/13 03:45:58 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_stge.c,v 1.86 2020/03/15 22:20:31 thorpej Exp $");
#include <sys/param.h>
@@ -827,7 +827,7 @@ stge_start(struct ifnet *ifp)
int error, firsttx, nexttx, opending, seg, totlen;
uint64_t csum_flags;
- if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING)
+ if ((ifp->if_flags & IFF_RUNNING) != IFF_RUNNING)
return;
/*
@@ -1013,11 +1013,6 @@ stge_start(struct ifnet *ifp)
bpf_mtap(ifp, m0, BPF_D_OUT);
}
- if (sc->sc_txpending == (STGE_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,
@@ -1198,8 +1193,6 @@ stge_txintr(struct stge_softc *sc)
uint64_t control;
int i;
- ifp->if_flags &= ~IFF_OACTIVE;
-
/*
* Go through our Tx list and free mbufs for those
* frames which have been transmitted.
@@ -1712,7 +1705,6 @@ stge_init(struct ifnet *ifp)
* ...all done!
*/
ifp->if_flags |= IFF_RUNNING;
- ifp->if_flags &= ~IFF_OACTIVE;
out:
if (error)
@@ -1797,7 +1789,7 @@ stge_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)