Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: bge/bnx/iavf/igc/ix/ixl/ngbe/pcn: ifq_restart() fix
To:
Alexander Bluhm <bluhm@openbsd.org>
Cc:
tech@openbsd.org
Date:
Tue, 24 Jun 2025 13:16:45 +0200

Download raw body.

Thread
On Mon, Jun 23, 2025 at 08:04:06PM +0200, Alexander Bluhm wrote:
> And what should we do with the drivers noone has hardware and wants
> to test?  Just commit?

Only bnx and pcn have not yet been committed. Relevant diffs below.

It should be fairly safe to commit these changes but I will still
wait a little while just in case someone is going to test them soon.

commit - ef1ffab796f5eeb09eff6a34093d13f549266dcc
commit + dfd37bb73aa9ae249032bee306b0c109f225b9bf
blob - 3d93a269ba97b398505e353329db00db6cf0e937
blob + 97780dba62a5b32a6f7eacccc003f9e0097ab5da
--- sys/dev/pci/if_pcn.c
+++ sys/dev/pci/if_pcn.c
@@ -1143,6 +1143,7 @@ pcn_txintr(struct pcn_softc *sc)
 	struct pcn_txsoft *txs;
 	uint32_t tmd1, tmd2, tmd;
 	int i, j;
+	int done = 0;
 
 	/*
 	 * Go through our Tx list and free mbufs for those
@@ -1219,6 +1220,7 @@ pcn_txintr(struct pcn_softc *sc)
 		bus_dmamap_unload(sc->sc_dmat, txs->txs_dmamap);
 		m_freem(txs->txs_mbuf);
 		txs->txs_mbuf = NULL;
+		done = 1;
 	}
 
 	/* Update the dirty transmit buffer pointer. */
@@ -1231,7 +1233,7 @@ pcn_txintr(struct pcn_softc *sc)
 	if (sc->sc_txsfree == PCN_TXQUEUELEN)
 		ifp->if_timer = 0;
 
-	if (ifq_is_oactive(&ifp->if_snd))
+	if (done && ifq_is_oactive(&ifp->if_snd))
 		ifq_restart(&ifp->if_snd);
 }

commit - 71cb1d6d3bdd4c47a64317d2027278f4cf7ec566
commit + 54ae01823c55f8b3ccca719328747fd04cf0b118
blob - 6d18e3a22795dede966a95c3f81d74f71fd20b12
blob + 79382274aee75c3d51f54d747f6eda4ae84f0d99
--- sys/dev/pci/if_bnx.c
+++ sys/dev/pci/if_bnx.c
@@ -4579,7 +4579,7 @@ bnx_tx_intr(struct bnx_softc *sc)
 	if (used == 0)
 		ifp->if_timer = 0;
 
-	if (ifq_is_oactive(&ifp->if_snd))
+	if (freed && ifq_is_oactive(&ifp->if_snd))
 		ifq_restart(&ifp->if_snd);
 }