Index: if_em.c =================================================================== RCS file: /cvs/src/sys/dev/pci/if_em.c,v retrieving revision 1.341 diff -u -p -r1.341 if_em.c --- if_em.c 7 Apr 2018 11:56:40 -0000 1.341 +++ if_em.c 6 Feb 2019 09:59:47 -0000 @@ -250,6 +250,7 @@ void em_txeof(struct em_softc *); int em_allocate_receive_structures(struct em_softc *); int em_allocate_transmit_structures(struct em_softc *); int em_rxfill(struct em_softc *); +void em_rxrefill(void *); int em_rxeof(struct em_softc *); void em_receive_checksum(struct em_softc *, struct em_rx_desc *, struct mbuf *); @@ -375,6 +376,7 @@ em_attach(struct device *parent, struct timeout_set(&sc->timer_handle, em_local_timer, sc); timeout_set(&sc->tx_fifo_timer_handle, em_82547_move_tail, sc); + timeout_set(&sc->rx_refill, em_rxrefill, sc); /* Determine hardware revision */ em_identify_hardware(sc); @@ -959,13 +961,8 @@ em_intr(void *arg) if (ifp->if_flags & IFF_RUNNING) { em_txeof(sc); - - if (em_rxeof(sc) || ISSET(reg_icr, E1000_ICR_RXO)) { - if (em_rxfill(sc)) { - E1000_WRITE_REG(&sc->hw, RDT, - sc->sc_rx_desc_head); - } - } + if (em_rxeof(sc)) + em_rxrefill(sc); } /* Link status change */ @@ -1534,6 +1531,7 @@ em_stop(void *arg, int softonly) INIT_DEBUGOUT("em_stop: begin"); + timeout_del(&sc->rx_refill); timeout_del(&sc->timer_handle); timeout_del(&sc->tx_fifo_timer_handle); @@ -2753,6 +2751,17 @@ em_rxfill(struct em_softc *sc) BUS_DMASYNC_PREWRITE); return (post); +} + +void +em_rxrefill(void *arg) +{ + struct em_softc *sc = arg; + + if (em_rxfill(sc)) + E1000_WRITE_REG(&sc->hw, RDT, sc->sc_rx_desc_head); + else if (if_rxr_inuse(&sc->sc_rx_ring) == 0) + timeout_add(&sc->rx_refill, 1); } /********************************************************************* Index: if_em.h =================================================================== RCS file: /cvs/src/sys/dev/pci/if_em.h,v retrieving revision 1.73 diff -u -p -r1.73 if_em.h --- if_em.h 27 Oct 2016 03:06:53 -0000 1.73 +++ if_em.h 6 Feb 2019 09:59:47 -0000 @@ -324,6 +324,7 @@ struct em_softc { struct timeout em_intr_enable; struct timeout timer_handle; struct timeout tx_fifo_timer_handle; + struct timeout rx_refill; /* Info about the board itself */ u_int32_t part_num;