summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/if_mcx.c
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2021-02-15 03:42:00 +0000
committerdlg <dlg@openbsd.org>2021-02-15 03:42:00 +0000
commit6bfee665d64f9c20b00a623b4d3e3a774765c987 (patch)
treec35d763d0fd90b885939e00f39f1f6f7bba11724 /sys/dev/pci/if_mcx.c
parentEnable clocks and adjust for removal of subnodes in upstream Linux (diff)
downloadwireguard-openbsd-6bfee665d64f9c20b00a623b4d3e3a774765c987.tar.xz
wireguard-openbsd-6bfee665d64f9c20b00a623b4d3e3a774765c987.zip
move the rearming of the cq after the refill of the rq.
this is the only real diff we have left outstanding on a box that experienced rx lockups. since adding this change it's been happy for the last 4 weeks and counting so far. ok jmatthew@
Diffstat (limited to 'sys/dev/pci/if_mcx.c')
-rw-r--r--sys/dev/pci/if_mcx.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/dev/pci/if_mcx.c b/sys/dev/pci/if_mcx.c
index 8d5c8864eba..75bccc03c79 100644
--- a/sys/dev/pci/if_mcx.c
+++ b/sys/dev/pci/if_mcx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_mcx.c,v 1.98 2021/01/27 07:46:11 dlg Exp $ */
+/* $OpenBSD: if_mcx.c,v 1.99 2021/02/15 03:42:00 dlg Exp $ */
/*
* Copyright (c) 2017 David Gwynne <dlg@openbsd.org>
@@ -6950,9 +6950,6 @@ mcx_process_cq(struct mcx_softc *sc, struct mcx_queues *q, struct mcx_cq *cq)
bus_dmamap_sync(sc->sc_dmat, MCX_DMA_MAP(&cq->cq_mem),
0, MCX_DMA_LEN(&cq->cq_mem), BUS_DMASYNC_PREREAD);
- cq->cq_count++;
- mcx_arm_cq(sc, cq, q->q_uar);
-
if (rxfree > 0) {
if_rxr_put(&rx->rx_rxr, rxfree);
if (ifiq_input(rx->rx_ifiq, &ml))
@@ -6962,6 +6959,10 @@ mcx_process_cq(struct mcx_softc *sc, struct mcx_queues *q, struct mcx_cq *cq)
if (if_rxr_inuse(&rx->rx_rxr) == 0)
timeout_add(&rx->rx_refill, 1);
}
+
+ cq->cq_count++;
+ mcx_arm_cq(sc, cq, q->q_uar);
+
if (txfree > 0) {
tx->tx_cons += txfree;
if (ifq_is_oactive(tx->tx_ifq))