Index: if_sk.c =================================================================== RCS file: /home/ncvs/src/sys/pci/if_sk.c,v retrieving revision 1.87 diff -u -r1.87 if_sk.c --- if_sk.c 1 Nov 2004 17:21:04 -0000 1.87 +++ if_sk.c 2 Nov 2004 19:05:29 -0000 @@ -1076,6 +1076,8 @@ { struct sk_jpool_entry *entry; + SK_IF_LOCK_ASSERT(sc_if); + entry = SLIST_FIRST(&sc_if->sk_jfree_listhead); if (entry == NULL) { @@ -1108,6 +1110,8 @@ if (sc_if == NULL) panic("sk_jfree: didn't get softc pointer!"); + SK_IF_LOCK_ASSERT(sc_if); + /* calculate the slot this buffer belongs to */ i = ((vm_offset_t)buf - (vm_offset_t)sc_if->sk_cdata.sk_jumbo_buf) / SK_JLEN; @@ -1845,11 +1849,13 @@ } /* Transmit */ - sc_if->sk_cdata.sk_tx_prod = idx; - CSR_WRITE_4(sc, sc_if->sk_tx_bmu, SK_TXBMU_TX_START); + if (idx != sc_if->sk_cdata.sk_tx_prod) { + sc_if->sk_cdata.sk_tx_prod = idx; + CSR_WRITE_4(sc, sc_if->sk_tx_bmu, SK_TXBMU_TX_START); - /* Set a timeout in case the chip goes out to lunch. */ - ifp->if_timer = 5; + /* Set a timeout in case the chip goes out to lunch. */ + ifp->if_timer = 5; + } SK_IF_UNLOCK(sc_if); return; @@ -1989,13 +1995,15 @@ } sc_if->sk_cdata.sk_tx_cnt--; SK_INC(idx, SK_TX_RING_CNT); - ifp->if_timer = 0; } - sc_if->sk_cdata.sk_tx_cons = idx; - - if (cur_tx != NULL) + if (sc_if->sk_cdata.sk_tx_cnt == 0) { + ifp->if_timer = 0; ifp->if_flags &= ~IFF_OACTIVE; + } else /* nudge chip to keep tx ring moving */ + CSR_WRITE_4(sc, sc_if->sk_tx_bmu, SK_TXBMU_TX_START); + + sc_if->sk_cdata.sk_tx_cons = idx; return; } Index: if_skreg.h =================================================================== RCS file: /home/ncvs/src/sys/pci/if_skreg.h,v retrieving revision 1.22 diff -u -r1.22 if_skreg.h --- if_skreg.h 20 Aug 2004 06:22:04 -0000 1.22 +++ if_skreg.h 2 Nov 2004 19:05:29 -0000 @@ -1441,6 +1441,7 @@ #define SK_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sk_mtx, MA_OWNED) #define SK_IF_LOCK(_sc) SK_LOCK((_sc)->sk_softc) #define SK_IF_UNLOCK(_sc) SK_UNLOCK((_sc)->sk_softc) +#define SK_IF_LOCK_ASSERT(_sc) SK_LOCK_ASSERT((_sc)->sk_softc) /* Softc for each logical interface */ struct sk_if_softc {