Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/cxgbe/t4_sge.c
Show First 20 Lines • Show All 339 Lines • ▼ Show 20 Lines | |||||
static int sysctl_bufsizes(SYSCTL_HANDLER_ARGS); | static int sysctl_bufsizes(SYSCTL_HANDLER_ARGS); | ||||
#ifdef RATELIMIT | #ifdef RATELIMIT | ||||
#if defined(INET) || defined(INET6) | #if defined(INET) || defined(INET6) | ||||
static inline u_int txpkt_eo_len16(u_int, u_int, u_int); | static inline u_int txpkt_eo_len16(u_int, u_int, u_int); | ||||
#endif | #endif | ||||
static int ethofld_fw4_ack(struct sge_iq *, const struct rss_header *, | static int ethofld_fw4_ack(struct sge_iq *, const struct rss_header *, | ||||
struct mbuf *); | struct mbuf *); | ||||
static int ethofld_transmit(struct ifnet *, struct mbuf *); | |||||
#endif | #endif | ||||
static counter_u64_t extfree_refs; | static counter_u64_t extfree_refs; | ||||
static counter_u64_t extfree_rels; | static counter_u64_t extfree_rels; | ||||
an_handler_t t4_an_handler; | an_handler_t t4_an_handler; | ||||
fw_msg_handler_t t4_fw_msg_handler[NUM_FW6_TYPES]; | fw_msg_handler_t t4_fw_msg_handler[NUM_FW6_TYPES]; | ||||
cpl_handler_t t4_cpl_handler[NUM_CPL_CMDS]; | cpl_handler_t t4_cpl_handler[NUM_CPL_CMDS]; | ||||
▲ Show 20 Lines • Show All 2,599 Lines • ▼ Show 20 Lines | if (needs_eo(mst)) { | ||||
immhdrs = m0->m_pkthdr.l2hlen + m0->m_pkthdr.l3hlen + | immhdrs = m0->m_pkthdr.l2hlen + m0->m_pkthdr.l3hlen + | ||||
m0->m_pkthdr.l4hlen; | m0->m_pkthdr.l4hlen; | ||||
cflags = 0; | cflags = 0; | ||||
nsegs = count_mbuf_nsegs(m0, immhdrs, &cflags); | nsegs = count_mbuf_nsegs(m0, immhdrs, &cflags); | ||||
MPASS(cflags == mbuf_cflags(m0)); | MPASS(cflags == mbuf_cflags(m0)); | ||||
set_mbuf_eo_nsegs(m0, nsegs); | set_mbuf_eo_nsegs(m0, nsegs); | ||||
set_mbuf_eo_len16(m0, | set_mbuf_eo_len16(m0, | ||||
txpkt_eo_len16(nsegs, immhdrs, needs_tso(m0))); | txpkt_eo_len16(nsegs, immhdrs, needs_tso(m0))); | ||||
rc = ethofld_transmit(mst->ifp, m0); | |||||
if (rc != 0) | |||||
goto fail; | |||||
return (EINPROGRESS); | |||||
} | } | ||||
#endif | #endif | ||||
#endif | #endif | ||||
MPASS(m0 == *mp); | MPASS(m0 == *mp); | ||||
return (0); | return (0); | ||||
} | } | ||||
void * | void * | ||||
▲ Show 20 Lines • Show All 3,871 Lines • ▼ Show 20 Lines | while ((m = mbufq_first(&cst->pending_tx)) != NULL) { | ||||
m->m_pkthdr.snd_tag = NULL; | m->m_pkthdr.snd_tag = NULL; | ||||
m->m_pkthdr.csum_flags &= ~CSUM_SND_TAG; | m->m_pkthdr.csum_flags &= ~CSUM_SND_TAG; | ||||
m_snd_tag_rele(&cst->com); | m_snd_tag_rele(&cst->com); | ||||
mbufq_enqueue(&cst->pending_fwack, m); | mbufq_enqueue(&cst->pending_fwack, m); | ||||
} | } | ||||
} | } | ||||
int | static int | ||||
ethofld_transmit(struct ifnet *ifp, struct mbuf *m0) | ethofld_transmit(struct ifnet *ifp, struct mbuf *m0) | ||||
{ | { | ||||
struct cxgbe_rate_tag *cst; | struct cxgbe_rate_tag *cst; | ||||
int rc; | int rc; | ||||
MPASS(m0->m_nextpkt == NULL); | MPASS(m0->m_nextpkt == NULL); | ||||
MPASS(m0->m_pkthdr.csum_flags & CSUM_SND_TAG); | MPASS(m0->m_pkthdr.csum_flags & CSUM_SND_TAG); | ||||
MPASS(m0->m_pkthdr.snd_tag != NULL); | MPASS(m0->m_pkthdr.snd_tag != NULL); | ||||
Show All 39 Lines | ethofld_transmit(struct ifnet *ifp, struct mbuf *m0) | ||||
m_snd_tag_ref(&cst->com); | m_snd_tag_ref(&cst->com); | ||||
ethofld_tx(cst); | ethofld_tx(cst); | ||||
mtx_unlock(&cst->lock); | mtx_unlock(&cst->lock); | ||||
m_snd_tag_rele(&cst->com); | m_snd_tag_rele(&cst->com); | ||||
return (0); | return (0); | ||||
done: | done: | ||||
mtx_unlock(&cst->lock); | mtx_unlock(&cst->lock); | ||||
if (__predict_false(rc != 0)) | |||||
m_freem(m0); | |||||
return (rc); | return (rc); | ||||
} | } | ||||
static int | static int | ||||
ethofld_fw4_ack(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m0) | ethofld_fw4_ack(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m0) | ||||
{ | { | ||||
struct adapter *sc = iq->adapter; | struct adapter *sc = iq->adapter; | ||||
const struct cpl_fw4_ack *cpl = (const void *)(rss + 1); | const struct cpl_fw4_ack *cpl = (const void *)(rss + 1); | ||||
▲ Show 20 Lines • Show All 75 Lines • Show Last 20 Lines |