summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/dev/fdt/if_dwge.c13
-rw-r--r--sys/dev/fdt/if_dwxe.c13
2 files changed, 18 insertions, 8 deletions
diff --git a/sys/dev/fdt/if_dwge.c b/sys/dev/fdt/if_dwge.c
index 55928b49759..63b02a73cf5 100644
--- a/sys/dev/fdt/if_dwge.c
+++ b/sys/dev/fdt/if_dwge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_dwge.c,v 1.1 2019/09/29 13:04:03 kettenis Exp $ */
+/* $OpenBSD: if_dwge.c,v 1.2 2019/10/07 00:40:04 jmatthew Exp $ */
/*
* Copyright (c) 2008, 2019 Mark Kettenis <kettenis@openbsd.org>
* Copyright (c) 2017 Patrick Wildt <patrick@blueri.se>
@@ -812,12 +812,13 @@ dwge_tx_proc(struct dwge_softc *sc)
struct ifnet *ifp = &sc->sc_ac.ac_if;
struct dwge_desc *txd;
struct dwge_buf *txb;
- int idx;
+ int idx, txfree;
bus_dmamap_sync(sc->sc_dmat, DWGE_DMA_MAP(sc->sc_txring), 0,
DWGE_DMA_LEN(sc->sc_txring),
BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
+ txfree = 0;
while (sc->sc_tx_cnt > 0) {
idx = sc->sc_tx_cons;
KASSERT(idx < DWGE_NTXDESC);
@@ -836,8 +837,7 @@ dwge_tx_proc(struct dwge_softc *sc)
txb->tb_m = NULL;
}
- ifq_clr_oactive(&ifp->if_snd);
-
+ txfree++;
sc->sc_tx_cnt--;
if (sc->sc_tx_cons == (DWGE_NTXDESC - 1))
@@ -850,6 +850,11 @@ dwge_tx_proc(struct dwge_softc *sc)
if (sc->sc_tx_cnt == 0)
ifp->if_timer = 0;
+
+ if (txfree) {
+ if (ifq_is_oactive(&ifp->if_snd))
+ ifq_restart(&ifp->if_snd);
+ }
}
void
diff --git a/sys/dev/fdt/if_dwxe.c b/sys/dev/fdt/if_dwxe.c
index fcbcebb6ed3..3867d2ae99d 100644
--- a/sys/dev/fdt/if_dwxe.c
+++ b/sys/dev/fdt/if_dwxe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_dwxe.c,v 1.14 2019/09/29 13:04:03 kettenis Exp $ */
+/* $OpenBSD: if_dwxe.c,v 1.15 2019/10/07 00:40:04 jmatthew Exp $ */
/*
* Copyright (c) 2008 Mark Kettenis
* Copyright (c) 2017 Patrick Wildt <patrick@blueri.se>
@@ -870,12 +870,13 @@ dwxe_tx_proc(struct dwxe_softc *sc)
struct ifnet *ifp = &sc->sc_ac.ac_if;
struct dwxe_desc *txd;
struct dwxe_buf *txb;
- int idx;
+ int idx, txfree;
bus_dmamap_sync(sc->sc_dmat, DWXE_DMA_MAP(sc->sc_txring), 0,
DWXE_DMA_LEN(sc->sc_txring),
BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
+ txfree = 0;
while (sc->sc_tx_cnt > 0) {
idx = sc->sc_tx_cons;
KASSERT(idx < DWXE_NTXDESC);
@@ -894,8 +895,7 @@ dwxe_tx_proc(struct dwxe_softc *sc)
txb->tb_m = NULL;
}
- ifq_clr_oactive(&ifp->if_snd);
-
+ txfree++;
sc->sc_tx_cnt--;
if (sc->sc_tx_cons == (DWXE_NTXDESC - 1))
@@ -908,6 +908,11 @@ dwxe_tx_proc(struct dwxe_softc *sc)
if (sc->sc_tx_cnt == 0)
ifp->if_timer = 0;
+
+ if (txfree) {
+ if (ifq_is_oactive(&ifp->if_snd))
+ ifq_restart(&ifp->if_snd);
+ }
}
void