Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/cxgbe/crypto/t4_kern_tls.c
Show First 20 Lines • Show All 96 Lines • ▼ Show 20 Lines | struct tlspcb { | ||||
struct inpcb *inp; /* backpointer to host stack's PCB */ | struct inpcb *inp; /* backpointer to host stack's PCB */ | ||||
struct sge_txq *txq; | struct sge_txq *txq; | ||||
struct sge_wrq *ctrlq; | struct sge_wrq *ctrlq; | ||||
struct clip_entry *ce; /* CLIP table entry used by this tid */ | struct clip_entry *ce; /* CLIP table entry used by this tid */ | ||||
bool open_pending; | bool open_pending; | ||||
}; | }; | ||||
static void cxgbe_tls_tag_free(struct m_snd_tag *mst); | |||||
static int ktls_setup_keys(struct tlspcb *tlsp, | static int ktls_setup_keys(struct tlspcb *tlsp, | ||||
const struct ktls_session *tls, struct sge_txq *txq); | const struct ktls_session *tls, struct sge_txq *txq); | ||||
static const struct if_snd_tag_sw cxgbe_tls_tag_sw = { | |||||
.snd_tag_free = cxgbe_tls_tag_free | |||||
}; | |||||
static inline struct tlspcb * | static inline struct tlspcb * | ||||
mst_to_tls(struct m_snd_tag *t) | mst_to_tls(struct m_snd_tag *t) | ||||
{ | { | ||||
return (__containerof(t, struct tlspcb, com)); | return (__containerof(t, struct tlspcb, com)); | ||||
} | } | ||||
static struct tlspcb * | static struct tlspcb * | ||||
alloc_tlspcb(struct ifnet *ifp, struct vi_info *vi, int flags) | alloc_tlspcb(struct ifnet *ifp, struct vi_info *vi, int flags) | ||||
{ | { | ||||
struct port_info *pi = vi->pi; | struct port_info *pi = vi->pi; | ||||
struct adapter *sc = pi->adapter; | struct adapter *sc = pi->adapter; | ||||
struct tlspcb *tlsp; | struct tlspcb *tlsp; | ||||
tlsp = malloc(sizeof(*tlsp), M_CXGBE, M_ZERO | flags); | tlsp = malloc(sizeof(*tlsp), M_CXGBE, M_ZERO | flags); | ||||
if (tlsp == NULL) | if (tlsp == NULL) | ||||
return (NULL); | return (NULL); | ||||
m_snd_tag_init(&tlsp->com, ifp, IF_SND_TAG_TYPE_TLS); | m_snd_tag_init(&tlsp->com, ifp, IF_SND_TAG_TYPE_TLS, &cxgbe_tls_tag_sw); | ||||
tlsp->vi = vi; | tlsp->vi = vi; | ||||
tlsp->sc = sc; | tlsp->sc = sc; | ||||
tlsp->ctrlq = &sc->sge.ctrlq[pi->port_id]; | tlsp->ctrlq = &sc->sge.ctrlq[pi->port_id]; | ||||
tlsp->tid = -1; | tlsp->tid = -1; | ||||
tlsp->tx_key_addr = -1; | tlsp->tx_key_addr = -1; | ||||
return (tlsp); | return (tlsp); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,932 Lines • ▼ Show 20 Lines | ndesc = ktls_write_tcp_fin(txq, dst, m, available, | ||||
tlsp->prev_seq, pidx); | tlsp->prev_seq, pidx); | ||||
totdesc += ndesc; | totdesc += ndesc; | ||||
} | } | ||||
MPASS(totdesc <= available); | MPASS(totdesc <= available); | ||||
return (totdesc); | return (totdesc); | ||||
} | } | ||||
void | static void | ||||
cxgbe_tls_tag_free(struct m_snd_tag *mst) | cxgbe_tls_tag_free(struct m_snd_tag *mst) | ||||
{ | { | ||||
struct adapter *sc; | struct adapter *sc; | ||||
struct tlspcb *tlsp; | struct tlspcb *tlsp; | ||||
tlsp = mst_to_tls(mst); | tlsp = mst_to_tls(mst); | ||||
sc = tlsp->sc; | sc = tlsp->sc; | ||||
▲ Show 20 Lines • Show All 69 Lines • Show Last 20 Lines |