diff options
author | 2010-03-16 22:48:43 +0000 | |
---|---|---|
committer | 2010-03-16 22:48:43 +0000 | |
commit | 095a125f8dbd99fa8b3879b900a9af33c9f333f4 (patch) | |
tree | 571b587b8b67fe4363628bcc3ea5be6ed451d368 /sys/dev/pci/if_em.c | |
parent | Jumbo commit for 4.7 installation instructions: (diff) | |
download | wireguard-openbsd-095a125f8dbd99fa8b3879b900a9af33c9f333f4.tar.xz wireguard-openbsd-095a125f8dbd99fa8b3879b900a9af33c9f333f4.zip |
Set rx_ndescs to zero when initializing the rx ring. Otherwise we'll
effectively lose receive descriptors each time we reset the interface, until
we run out of descriptors and panic. Should fix the "em_rxeof: NULL mbuf in
slot 0 (nrx 256, filled 255)" panic on em(4).
ok jsing@ (for the em(4) bits), jsg@
Diffstat (limited to 'sys/dev/pci/if_em.c')
-rw-r--r-- | sys/dev/pci/if_em.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c index 6fc78b861d9..2559d2c13be 100644 --- a/sys/dev/pci/if_em.c +++ b/sys/dev/pci/if_em.c @@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. ***************************************************************************/ -/* $OpenBSD: if_em.c,v 1.234 2009/12/02 23:30:00 sthen Exp $ */ +/* $OpenBSD: if_em.c,v 1.235 2010/03/16 22:48:43 kettenis Exp $ */ /* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */ #include <dev/pci/if_em.h> @@ -2522,6 +2522,7 @@ em_setup_receive_structures(struct em_softc *sc) /* Setup our descriptor pointers */ sc->next_rx_desc_to_check = 0; sc->last_rx_desc_filled = sc->num_rx_desc - 1; + sc->rx_ndescs = 0; em_rxfill(sc); if (sc->rx_ndescs < 1) { |