Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/cxgbe/tom/t4_tls.c
| Show First 20 Lines • Show All 490 Lines • ▼ Show 20 Lines | t4_push_ktls(struct adapter *sc, struct toepcb *toep, int drop) | ||||
| struct wrqe *wr; | struct wrqe *wr; | ||||
| struct mbuf *m; | struct mbuf *m; | ||||
| u_int nsegs, credits, wr_len; | u_int nsegs, credits, wr_len; | ||||
| u_int expn_size; | u_int expn_size; | ||||
| struct inpcb *inp = toep->inp; | struct inpcb *inp = toep->inp; | ||||
| struct tcpcb *tp = intotcpcb(inp); | struct tcpcb *tp = intotcpcb(inp); | ||||
| struct socket *so = inp->inp_socket; | struct socket *so = inp->inp_socket; | ||||
| struct sockbuf *sb = &so->so_snd; | struct sockbuf *sb = &so->so_snd; | ||||
| struct mbufq *pduq = &toep->ulp_pduq; | |||||
| int tls_size, tx_credits, shove, sowwakeup; | int tls_size, tx_credits, shove, sowwakeup; | ||||
| struct ofld_tx_sdesc *txsd; | struct ofld_tx_sdesc *txsd; | ||||
| char *buf; | char *buf; | ||||
| INP_WLOCK_ASSERT(inp); | INP_WLOCK_ASSERT(inp); | ||||
| KASSERT(toep->flags & TPF_FLOWC_WR_SENT, | KASSERT(toep->flags & TPF_FLOWC_WR_SENT, | ||||
| ("%s: flowc_wr not sent for tid %u.", __func__, toep->tid)); | ("%s: flowc_wr not sent for tid %u.", __func__, toep->tid)); | ||||
| Show All 25 Lines | if (__predict_false(toep->flags & TPF_TX_SUSPENDED)) { | ||||
| KASSERT(drop == 0, | KASSERT(drop == 0, | ||||
| ("%s: drop (%d) != 0 but tx is suspended", __func__, drop)); | ("%s: drop (%d) != 0 but tx is suspended", __func__, drop)); | ||||
| return; | return; | ||||
| } | } | ||||
| txsd = &toep->txsd[toep->txsd_pidx]; | txsd = &toep->txsd[toep->txsd_pidx]; | ||||
| for (;;) { | for (;;) { | ||||
| tx_credits = min(toep->tx_credits, MAX_OFLD_TX_CREDITS); | tx_credits = min(toep->tx_credits, MAX_OFLD_TX_CREDITS); | ||||
| if (__predict_false((m = mbufq_first(pduq)) != NULL)) { | |||||
| if (!t4_push_raw_wr(sc, toep, m)) { | |||||
| toep->flags |= TPF_TX_SUSPENDED; | |||||
| return; | |||||
| } | |||||
| (void)mbufq_dequeue(pduq); | |||||
| txsd = &toep->txsd[toep->txsd_pidx]; | |||||
| continue; | |||||
| } | |||||
| SOCKBUF_LOCK(sb); | SOCKBUF_LOCK(sb); | ||||
| sowwakeup = drop; | sowwakeup = drop; | ||||
| if (drop) { | if (drop) { | ||||
| sbdrop_locked(sb, drop); | sbdrop_locked(sb, drop); | ||||
| drop = 0; | drop = 0; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 754 Lines • Show Last 20 Lines | |||||