Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/bxe/bxe.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 8,728 Lines • ▼ Show 20 Lines | bxe_handle_sp_tq(void *context, | ||||
// XXX bxe_iov_sp_task(sc); | // XXX bxe_iov_sp_task(sc); | ||||
} | } | ||||
static void | static void | ||||
bxe_handle_fp_tq(void *context, | bxe_handle_fp_tq(void *context, | ||||
int pending) | int pending) | ||||
{ | { | ||||
struct epoch_tracker et; | |||||
struct bxe_fastpath *fp = (struct bxe_fastpath *)context; | struct bxe_fastpath *fp = (struct bxe_fastpath *)context; | ||||
struct bxe_softc *sc = fp->sc; | struct bxe_softc *sc = fp->sc; | ||||
uint8_t more_tx = FALSE; | uint8_t more_tx = FALSE; | ||||
uint8_t more_rx = FALSE; | uint8_t more_rx = FALSE; | ||||
BLOGD(sc, DBG_INTR, "---> FP TASK QUEUE (%d) <---\n", fp->index); | BLOGD(sc, DBG_INTR, "---> FP TASK QUEUE (%d) <---\n", fp->index); | ||||
/* XXX | /* XXX | ||||
Show All 15 Lines | #endif | ||||
/* fp->txdata[cos] */ | /* fp->txdata[cos] */ | ||||
if (bxe_has_tx_work(fp)) { | if (bxe_has_tx_work(fp)) { | ||||
BXE_FP_TX_LOCK(fp); | BXE_FP_TX_LOCK(fp); | ||||
more_tx = bxe_txeof(sc, fp); | more_tx = bxe_txeof(sc, fp); | ||||
BXE_FP_TX_UNLOCK(fp); | BXE_FP_TX_UNLOCK(fp); | ||||
} | } | ||||
if (bxe_has_rx_work(fp)) { | if (bxe_has_rx_work(fp)) { | ||||
NET_EPOCH_ENTER(et); | |||||
more_rx = bxe_rxeof(sc, fp); | more_rx = bxe_rxeof(sc, fp); | ||||
NET_EPOCH_EXIT(et); | |||||
} | } | ||||
if (more_rx /*|| more_tx*/) { | if (more_rx /*|| more_tx*/) { | ||||
/* still more work to do */ | /* still more work to do */ | ||||
taskqueue_enqueue(fp->tq, &fp->tq_task); | taskqueue_enqueue(fp->tq, &fp->tq_task); | ||||
return; | return; | ||||
} | } | ||||
bxe_ack_sb(sc, fp->igu_sb_id, USTORM_ID, | bxe_ack_sb(sc, fp->igu_sb_id, USTORM_ID, | ||||
le16toh(fp->fp_hc_idx), IGU_INT_ENABLE, 1); | le16toh(fp->fp_hc_idx), IGU_INT_ENABLE, 1); | ||||
} | } | ||||
static void | static void | ||||
bxe_task_fp(struct bxe_fastpath *fp) | bxe_task_fp(struct bxe_fastpath *fp) | ||||
{ | { | ||||
struct epoch_tracker et; | |||||
struct bxe_softc *sc = fp->sc; | struct bxe_softc *sc = fp->sc; | ||||
uint8_t more_tx = FALSE; | uint8_t more_tx = FALSE; | ||||
uint8_t more_rx = FALSE; | uint8_t more_rx = FALSE; | ||||
BLOGD(sc, DBG_INTR, "---> FP TASK ISR (%d) <---\n", fp->index); | BLOGD(sc, DBG_INTR, "---> FP TASK ISR (%d) <---\n", fp->index); | ||||
/* update the fastpath index */ | /* update the fastpath index */ | ||||
bxe_update_fp_sb_idx(fp); | bxe_update_fp_sb_idx(fp); | ||||
/* XXX add loop here if ever support multiple tx CoS */ | /* XXX add loop here if ever support multiple tx CoS */ | ||||
/* fp->txdata[cos] */ | /* fp->txdata[cos] */ | ||||
if (bxe_has_tx_work(fp)) { | if (bxe_has_tx_work(fp)) { | ||||
BXE_FP_TX_LOCK(fp); | BXE_FP_TX_LOCK(fp); | ||||
more_tx = bxe_txeof(sc, fp); | more_tx = bxe_txeof(sc, fp); | ||||
BXE_FP_TX_UNLOCK(fp); | BXE_FP_TX_UNLOCK(fp); | ||||
} | } | ||||
if (bxe_has_rx_work(fp)) { | if (bxe_has_rx_work(fp)) { | ||||
NET_EPOCH_ENTER(et); | |||||
more_rx = bxe_rxeof(sc, fp); | more_rx = bxe_rxeof(sc, fp); | ||||
NET_EPOCH_EXIT(et); | |||||
} | } | ||||
if (more_rx /*|| more_tx*/) { | if (more_rx /*|| more_tx*/) { | ||||
/* still more work to do, bail out if this ISR and process later */ | /* still more work to do, bail out if this ISR and process later */ | ||||
taskqueue_enqueue(fp->tq, &fp->tq_task); | taskqueue_enqueue(fp->tq, &fp->tq_task); | ||||
return; | return; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 10,745 Lines • ▼ Show 20 Lines | bxe_debugnet_transmit(struct ifnet *ifp, struct mbuf *m) | ||||
if (error != 0 && m != NULL) | if (error != 0 && m != NULL) | ||||
m_freem(m); | m_freem(m); | ||||
return (error); | return (error); | ||||
} | } | ||||
static int | static int | ||||
bxe_debugnet_poll(struct ifnet *ifp, int count) | bxe_debugnet_poll(struct ifnet *ifp, int count) | ||||
{ | { | ||||
struct epoch_tracker et; | |||||
struct bxe_softc *sc; | struct bxe_softc *sc; | ||||
int i; | int i; | ||||
sc = if_getsoftc(ifp); | sc = if_getsoftc(ifp); | ||||
if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0 || | if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0 || | ||||
!sc->link_vars.link_up) | !sc->link_vars.link_up) | ||||
return (ENOENT); | return (ENOENT); | ||||
for (i = 0; i < sc->num_queues; i++) | for (i = 0; i < sc->num_queues; i++) { | ||||
NET_EPOCH_ENTER(et); | |||||
(void)bxe_rxeof(sc, &sc->fp[i]); | (void)bxe_rxeof(sc, &sc->fp[i]); | ||||
NET_EPOCH_EXIT(et); | |||||
} | |||||
(void)bxe_txeof(sc, &sc->fp[0]); | (void)bxe_txeof(sc, &sc->fp[0]); | ||||
return (0); | return (0); | ||||
} | } | ||||
#endif /* DEBUGNET */ | #endif /* DEBUGNET */ |