Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/cxgbe/tom/t4_listen.c
Show First 20 Lines • Show All 344 Lines • ▼ Show 20 Lines | |||||
send_flowc_wr_synqe(struct adapter *sc, struct synq_entry *synqe) | send_flowc_wr_synqe(struct adapter *sc, struct synq_entry *synqe) | ||||
{ | { | ||||
struct mbuf *m = synqe->syn; | struct mbuf *m = synqe->syn; | ||||
struct ifnet *ifp = m->m_pkthdr.rcvif; | struct ifnet *ifp = m->m_pkthdr.rcvif; | ||||
struct vi_info *vi = ifp->if_softc; | struct vi_info *vi = ifp->if_softc; | ||||
struct port_info *pi = vi->pi; | struct port_info *pi = vi->pi; | ||||
struct wrqe *wr; | struct wrqe *wr; | ||||
struct fw_flowc_wr *flowc; | struct fw_flowc_wr *flowc; | ||||
struct sge_wrq *ofld_txq; | struct sge_ofld_txq *ofld_txq; | ||||
struct sge_ofld_rxq *ofld_rxq; | struct sge_ofld_rxq *ofld_rxq; | ||||
const int nparams = 6; | const int nparams = 6; | ||||
const int flowclen = sizeof(*flowc) + nparams * sizeof(struct fw_flowc_mnemval); | const int flowclen = sizeof(*flowc) + nparams * sizeof(struct fw_flowc_mnemval); | ||||
const u_int pfvf = sc->pf << S_FW_VIID_PFN; | const u_int pfvf = sc->pf << S_FW_VIID_PFN; | ||||
INP_WLOCK_ASSERT(synqe->lctx->inp); | INP_WLOCK_ASSERT(synqe->lctx->inp); | ||||
MPASS((synqe->flags & TPF_FLOWC_WR_SENT) == 0); | MPASS((synqe->flags & TPF_FLOWC_WR_SENT) == 0); | ||||
ofld_txq = &sc->sge.ofld_txq[synqe->params.txq_idx]; | ofld_txq = &sc->sge.ofld_txq[synqe->params.txq_idx]; | ||||
ofld_rxq = &sc->sge.ofld_rxq[synqe->params.rxq_idx]; | ofld_rxq = &sc->sge.ofld_rxq[synqe->params.rxq_idx]; | ||||
wr = alloc_wrqe(roundup2(flowclen, 16), ofld_txq); | wr = alloc_wrqe(roundup2(flowclen, 16), &ofld_txq->wrq); | ||||
if (wr == NULL) { | if (wr == NULL) { | ||||
/* XXX */ | /* XXX */ | ||||
panic("%s: allocation failure.", __func__); | panic("%s: allocation failure.", __func__); | ||||
} | } | ||||
flowc = wrtod(wr); | flowc = wrtod(wr); | ||||
memset(flowc, 0, wr->wr_len); | memset(flowc, 0, wr->wr_len); | ||||
flowc->op_to_nparams = htobe32(V_FW_WR_OP(FW_FLOWC_WR) | | flowc->op_to_nparams = htobe32(V_FW_WR_OP(FW_FLOWC_WR) | | ||||
V_FW_FLOWC_WR_NPARAMS(nparams)); | V_FW_FLOWC_WR_NPARAMS(nparams)); | ||||
Show All 32 Lines | CTR5(KTR_CXGBE, "%s: synqe %p (0x%x), tid %d%s", | ||||
" (abort already in progress)" : ""); | " (abort already in progress)" : ""); | ||||
if (synqe->flags & TPF_ABORT_SHUTDOWN) | if (synqe->flags & TPF_ABORT_SHUTDOWN) | ||||
return; /* abort already in progress */ | return; /* abort already in progress */ | ||||
synqe->flags |= TPF_ABORT_SHUTDOWN; | synqe->flags |= TPF_ABORT_SHUTDOWN; | ||||
if (!(synqe->flags & TPF_FLOWC_WR_SENT)) | if (!(synqe->flags & TPF_FLOWC_WR_SENT)) | ||||
send_flowc_wr_synqe(sc, synqe); | send_flowc_wr_synqe(sc, synqe); | ||||
wr = alloc_wrqe(sizeof(*req), &sc->sge.ofld_txq[synqe->params.txq_idx]); | wr = alloc_wrqe(sizeof(*req), | ||||
&sc->sge.ofld_txq[synqe->params.txq_idx].wrq); | |||||
if (wr == NULL) { | if (wr == NULL) { | ||||
/* XXX */ | /* XXX */ | ||||
panic("%s: allocation failure.", __func__); | panic("%s: allocation failure.", __func__); | ||||
} | } | ||||
req = wrtod(wr); | req = wrtod(wr); | ||||
INIT_TP_WR_MIT_CPL(req, CPL_ABORT_REQ, synqe->tid); | INIT_TP_WR_MIT_CPL(req, CPL_ABORT_REQ, synqe->tid); | ||||
req->rsvd0 = 0; /* don't have a snd_nxt */ | req->rsvd0 = 0; /* don't have a snd_nxt */ | ||||
req->rsvd1 = 1; /* no data sent yet */ | req->rsvd1 = 1; /* no data sent yet */ | ||||
▲ Show 20 Lines • Show All 457 Lines • ▼ Show 20 Lines | do_abort_req_synqe(struct sge_iq *iq, const struct rss_header *rss, | ||||
struct mbuf *m) | struct mbuf *m) | ||||
{ | { | ||||
struct adapter *sc = iq->adapter; | struct adapter *sc = iq->adapter; | ||||
const struct cpl_abort_req_rss *cpl = (const void *)(rss + 1); | const struct cpl_abort_req_rss *cpl = (const void *)(rss + 1); | ||||
unsigned int tid = GET_TID(cpl); | unsigned int tid = GET_TID(cpl); | ||||
struct synq_entry *synqe = lookup_tid(sc, tid); | struct synq_entry *synqe = lookup_tid(sc, tid); | ||||
struct listen_ctx *lctx = synqe->lctx; | struct listen_ctx *lctx = synqe->lctx; | ||||
struct inpcb *inp = lctx->inp; | struct inpcb *inp = lctx->inp; | ||||
struct sge_wrq *ofld_txq; | struct sge_ofld_txq *ofld_txq; | ||||
#ifdef INVARIANTS | #ifdef INVARIANTS | ||||
unsigned int opcode = G_CPL_OPCODE(be32toh(OPCODE_TID(cpl))); | unsigned int opcode = G_CPL_OPCODE(be32toh(OPCODE_TID(cpl))); | ||||
#endif | #endif | ||||
KASSERT(opcode == CPL_ABORT_REQ_RSS, | KASSERT(opcode == CPL_ABORT_REQ_RSS, | ||||
("%s: unexpected opcode 0x%x", __func__, opcode)); | ("%s: unexpected opcode 0x%x", __func__, opcode)); | ||||
KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__)); | KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__)); | ||||
KASSERT(synqe->tid == tid, ("%s: toep tid mismatch", __func__)); | KASSERT(synqe->tid == tid, ("%s: toep tid mismatch", __func__)); | ||||
▲ Show 20 Lines • Show All 694 Lines • Show Last 20 Lines |