Index: if_vmx.c =================================================================== RCS file: /cvs/src/sys/dev/pci/if_vmx.c,v retrieving revision 1.50 diff -u -p -r1.50 if_vmx.c --- if_vmx.c 6 Aug 2019 10:54:40 -0000 1.50 +++ if_vmx.c 22 Oct 2019 08:06:43 -0000 @@ -71,6 +71,7 @@ struct vmxnet3_rxring { bus_dmamap_t dmap[NRXDESC]; struct if_rxring rxr; struct timeout refill; + struct mutex mtx; struct vmxnet3_rxdesc *rxd; u_int fill; u_int8_t gen; @@ -460,6 +461,7 @@ vmxnet3_alloc_rxring(struct vmxnet3_soft ring = &rq->cmd_ring[i]; ring->sc = sc; ring->rid = i; + mtx_init(&ring->mtx, IPL_NET); timeout_set(&ring->refill, vmxnet3_rxfill, ring); for (idx = 0; idx < NRXDESC; idx++) { if (bus_dmamap_create(sc->sc_dmat, JUMBO_LEN, 1, @@ -506,6 +508,9 @@ vmxnet3_rxfill(void *arg) struct vmxnet3_softc *sc = ring->sc; u_int slots; + if (!mtx_enter_try(&ring->mtx)) + return; + for (slots = if_rxr_get(&ring->rxr, NRXDESC); slots > 0; slots--) { if (vmxnet3_getbuf(sc, ring)) break; @@ -514,6 +519,8 @@ vmxnet3_rxfill(void *arg) if (if_rxr_inuse(&ring->rxr) == 0) timeout_add(&ring->refill, 1); + + mtx_leave(&ring->mtx); } void