From 5ba9d6455ddbb43a2a5ee08026d4c3a9d3b31b9d Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Wed, 3 Jul 2019 10:35:00 +0000 Subject: use ifiq_input return values to apply backpressure to rings. --- sys/dev/pci/if_myx.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'sys/dev/pci') diff --git a/sys/dev/pci/if_myx.c b/sys/dev/pci/if_myx.c index f13cf938a28..e491726b4bf 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.107 2019/04/16 11:42:56 dlg Exp $ */ +/* $OpenBSD: if_myx.c,v 1.108 2019/07/03 10:34:59 dlg Exp $ */ /* * Copyright (c) 2007 Reyk Floeter @@ -1743,6 +1743,7 @@ myx_rxeof(struct myx_softc *sc) int ring; u_int rxfree[2] = { 0 , 0 }; u_int len; + int livelocked; bus_dmamap_sync(sc->sc_dmat, sc->sc_intrq_dma.mxm_map, 0, sc->sc_intrq_dma.mxm_map->dm_mapsize, BUS_DMASYNC_POSTREAD); @@ -1778,19 +1779,21 @@ myx_rxeof(struct myx_softc *sc) bus_dmamap_sync(sc->sc_dmat, sc->sc_intrq_dma.mxm_map, 0, sc->sc_intrq_dma.mxm_map->dm_mapsize, BUS_DMASYNC_PREREAD); + livelocked = ifiq_input(&ifp->if_rcv, &ml); for (ring = MYX_RXSMALL; ring <= MYX_RXBIG; ring++) { if (rxfree[ring] == 0) continue; mrr = &sc->sc_rx_ring[ring]; + if (livelocked) + if_rxr_livelocked(&mrr->mrr_rxr); + if_rxr_put(&mrr->mrr_rxr, rxfree[ring]); myx_rx_fill(sc, mrr); if (mrr->mrr_prod == mrr->mrr_cons) timeout_add(&mrr->mrr_refill, 0); } - - if_input(ifp, &ml); } static int -- cgit v1.2.3