Drop the driver lock around calls to if_input to avoid a LOR when

the packets are immediately returned for sending (e.g.  when bridging
or packet forwarding).  There are more efficient ways to do this
but for now use the least intrusive approach.

Reviewed by:	imp, rwatson
This commit is contained in:
Sam Leffler 2003-11-14 19:00:32 +00:00
parent 274461c944
commit 5120abbfb4
42 changed files with 123 additions and 2 deletions

View File

@ -833,6 +833,8 @@ an_rxeof(sc)
struct an_card_rx_desc an_rx_desc;
u_int8_t *buf;
AN_LOCK_ASSERT(sc);
ifp = &sc->arpcom.ac_if;
if (!sc->mpi350) {
@ -981,7 +983,9 @@ an_rxeof(sc)
rx_frame.an_rx_signal_strength,
rx_frame.an_rsvd0);
#endif
AN_UNLOCK(sc);
(*ifp->if_input)(ifp, m);
AN_LOCK(sc);
}
} else { /* MPI-350 */

View File

@ -502,6 +502,7 @@ struct an_softc {
#define AN_LOCK(_sc) mtx_lock(&(_sc)->an_mtx)
#define AN_UNLOCK(_sc) mtx_unlock(&(_sc)->an_mtx)
#define AN_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->an_mtx, MA_OWNED)
void an_release_resources (device_t);
int an_alloc_port (device_t, int, int);

View File

@ -1153,7 +1153,9 @@ bfe_rxeof(struct bfe_softc *sc)
ifp->if_ipackets++;
m->m_pkthdr.rcvif = ifp;
BFE_UNLOCK(sc);
(*ifp->if_input)(ifp, m);
BFE_LOCK(sc);
BFE_INC(cons, BFE_RX_LIST_CNT);
}

View File

@ -2723,6 +2723,8 @@ dc_rxeof(struct dc_softc *sc)
int i, total_len = 0;
u_int32_t rxstat;
DC_LOCK_ASSERT(sc);
ifp = &sc->arpcom.ac_if;
i = sc->dc_cdata.dc_rx_prod;
@ -2816,7 +2818,9 @@ dc_rxeof(struct dc_softc *sc)
}
ifp->if_ipackets++;
DC_UNLOCK(sc);
(*ifp->if_input)(ifp, m);
DC_LOCK(sc);
}
sc->dc_cdata.dc_rx_prod = i;
@ -3069,6 +3073,7 @@ dc_poll(struct ifnet *ifp, enum poll_cmd cmd, int count)
CSR_WRITE_4(sc, DC_IMR, DC_INTRS);
return;
}
DC_LOCK(sc);
sc->rxcycles = count;
dc_rxeof(sc);
dc_txeof(sc);
@ -3082,8 +3087,10 @@ dc_poll(struct ifnet *ifp, enum poll_cmd cmd, int count)
status &= (DC_ISR_RX_WATDOGTIMEO | DC_ISR_RX_NOBUF |
DC_ISR_TX_NOBUF | DC_ISR_TX_IDLE | DC_ISR_TX_UNDERRUN |
DC_ISR_BUS_ERR);
if (!status)
if (!status) {
DC_UNLOCK(sc);
return;
}
/* ack what we have */
CSR_WRITE_4(sc, DC_ISR, status);
@ -3107,6 +3114,7 @@ dc_poll(struct ifnet *ifp, enum poll_cmd cmd, int count)
dc_init(sc);
}
}
DC_UNLOCK(sc);
}
#endif /* DEVICE_POLLING */

View File

@ -766,6 +766,7 @@ struct dc_softc {
#define DC_LOCK(_sc) mtx_lock(&(_sc)->dc_mtx)
#define DC_UNLOCK(_sc) mtx_unlock(&(_sc)->dc_mtx)
#define DC_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->dc_mtx, MA_OWNED)
#define DC_TX_POLL 0x00000001
#define DC_TX_COALESCE 0x00000002

View File

@ -1277,7 +1277,9 @@ my_rxeof(struct my_softc * sc)
}
}
#endif
MY_UNLOCK(sc);
(*ifp->if_input)(ifp, m);
MY_LOCK(sc);
}
MY_UNLOCK(sc);
return;

View File

@ -449,6 +449,8 @@ wi_rxeof(sc)
struct mbuf *m;
int id;
WI_LOCK_ASSERT(sc);
ifp = &sc->arpcom.ac_if;
id = CSR_READ_2(sc, WI_RX_FID);
@ -650,7 +652,9 @@ wi_rxeof(sc)
#ifdef WICACHE
wi_cache_store(sc, eh, m, rx_frame.wi_q_info);
#endif
WI_UNLOCK(sc);
(*ifp->if_input)(ifp, m);
WI_LOCK(sc);
}
}

View File

@ -171,9 +171,11 @@ struct wi_card_ident {
#define ifaddr_byindex(idx) ifnet_addrs[(idx) - 1];
#define WI_LOCK(_sc, _s) s = splimp()
#define WI_UNLOCK(_sc, _s) splx(s)
#define WI_LOCK_ASSERT(_sc)
#else
#define WI_LOCK(_sc, _s) _s = 1
#define WI_UNLOCK(_sc, _s)
#define WI_LOCK_ASSERT(_sc)
#endif
int owi_generic_attach(device_t);

View File

@ -1517,6 +1517,8 @@ re_rxeof(sc)
struct rl_desc *cur_rx;
u_int32_t rxstat, rxvlan;
RL_LOCK_ASSERT(sc);
ifp = &sc->arpcom.ac_if;
i = sc->rl_ldata.rl_rx_prodidx;
@ -1659,7 +1661,9 @@ re_rxeof(sc)
if (rxvlan & RL_RDESC_VLANCTL_TAG)
VLAN_INPUT_TAG(ifp, m,
ntohs((rxvlan & RL_RDESC_VLANCTL_DATA)), continue);
RL_UNLOCK(sc);
(*ifp->if_input)(ifp, m);
RL_LOCK(sc);
}
/* Flush the RX DMA ring */

View File

@ -955,6 +955,8 @@ sf_rxeof(sc)
u_int32_t rxcons, rxprod;
int cmpprodidx, cmpconsidx, bufprodidx;
SF_LOCK_ASSERT(sc);
ifp = &sc->arpcom.ac_if;
rxcons = csr_read_4(sc, SF_CQ_CONSIDX);
@ -988,7 +990,9 @@ sf_rxeof(sc)
m = m0;
ifp->if_ipackets++;
SF_UNLOCK(sc);
(*ifp->if_input)(ifp, m);
SF_LOCK(sc);
}
csr_write_4(sc, SF_CQ_CONSIDX,

View File

@ -1051,6 +1051,7 @@ struct sf_softc {
#define SF_LOCK(_sc) mtx_lock(&(_sc)->sf_mtx)
#define SF_UNLOCK(_sc) mtx_unlock(&(_sc)->sf_mtx)
#define SF_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sf_mtx, MA_OWNED)
#define SF_TIMEOUT 1000

View File

@ -1839,6 +1839,7 @@ static void
sk_rxeof(sc_if)
struct sk_if_softc *sc_if;
{
struct sk_softc *sc;
struct mbuf *m;
struct ifnet *ifp;
struct sk_chain *cur_rx;
@ -1846,10 +1847,13 @@ sk_rxeof(sc_if)
int i;
u_int32_t rxstat;
sc = sc_if->sk_softc;
ifp = &sc_if->arpcom.ac_if;
i = sc_if->sk_cdata.sk_rx_prod;
cur_rx = &sc_if->sk_cdata.sk_rx_chain[i];
SK_LOCK_ASSERT(sc);
while(!(sc_if->sk_rdata->sk_rx_ring[i].sk_ctl & SK_RXCTL_OWN)) {
cur_rx = &sc_if->sk_cdata.sk_rx_chain[i];
@ -1891,7 +1895,9 @@ sk_rxeof(sc_if)
}
ifp->if_ipackets++;
SK_UNLOCK(sc);
(*ifp->if_input)(ifp, m);
SK_LOCK(sc);
}
sc_if->sk_cdata.sk_rx_prod = i;

View File

@ -1423,6 +1423,7 @@ struct sk_softc {
#define SK_LOCK(_sc) mtx_lock(&(_sc)->sk_mtx)
#define SK_UNLOCK(_sc) mtx_unlock(&(_sc)->sk_mtx)
#define SK_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sk_mtx, MA_OWNED)
#define SK_IF_LOCK(_sc) mtx_lock(&(_sc)->sk_softc->sk_mtx)
#define SK_IF_UNLOCK(_sc) mtx_unlock(&(_sc)->sk_softc->sk_mtx)

View File

@ -2384,6 +2384,8 @@ ti_rxeof(sc)
struct ifnet *ifp;
struct ti_cmd_desc cmd;
TI_LOCK_ASSERT(sc);
ifp = &sc->arpcom.ac_if;
while(sc->ti_rx_saved_considx != sc->ti_return_prodidx.ti_idx) {
@ -2479,7 +2481,9 @@ ti_rxeof(sc)
*/
if (have_tag)
VLAN_INPUT_TAG(ifp, m, vlan_tag, continue);
TI_UNLOCK(sc);
(*ifp->if_input)(ifp, m);
TI_LOCK(sc);
}
/* Only necessary on the Tigon 1. */

View File

@ -1030,6 +1030,7 @@ struct ti_softc {
#define TI_LOCK(_sc) mtx_lock(&(_sc)->ti_mtx)
#define TI_UNLOCK(_sc) mtx_unlock(&(_sc)->ti_mtx)
#define TI_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->ti_mtx, MA_OWNED)
/*
* Microchip Technology 24Cxx EEPROM control bytes

View File

@ -1061,6 +1061,8 @@ vr_rxeof(sc)
int total_len = 0;
u_int32_t rxstat;
VR_LOCK_ASSERT(sc);
ifp = &sc->arpcom.ac_if;
while(!((rxstat = sc->vr_cdata.vr_rx_head->vr_ptr->vr_status) &
@ -1122,7 +1124,9 @@ vr_rxeof(sc)
m = m0;
ifp->if_ipackets++;
VR_UNLOCK(sc);
(*ifp->if_input)(ifp, m);
VR_LOCK(sc);
}
return;

View File

@ -475,6 +475,7 @@ struct vr_softc {
#define VR_LOCK(_sc) mtx_lock(&(_sc)->vr_mtx)
#define VR_UNLOCK(_sc) mtx_unlock(&(_sc)->vr_mtx)
#define VR_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->vr_mtx, MA_OWNED)
/*
* register space access macros

View File

@ -265,6 +265,7 @@ struct wl_softc{
};
#define WL_LOCK(_sc) mtx_lock(&(_sc)->wl_mtx)
#define WL_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->wl_mtx, MA_OWNED)
#define WL_UNLOCK(_sc) mtx_unlock(&(_sc)->wl_mtx)
static int wlprobe(device_t);
@ -1069,6 +1070,7 @@ wlread(struct wl_softc *sc, u_short fd_p)
u_short mlen, len;
u_short bytes_in_msg, bytes_in_mbuf, bytes;
WL_LOCK_ASSERT(sc);
#ifdef WLDEBUG
if (sc->wl_if.if_flags & IFF_DEBUG)
@ -1212,7 +1214,9 @@ wlread(struct wl_softc *sc, u_short fd_p)
* received packet is now in a chain of mbuf's. next step is
* to pass the packet upwards.
*/
WL_UNLOCK(sc);
(*ifp->if_input)(ifp, m);
WL_LOCK(sc);
return 1;
}

View File

@ -2723,6 +2723,8 @@ dc_rxeof(struct dc_softc *sc)
int i, total_len = 0;
u_int32_t rxstat;
DC_LOCK_ASSERT(sc);
ifp = &sc->arpcom.ac_if;
i = sc->dc_cdata.dc_rx_prod;
@ -2816,7 +2818,9 @@ dc_rxeof(struct dc_softc *sc)
}
ifp->if_ipackets++;
DC_UNLOCK(sc);
(*ifp->if_input)(ifp, m);
DC_LOCK(sc);
}
sc->dc_cdata.dc_rx_prod = i;
@ -3069,6 +3073,7 @@ dc_poll(struct ifnet *ifp, enum poll_cmd cmd, int count)
CSR_WRITE_4(sc, DC_IMR, DC_INTRS);
return;
}
DC_LOCK(sc);
sc->rxcycles = count;
dc_rxeof(sc);
dc_txeof(sc);
@ -3082,8 +3087,10 @@ dc_poll(struct ifnet *ifp, enum poll_cmd cmd, int count)
status &= (DC_ISR_RX_WATDOGTIMEO | DC_ISR_RX_NOBUF |
DC_ISR_TX_NOBUF | DC_ISR_TX_IDLE | DC_ISR_TX_UNDERRUN |
DC_ISR_BUS_ERR);
if (!status)
if (!status) {
DC_UNLOCK(sc);
return;
}
/* ack what we have */
CSR_WRITE_4(sc, DC_ISR, status);
@ -3107,6 +3114,7 @@ dc_poll(struct ifnet *ifp, enum poll_cmd cmd, int count)
dc_init(sc);
}
}
DC_UNLOCK(sc);
}
#endif /* DEVICE_POLLING */

View File

@ -766,6 +766,7 @@ struct dc_softc {
#define DC_LOCK(_sc) mtx_lock(&(_sc)->dc_mtx)
#define DC_UNLOCK(_sc) mtx_unlock(&(_sc)->dc_mtx)
#define DC_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->dc_mtx, MA_OWNED)
#define DC_TX_POLL 0x00000001
#define DC_TX_COALESCE 0x00000002

View File

@ -796,6 +796,8 @@ pcn_rxeof(sc)
struct pcn_rx_desc *cur_rx;
int i;
PCN_LOCK_ASSERT(sc);
ifp = &sc->arpcom.ac_if;
i = sc->pcn_cdata.pcn_rx_prod;
@ -833,7 +835,9 @@ pcn_rxeof(sc)
cur_rx->pcn_rxlen - ETHER_CRC_LEN;
m->m_pkthdr.rcvif = ifp;
PCN_UNLOCK(sc);
(*ifp->if_input)(ifp, m);
PCN_LOCK(sc);
}
sc->pcn_cdata.pcn_rx_prod = i;

View File

@ -453,6 +453,7 @@ struct pcn_softc {
#define PCN_LOCK(_sc) mtx_lock(&(_sc)->pcn_mtx)
#define PCN_UNLOCK(_sc) mtx_unlock(&(_sc)->pcn_mtx)
#define PCN_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->pcn_mtx, MA_OWNED)
/*
* register space access macros

View File

@ -1236,6 +1236,8 @@ rl_rxeof(sc)
u_int16_t limit;
u_int16_t rx_bytes = 0, max_bytes;
RL_LOCK_ASSERT(sc);
ifp = &sc->arpcom.ac_if;
bus_dmamap_sync(sc->rl_tag, sc->rl_cdata.rl_rx_dmamap,
@ -1336,7 +1338,9 @@ rl_rxeof(sc)
continue;
ifp->if_ipackets++;
RL_UNLOCK(sc);
(*ifp->if_input)(ifp, m);
RL_LOCK(sc);
}
return;

View File

@ -692,6 +692,7 @@ struct rl_softc {
#define RL_LOCK(_sc) mtx_lock(&(_sc)->rl_mtx)
#define RL_UNLOCK(_sc) mtx_unlock(&(_sc)->rl_mtx)
#define RL_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->rl_mtx, MA_OWNED)
/*
* register space access macros

View File

@ -955,6 +955,8 @@ sf_rxeof(sc)
u_int32_t rxcons, rxprod;
int cmpprodidx, cmpconsidx, bufprodidx;
SF_LOCK_ASSERT(sc);
ifp = &sc->arpcom.ac_if;
rxcons = csr_read_4(sc, SF_CQ_CONSIDX);
@ -988,7 +990,9 @@ sf_rxeof(sc)
m = m0;
ifp->if_ipackets++;
SF_UNLOCK(sc);
(*ifp->if_input)(ifp, m);
SF_LOCK(sc);
}
csr_write_4(sc, SF_CQ_CONSIDX,

View File

@ -1051,6 +1051,7 @@ struct sf_softc {
#define SF_LOCK(_sc) mtx_lock(&(_sc)->sf_mtx)
#define SF_UNLOCK(_sc) mtx_unlock(&(_sc)->sf_mtx)
#define SF_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sf_mtx, MA_OWNED)
#define SF_TIMEOUT 1000

View File

@ -1594,6 +1594,8 @@ sis_rxeof(sc)
int i, total_len = 0;
u_int32_t rxstat;
SIS_LOCK_ASSERT(sc);
ifp = &sc->arpcom.ac_if;
i = sc->sis_cdata.sis_rx_prod;
@ -1661,7 +1663,9 @@ sis_rxeof(sc)
ifp->if_ipackets++;
m->m_pkthdr.rcvif = ifp;
SIS_UNLOCK(sc);
(*ifp->if_input)(ifp, m);
SIS_LOCK(sc);
}
sc->sis_cdata.sis_rx_prod = i;

View File

@ -479,6 +479,7 @@ struct sis_softc {
#define SIS_LOCK(_sc) mtx_lock(&(_sc)->sis_mtx)
#define SIS_UNLOCK(_sc) mtx_unlock(&(_sc)->sis_mtx)
#define SIS_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sis_mtx, MA_OWNED)
/*
* register space access macros

View File

@ -1839,6 +1839,7 @@ static void
sk_rxeof(sc_if)
struct sk_if_softc *sc_if;
{
struct sk_softc *sc;
struct mbuf *m;
struct ifnet *ifp;
struct sk_chain *cur_rx;
@ -1846,10 +1847,13 @@ sk_rxeof(sc_if)
int i;
u_int32_t rxstat;
sc = sc_if->sk_softc;
ifp = &sc_if->arpcom.ac_if;
i = sc_if->sk_cdata.sk_rx_prod;
cur_rx = &sc_if->sk_cdata.sk_rx_chain[i];
SK_LOCK_ASSERT(sc);
while(!(sc_if->sk_rdata->sk_rx_ring[i].sk_ctl & SK_RXCTL_OWN)) {
cur_rx = &sc_if->sk_cdata.sk_rx_chain[i];
@ -1891,7 +1895,9 @@ sk_rxeof(sc_if)
}
ifp->if_ipackets++;
SK_UNLOCK(sc);
(*ifp->if_input)(ifp, m);
SK_LOCK(sc);
}
sc_if->sk_cdata.sk_rx_prod = i;

View File

@ -1423,6 +1423,7 @@ struct sk_softc {
#define SK_LOCK(_sc) mtx_lock(&(_sc)->sk_mtx)
#define SK_UNLOCK(_sc) mtx_unlock(&(_sc)->sk_mtx)
#define SK_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sk_mtx, MA_OWNED)
#define SK_IF_LOCK(_sc) mtx_lock(&(_sc)->sk_softc->sk_mtx)
#define SK_IF_UNLOCK(_sc) mtx_unlock(&(_sc)->sk_softc->sk_mtx)

View File

@ -693,6 +693,8 @@ ste_rxeof(sc)
int total_len = 0, count=0;
u_int32_t rxstat;
STE_LOCK_ASSERT(sc);
ifp = &sc->arpcom.ac_if;
while((rxstat = sc->ste_cdata.ste_rx_head->ste_ptr->ste_status)
@ -750,7 +752,9 @@ ste_rxeof(sc)
m->m_pkthdr.len = m->m_len = total_len;
ifp->if_ipackets++;
STE_UNLOCK(sc);
(*ifp->if_input)(ifp, m);
STE_LOCK(sc);
cur_rx->ste_ptr->ste_status = 0;
count++;

View File

@ -530,6 +530,7 @@ struct ste_softc {
#define STE_LOCK(_sc) mtx_lock(&(_sc)->ste_mtx)
#define STE_UNLOCK(_sc) mtx_unlock(&(_sc)->ste_mtx)
#define STE_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->ste_mtx, MA_OWNED)
struct ste_mii_frame {
u_int8_t mii_stdelim;

View File

@ -2384,6 +2384,8 @@ ti_rxeof(sc)
struct ifnet *ifp;
struct ti_cmd_desc cmd;
TI_LOCK_ASSERT(sc);
ifp = &sc->arpcom.ac_if;
while(sc->ti_rx_saved_considx != sc->ti_return_prodidx.ti_idx) {
@ -2479,7 +2481,9 @@ ti_rxeof(sc)
*/
if (have_tag)
VLAN_INPUT_TAG(ifp, m, vlan_tag, continue);
TI_UNLOCK(sc);
(*ifp->if_input)(ifp, m);
TI_LOCK(sc);
}
/* Only necessary on the Tigon 1. */

View File

@ -1030,6 +1030,7 @@ struct ti_softc {
#define TI_LOCK(_sc) mtx_lock(&(_sc)->ti_mtx)
#define TI_UNLOCK(_sc) mtx_unlock(&(_sc)->ti_mtx)
#define TI_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->ti_mtx, MA_OWNED)
/*
* Microchip Technology 24Cxx EEPROM control bytes

View File

@ -1504,6 +1504,8 @@ tl_intvec_rxeof(xsc, type)
sc = xsc;
ifp = &sc->arpcom.ac_if;
TL_LOCK_ASSERT(sc);
while(sc->tl_cdata.tl_rx_head != NULL) {
cur_rx = sc->tl_cdata.tl_rx_head;
if (!(cur_rx->tl_ptr->tlist_cstat & TL_CSTAT_FRAMECMP))
@ -1543,7 +1545,9 @@ tl_intvec_rxeof(xsc, type)
m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = m->m_len = total_len;
TL_UNLOCK(sc);
(*ifp->if_input)(ifp, m);
TL_LOCK(sc);
}
return(r);

View File

@ -130,6 +130,7 @@ struct tl_softc {
#define TL_LOCK(_sc) mtx_lock(&(_sc)->tl_mtx)
#define TL_UNLOCK(_sc) mtx_unlock(&(_sc)->tl_mtx)
#define TL_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->tl_mtx, MA_OWNED)
/*
* Transmit interrupt threshold.

View File

@ -1061,6 +1061,8 @@ vr_rxeof(sc)
int total_len = 0;
u_int32_t rxstat;
VR_LOCK_ASSERT(sc);
ifp = &sc->arpcom.ac_if;
while(!((rxstat = sc->vr_cdata.vr_rx_head->vr_ptr->vr_status) &
@ -1122,7 +1124,9 @@ vr_rxeof(sc)
m = m0;
ifp->if_ipackets++;
VR_UNLOCK(sc);
(*ifp->if_input)(ifp, m);
VR_LOCK(sc);
}
return;

View File

@ -475,6 +475,7 @@ struct vr_softc {
#define VR_LOCK(_sc) mtx_lock(&(_sc)->vr_mtx)
#define VR_UNLOCK(_sc) mtx_unlock(&(_sc)->vr_mtx)
#define VR_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->vr_mtx, MA_OWNED)
/*
* register space access macros

View File

@ -1132,6 +1132,8 @@ wb_rxeof(sc)
int total_len = 0;
u_int32_t rxstat;
WB_LOCK_ASSERT(sc);
ifp = &sc->arpcom.ac_if;
while(!((rxstat = sc->wb_cdata.wb_rx_head->wb_ptr->wb_status) &
@ -1186,7 +1188,9 @@ wb_rxeof(sc)
m = m0;
ifp->if_ipackets++;
WB_UNLOCK(sc);
(*ifp->if_input)(ifp, m);
WB_LOCK(sc);
}
}

View File

@ -383,6 +383,7 @@ struct wb_softc {
#define WB_LOCK(_sc) mtx_lock(&(_sc)->wb_mtx)
#define WB_UNLOCK(_sc) mtx_unlock(&(_sc)->wb_mtx)
#define WB_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->wb_mtx, MA_OWNED)
/*
* register space access macros

View File

@ -2046,6 +2046,8 @@ xl_rxeof(sc)
int total_len = 0;
u_int32_t rxstat;
XL_LOCK_ASSERT(sc);
ifp = &sc->arpcom.ac_if;
again:
@ -2137,7 +2139,9 @@ xl_rxeof(sc)
}
}
XL_UNLOCK(sc);
(*ifp->if_input)(ifp, m);
XL_LOCK(sc);
}
/*

View File

@ -610,9 +610,11 @@ struct xl_softc {
/* These are a bit premature. The driver still tries to sleep with locks. */
#define XL_LOCK(_sc) mtx_lock(&(_sc)->xl_mtx)
#define XL_UNLOCK(_sc) mtx_unlock(&(_sc)->xl_mtx)
#define XL_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->xl_mtx, MA_OWNED)
#else
#define XL_LOCK(x) do { } while (0)
#define XL_UNLOCK(x) do { } while (0)
#define XL_LOCK_ASSERT(x) do { } while (0)
#endif
#define xl_rx_goodframes(x) \