| 1950 | } |
| 1951 | |
| 1952 | void |
| 1953 | ktls_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 | |
| 1983 | static __noinline void |
| 1984 | ktls_encrypt(struct mbuf *top) |
no test coverage detected