MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ktls_enqueue

Function ktls_enqueue

freebsd/kern/uipc_ktls.c:1952–1981  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1950}
1951
1952void
1953ktls_enqueue(struct mbuf *m, struct socket *so, int page_count)
1954{
1955 struct ktls_wq *wq;
1956 bool running;
1957
1958 KASSERT(((m->m_flags & (M_EXTPG | M_NOTREADY)) ==
1959 (M_EXTPG | M_NOTREADY)),
1960 ("ktls_enqueue: %p not unready & nomap mbuf\n", m));
1961 KASSERT(page_count != 0, ("enqueueing TLS mbuf with zero page count"));
1962
1963 KASSERT(m->m_epg_tls->mode == TCP_TLS_MODE_SW, ("!SW TLS mbuf"));
1964
1965 m->m_epg_enc_cnt = page_count;
1966
1967 /*
1968 * Save a pointer to the socket. The caller is responsible
1969 * for taking an additional reference via soref().
1970 */
1971 m->m_epg_so = so;
1972
1973 wq = &ktls_wq[m->m_epg_tls->wq_index];
1974 mtx_lock(&wq->mtx);
1975 STAILQ_INSERT_TAIL(&wq->m_head, m, m_epg_stailq);
1976 running = wq->running;
1977 mtx_unlock(&wq->mtx);
1978 if (!running)
1979 wakeup(wq);
1980 counter_u64_add(ktls_cnt_tx_queued, 1);
1981}
1982
1983static __noinline void
1984ktls_encrypt(struct mbuf *top)

Callers 3

sendfile_iodoneFunction · 0.85
vn_sendfileFunction · 0.85
sosend_genericFunction · 0.85

Calls 4

mtx_lockFunction · 0.70
mtx_unlockFunction · 0.70
wakeupFunction · 0.70
counter_u64_addFunction · 0.50

Tested by

no test coverage detected