Module Name: src
Committed By: jmcneill
Date: Sat Feb 20 13:31:35 UTC 2021
Modified Files:
src/sys/dev/pci: if_mcx.c
Log Message:
Sync with OpenBSD r1.99:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/pci/if_mcx.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/pci/if_mcx.c
diff -u src/sys/dev/pci/if_mcx.c:1.16 src/sys/dev/pci/if_mcx.c:1.17
--- src/sys/dev/pci/if_mcx.c:1.16 Fri Feb 5 22:23:30 2021
+++ src/sys/dev/pci/if_mcx.c Sat Feb 20 13:31:35 2021
@@ -1,5 +1,5 @@
-/* $NetBSD: if_mcx.c,v 1.16 2021/02/05 22:23:30 jmcneill Exp $ */
-/* $OpenBSD: if_mcx.c,v 1.98 2021/01/27 07:46:11 dlg Exp $ */
+/* $NetBSD: if_mcx.c,v 1.17 2021/02/20 13:31:35 jmcneill Exp $ */
+/* $OpenBSD: if_mcx.c,v 1.99 2021/02/15 03:42:00 dlg Exp $ */
/*
* Copyright (c) 2017 David Gwynne <[email protected]>
@@ -23,7 +23,7 @@
#endif
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_mcx.c,v 1.16 2021/02/05 22:23:30 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mcx.c,v 1.17 2021/02/20 13:31:35 jmcneill Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -7082,9 +7082,6 @@ mcx_process_cq(struct mcx_softc *sc, str
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) {
mcx_rxr_put(&rx->rx_rxr, rxfree);
while (MBUFQ_FIRST(&mq) != NULL) {
@@ -7096,6 +7093,10 @@ mcx_process_cq(struct mcx_softc *sc, str
if (mcx_rxr_inuse(&rx->rx_rxr) == 0)
callout_schedule(&rx->rx_refill, 1);
}
+
+ cq->cq_count++;
+ mcx_arm_cq(sc, cq, q->q_uar);
+
if (txfree > 0) {
tx->tx_cons += txfree;
if_schedule_deferred_start(ifp);