diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2014-10-03 13:41:56 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2014-10-03 13:41:56 +0000 |
commit | 59d2ed55a9bdb0c022cce6cd8a41d66c31ea71c0 (patch) | |
tree | c73d5b4ddcf5b0822002aaddef69d1ae36bd7119 | |
parent | 3457e882854372ea6f13b033ba576c59746301d6 (diff) |
refill the rx ring in myx_rxeof, not much later at the end of myx_intr.
-rw-r--r-- | sys/dev/pci/if_myx.c | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/sys/dev/pci/if_myx.c b/sys/dev/pci/if_myx.c index 0464db49a5c..69cad8f6f52 100644 --- a/sys/dev/pci/if_myx.c +++ b/sys/dev/pci/if_myx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_myx.c,v 1.68 2014/10/03 13:10:15 dlg Exp $ */ +/* $OpenBSD: if_myx.c,v 1.69 2014/10/03 13:41:55 dlg Exp $ */ /* * Copyright (c) 2007 Reyk Floeter <reyk@openbsd.org> @@ -207,7 +207,7 @@ void myx_write_txd_tail(struct myx_softc *, struct myx_buf *, u_int8_t, int myx_load_buf(struct myx_softc *, struct myx_buf *, struct mbuf *); int myx_setlladdr(struct myx_softc *, u_int32_t, u_int8_t *); int myx_intr(void *); -int myx_rxeof(struct myx_softc *); +void myx_rxeof(struct myx_softc *); void myx_txeof(struct myx_softc *, u_int32_t); struct myx_buf * myx_buf_alloc(struct myx_softc *, bus_size_t, int, @@ -1649,9 +1649,7 @@ myx_intr(void *arg) enum myx_state state = MYX_S_RUNNING; bus_dmamap_t map = sc->sc_sts_dma.mxm_map; u_int32_t data, link = 0xffffffff; - int refill = 0; u_int8_t valid = 0; - int i; mtx_enter(&sc->sc_sts_mtx); if (sc->sc_state == MYX_S_OFF) { @@ -1698,7 +1696,7 @@ myx_intr(void *arg) data = htobe32(3); if (valid & 0x1) { - refill |= myx_rxeof(sc); + myx_rxeof(sc); bus_space_write_raw_region_4(sc->sc_memt, sc->sc_memh, sc->sc_irqclaimoff, &data, sizeof(data)); @@ -1729,14 +1727,6 @@ myx_intr(void *arg) KERNEL_UNLOCK(); } - for (i = 0; i < 2; i++) { - if (ISSET(refill, 1 << i)) { - if (myx_rx_fill(sc, i) >= 0 && - myx_bufs_empty(&sc->sc_rx_buf_list[i])) - timeout_add(&sc->sc_refill, 0); - } - } - return (1); } @@ -1791,7 +1781,7 @@ myx_txeof(struct myx_softc *sc, u_int32_t done_count) } } -int +void myx_rxeof(struct myx_softc *sc) { static const struct myx_intrq_desc zerodesc = { 0, 0 }; @@ -1800,7 +1790,6 @@ myx_rxeof(struct myx_softc *sc) struct myx_buf *mb; struct mbuf *m; int ring; - int rings = 0; u_int rxfree[2] = { 0 , 0 }; u_int len; @@ -1849,7 +1838,9 @@ myx_rxeof(struct myx_softc *sc) if_rxr_put(&sc->sc_rx_ring[ring], rxfree[ring]); mtx_leave(&sc->sc_rx_ring_lock[ring].mrl_mtx); - SET(rings, 1 << ring); + if (myx_rx_fill(sc, ring) >= 0 && + myx_bufs_empty(&sc->sc_rx_buf_list[ring])) + timeout_add(&sc->sc_refill, 0); } ifp->if_ipackets += ml_len(&ml); @@ -1865,8 +1856,6 @@ myx_rxeof(struct myx_softc *sc) while ((m = ml_dequeue(&ml)) != NULL) ether_input_mbuf(ifp, m); KERNEL_UNLOCK(); - - return (rings); } void |