Index: net/ifq.c =================================================================== RCS file: /cvs/src/sys/net/ifq.c,v diff -u -p -r1.54 ifq.c --- net/ifq.c 9 Nov 2024 04:09:56 -0000 1.54 +++ net/ifq.c 19 Nov 2024 01:58:05 -0000 @@ -156,6 +156,17 @@ ifq_set_oactive(struct ifqueue *ifq) } void +ifq_deq_set_oactive(struct ifqueue *ifq) +{ + MUTEX_ASSERT_LOCKED(&ifq->ifq_mtx); + + if (!ifq->ifq_oactive) { + ifq->ifq_oactive = 1; + ifq->ifq_oactives++; + } +} + +void ifq_restart_task(void *p) { struct ifqueue *ifq = p; Index: net/ifq.h =================================================================== RCS file: /cvs/src/sys/net/ifq.h,v diff -u -p -r1.41 ifq.h --- net/ifq.h 10 Nov 2023 15:51:24 -0000 1.41 +++ net/ifq.h 19 Nov 2024 01:58:05 -0000 @@ -444,6 +444,7 @@ void ifq_q_leave(struct ifqueue *, voi void ifq_serialize(struct ifqueue *, struct task *); void ifq_barrier(struct ifqueue *); void ifq_set_oactive(struct ifqueue *); +void ifq_deq_set_oactive(struct ifqueue *); int ifq_deq_sleep(struct ifqueue *, struct mbuf **, int, int, const char *, volatile unsigned int *, Index: dev/pci/if_de.c =================================================================== RCS file: /cvs/src/sys/dev/pci/if_de.c,v diff -u -p -r1.143 if_de.c --- dev/pci/if_de.c 24 May 2024 06:02:53 -0000 1.143 +++ dev/pci/if_de.c 19 Nov 2024 01:58:05 -0000 @@ -3728,6 +3728,8 @@ tulip_txput(tulip_softc_t * const sc, st u_int32_t d_status; bus_dmamap_t map; struct ifnet *ifp = &sc->tulip_if; + void (*set_oactive)(struct ifqueue *) = + notonqueue ? ifq_set_oactive : ifq_deq_set_oactive; #if defined(TULIP_DEBUG) if ((sc->tulip_cmdmode & TULIP_CMD_TXRUN) == 0) { @@ -3846,8 +3848,10 @@ tulip_txput(tulip_softc_t * const sc, st * The descriptors have been filled in. Now get ready * to transmit. */ - if (!notonqueue) + if (!notonqueue) { ifq_deq_commit(&ifp->if_snd, m); + set_oactive = ifq_set_oactive; + } TULIP_SETCTX(m, map); map = NULL; @@ -3897,7 +3901,7 @@ tulip_txput(tulip_softc_t * const sc, st if (sc->tulip_flags & TULIP_TXPROBE_ACTIVE) { TULIP_CSR_WRITE(sc, csr_txpoll, 1); - ifq_set_oactive(&sc->tulip_if.if_snd); + (*set_oactive)(&sc->tulip_if.if_snd); TULIP_PERFEND(txput); return (NULL); } @@ -3926,7 +3930,7 @@ tulip_txput(tulip_softc_t * const sc, st sc->tulip_dbg.dbg_txput_finishes[6]++; #endif if (sc->tulip_flags & (TULIP_WANTTXSTART|TULIP_DOINGSETUP)) { - ifq_set_oactive(&sc->tulip_if.if_snd); + (*set_oactive)(&sc->tulip_if.if_snd); if ((sc->tulip_intrmask & TULIP_STS_TXINTR) == 0) { sc->tulip_intrmask |= TULIP_STS_TXINTR; TULIP_CSR_WRITE(sc, csr_intr, sc->tulip_intrmask);