Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/cxgbe/tom/t4_tls.c
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | |||||
#define tls_tcp_seq PH_loc.thirtytwo[0] | #define tls_tcp_seq PH_loc.thirtytwo[0] | ||||
static void | static void | ||||
t4_set_tls_tcb_field(struct toepcb *toep, uint16_t word, uint64_t mask, | t4_set_tls_tcb_field(struct toepcb *toep, uint16_t word, uint64_t mask, | ||||
uint64_t val) | uint64_t val) | ||||
{ | { | ||||
struct adapter *sc = td_adapter(toep->td); | struct adapter *sc = td_adapter(toep->td); | ||||
t4_set_tcb_field(sc, toep->ofld_txq, toep, word, mask, val, 0, 0); | t4_set_tcb_field(sc, &toep->ofld_txq->wrq, toep, word, mask, val, 0, 0); | ||||
} | } | ||||
/* TLS and DTLS common routines */ | /* TLS and DTLS common routines */ | ||||
bool | bool | ||||
can_tls_offload(struct adapter *sc) | can_tls_offload(struct adapter *sc) | ||||
{ | { | ||||
return (sc->tt.tls && sc->cryptocaps & FW_CAPS_CONFIG_TLSKEYS); | return (sc->tt.tls && sc->cryptocaps & FW_CAPS_CONFIG_TLSKEYS); | ||||
▲ Show 20 Lines • Show All 431 Lines • ▼ Show 20 Lines | tls_program_key_id(struct toepcb *toep, struct tls_key_context *k_ctx) | ||||
if (!G_KEY_CLR_LOC(k_ctx->l_p_key)) { | if (!G_KEY_CLR_LOC(k_ctx->l_p_key)) { | ||||
if ((keyid = get_new_keyid(toep)) < 0) { | if ((keyid = get_new_keyid(toep)) < 0) { | ||||
return (ENOSPC); | return (ENOSPC); | ||||
} | } | ||||
} else { | } else { | ||||
keyid = get_keyid(tls_ofld, k_ctx->l_p_key); | keyid = get_keyid(tls_ofld, k_ctx->l_p_key); | ||||
} | } | ||||
wr = alloc_wrqe(len, toep->ofld_txq); | wr = alloc_wrqe(len, &toep->ofld_txq->wrq); | ||||
if (wr == NULL) { | if (wr == NULL) { | ||||
free_keyid(toep, keyid); | free_keyid(toep, keyid); | ||||
return (ENOMEM); | return (ENOMEM); | ||||
} | } | ||||
kwr = wrtod(wr); | kwr = wrtod(wr); | ||||
memset(kwr, 0, kwrlen); | memset(kwr, 0, kwrlen); | ||||
kwr->wr_hi = htobe32(V_FW_WR_OP(FW_ULPTX_WR) | F_FW_WR_COMPL | | kwr->wr_hi = htobe32(V_FW_WR_OP(FW_ULPTX_WR) | F_FW_WR_COMPL | | ||||
▲ Show 20 Lines • Show All 1,061 Lines • ▼ Show 20 Lines | if (!imm_payload) { | ||||
max_nsegs_1mbuf = n; | max_nsegs_1mbuf = n; | ||||
} | } | ||||
/* Account for SGL in work request length. */ | /* Account for SGL in work request length. */ | ||||
wr_len += sizeof(struct ulptx_sgl) + | wr_len += sizeof(struct ulptx_sgl) + | ||||
((3 * (nsegs - 1)) / 2 + ((nsegs - 1) & 1)) * 8; | ((3 * (nsegs - 1)) / 2 + ((nsegs - 1) & 1)) * 8; | ||||
} | } | ||||
wr = alloc_wrqe(roundup2(wr_len, 16), toep->ofld_txq); | wr = alloc_wrqe(roundup2(wr_len, 16), &toep->ofld_txq->wrq); | ||||
if (wr == NULL) { | if (wr == NULL) { | ||||
/* XXX: how will we recover from this? */ | /* XXX: how will we recover from this? */ | ||||
toep->flags |= TPF_TX_SUSPENDED; | toep->flags |= TPF_TX_SUSPENDED; | ||||
return; | return; | ||||
} | } | ||||
#ifdef VERBOSE_TRACES | #ifdef VERBOSE_TRACES | ||||
CTR5(KTR_CXGBE, "%s: tid %d TLS record %d len %#x pdus %d", | CTR5(KTR_CXGBE, "%s: tid %d TLS record %d len %#x pdus %d", | ||||
▲ Show 20 Lines • Show All 294 Lines • ▼ Show 20 Lines | if (sowwakeup) | ||||
sowwakeup_locked(so); | sowwakeup_locked(so); | ||||
else | else | ||||
SOCKBUF_UNLOCK(sb); | SOCKBUF_UNLOCK(sb); | ||||
SOCKBUF_UNLOCK_ASSERT(sb); | SOCKBUF_UNLOCK_ASSERT(sb); | ||||
if (__predict_false(toep->flags & TPF_FIN_SENT)) | if (__predict_false(toep->flags & TPF_FIN_SENT)) | ||||
panic("%s: excess tx.", __func__); | panic("%s: excess tx.", __func__); | ||||
wr = alloc_wrqe(roundup2(wr_len, 16), toep->ofld_txq); | wr = alloc_wrqe(roundup2(wr_len, 16), &toep->ofld_txq->wrq); | ||||
if (wr == NULL) { | if (wr == NULL) { | ||||
/* XXX: how will we recover from this? */ | /* XXX: how will we recover from this? */ | ||||
toep->flags |= TPF_TX_SUSPENDED; | toep->flags |= TPF_TX_SUSPENDED; | ||||
return; | return; | ||||
} | } | ||||
thdr = (struct tls_hdr *)&m->m_epg_hdr; | thdr = (struct tls_hdr *)&m->m_epg_hdr; | ||||
#ifdef VERBOSE_TRACES | #ifdef VERBOSE_TRACES | ||||
▲ Show 20 Lines • Show All 499 Lines • Show Last 20 Lines |