Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/sfxge/sfxge_tx.c
Show First 20 Lines • Show All 774 Lines • ▼ Show 20 Lines | sfxge_tx_qdpl_flush(struct sfxge_txq *txq) | ||||
stdp->std_get_count = 0; | stdp->std_get_count = 0; | ||||
stdp->std_get_non_tcp_count = 0; | stdp->std_get_non_tcp_count = 0; | ||||
stdp->std_getp = &stdp->std_get; | stdp->std_getp = &stdp->std_get; | ||||
SFXGE_TXQ_UNLOCK(txq); | SFXGE_TXQ_UNLOCK(txq); | ||||
} | } | ||||
void | void | ||||
sfxge_if_qflush(struct ifnet *ifp) | sfxge_if_qflush(if_t ifp) | ||||
{ | { | ||||
struct sfxge_softc *sc; | struct sfxge_softc *sc; | ||||
unsigned int i; | unsigned int i; | ||||
sc = ifp->if_softc; | sc = if_getsoftc(ifp); | ||||
for (i = 0; i < sc->txq_count; i++) | for (i = 0; i < sc->txq_count; i++) | ||||
sfxge_tx_qdpl_flush(sc->txq[i]); | sfxge_tx_qdpl_flush(sc->txq[i]); | ||||
} | } | ||||
#if SFXGE_TX_PARSE_EARLY | #if SFXGE_TX_PARSE_EARLY | ||||
/* There is little space for user data in mbuf pkthdr, so we | /* There is little space for user data in mbuf pkthdr, so we | ||||
▲ Show 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | static void sfxge_parse_tx_packet(struct mbuf *mbuf) | ||||
TSO_MBUF_FLAGS(mbuf) = th->th_flags; | TSO_MBUF_FLAGS(mbuf) = th->th_flags; | ||||
} | } | ||||
#endif | #endif | ||||
/* | /* | ||||
* TX start -- called by the stack. | * TX start -- called by the stack. | ||||
*/ | */ | ||||
int | int | ||||
sfxge_if_transmit(struct ifnet *ifp, struct mbuf *m) | sfxge_if_transmit(if_t ifp, struct mbuf *m) | ||||
{ | { | ||||
struct sfxge_softc *sc; | struct sfxge_softc *sc; | ||||
struct sfxge_txq *txq; | struct sfxge_txq *txq; | ||||
int rc; | int rc; | ||||
sc = (struct sfxge_softc *)ifp->if_softc; | sc = (struct sfxge_softc *)if_getsoftc(ifp); | ||||
/* | /* | ||||
* Transmit may be called when interface is up from the kernel | * Transmit may be called when interface is up from the kernel | ||||
* point of view, but not yet up (in progress) from the driver | * point of view, but not yet up (in progress) from the driver | ||||
* point of view. I.e. link aggregation bring up. | * point of view. I.e. link aggregation bring up. | ||||
* Transmit may be called when interface is up from the driver | * Transmit may be called when interface is up from the driver | ||||
* point of view, but already down from the kernel point of | * point of view, but already down from the kernel point of | ||||
* view. I.e. Rx when interface shutdown is in progress. | * view. I.e. Rx when interface shutdown is in progress. | ||||
*/ | */ | ||||
KASSERT((ifp->if_flags & IFF_UP) || (sc->if_flags & IFF_UP), | KASSERT((if_getflags(ifp) & IFF_UP) || (sc->if_flags & IFF_UP), | ||||
("interface not up")); | ("interface not up")); | ||||
/* Pick the desired transmit queue. */ | /* Pick the desired transmit queue. */ | ||||
if (sc->txq_dynamic_cksum_toggle_supported | | if (sc->txq_dynamic_cksum_toggle_supported | | ||||
(m->m_pkthdr.csum_flags & | (m->m_pkthdr.csum_flags & | ||||
(CSUM_DELAY_DATA | CSUM_TCP_IPV6 | CSUM_UDP_IPV6 | CSUM_TSO))) { | (CSUM_DELAY_DATA | CSUM_TCP_IPV6 | CSUM_UDP_IPV6 | CSUM_TSO))) { | ||||
int index = 0; | int index = 0; | ||||
▲ Show 20 Lines • Show All 1,191 Lines • Show Last 20 Lines |