Index: if_vmx.c =================================================================== RCS file: /cvs/src/sys/dev/pci/if_vmx.c,v retrieving revision 1.70 diff -u -p -r1.70 if_vmx.c --- if_vmx.c 11 Sep 2022 08:38:39 -0000 1.70 +++ if_vmx.c 28 Jul 2023 13:00:33 -0000 @@ -48,8 +48,8 @@ #define VMX_MAX_QUEUES MIN(VMXNET3_MAX_TX_QUEUES, VMXNET3_MAX_RX_QUEUES) -#define NTXDESC 512 /* tx ring size */ -#define NTXSEGS 8 /* tx descriptors per packet */ +#define NTXDESC 128 /* tx ring size */ +#define NTXSEGS 8 /* tx descriptors per packet */ #define NRXDESC 512 #define NTXCOMPDESC NTXDESC #define NRXCOMPDESC (NRXDESC * 2) /* ring1 + ring2 */ @@ -924,18 +924,20 @@ vmxnet3_txintr(struct vmxnet3_softc *sc, struct vmxnet3_txcompdesc *txcd; bus_dmamap_t map; struct mbuf *m; - u_int cons, next; + u_int prod, cons, next; uint32_t rgen; + prod = ring->prod; cons = ring->cons; - if (cons == ring->prod) + + if (cons == prod) return; next = comp_ring->next; rgen = comp_ring->gen; /* postread */ - for (;;) { + do { txcd = &comp_ring->txcd[next]; if ((txcd->txc_word3 & VMX_TXC_GEN) != rgen) break; @@ -951,6 +953,8 @@ vmxnet3_txintr(struct vmxnet3_softc *sc, KASSERT(m != NULL); map = ring->dmap[cons]; + bus_dmamap_sync(sc->sc_dmat, map, 0, map->dm_mapsize, + BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(sc->sc_dmat, map); m_freem(m); @@ -958,7 +962,7 @@ vmxnet3_txintr(struct vmxnet3_softc *sc, VMXNET3_TXC_EOPIDX_M; cons++; cons %= NTXDESC; - } + } while (cons != prod); /* preread */ comp_ring->next = next;