Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/uipc_ktls.c
Show First 20 Lines • Show All 2,360 Lines • ▼ Show 20 Lines | if (__predict_false(error != 0)) { | ||||
* We have a corrupted record and are likely | * We have a corrupted record and are likely | ||||
* out of sync. The connection isn't | * out of sync. The connection isn't | ||||
* recoverable at this point, so abort it. | * recoverable at this point, so abort it. | ||||
*/ | */ | ||||
SOCKBUF_UNLOCK(sb); | SOCKBUF_UNLOCK(sb); | ||||
counter_u64_add(ktls_offload_corrupted_records, 1); | counter_u64_add(ktls_offload_corrupted_records, 1); | ||||
CURVNET_SET(so->so_vnet); | CURVNET_SET(so->so_vnet); | ||||
so->so_proto->pr_usrreqs->pru_abort(so); | so->so_proto->pr_abort(so); | ||||
so->so_error = error; | so->so_error = error; | ||||
CURVNET_RESTORE(); | CURVNET_RESTORE(); | ||||
goto deref; | goto deref; | ||||
} | } | ||||
/* Is the entire record queued? */ | /* Is the entire record queued? */ | ||||
if (sb->sb_tlscc < tls_len) | if (sb->sb_tlscc < tls_len) | ||||
break; | break; | ||||
▲ Show 20 Lines • Show All 507 Lines • ▼ Show 20 Lines | for (m = top; npages != total_pages; m = m->m_next) { | ||||
* session. | * session. | ||||
*/ | */ | ||||
m->m_epg_tls = NULL; | m->m_epg_tls = NULL; | ||||
ktls_free(tls); | ktls_free(tls); | ||||
} | } | ||||
CURVNET_SET(so->so_vnet); | CURVNET_SET(so->so_vnet); | ||||
if (error == 0) { | if (error == 0) { | ||||
(void)(*so->so_proto->pr_usrreqs->pru_ready)(so, top, npages); | (void)so->so_proto->pr_ready(so, top, npages); | ||||
} else { | } else { | ||||
so->so_proto->pr_usrreqs->pru_abort(so); | so->so_proto->pr_abort(so); | ||||
so->so_error = EIO; | so->so_error = EIO; | ||||
mb_free_notready(top, total_pages); | mb_free_notready(top, total_pages); | ||||
} | } | ||||
sorele(so); | sorele(so); | ||||
CURVNET_RESTORE(); | CURVNET_RESTORE(); | ||||
} | } | ||||
Show All 25 Lines | ktls_encrypt_cb(struct ktls_ocf_encrypt_state *state, int error) | ||||
if (error != 0) | if (error != 0) | ||||
counter_u64_add(ktls_offload_failed_crypto, 1); | counter_u64_add(ktls_offload_failed_crypto, 1); | ||||
CURVNET_SET(so->so_vnet); | CURVNET_SET(so->so_vnet); | ||||
npages = m->m_epg_nrdy; | npages = m->m_epg_nrdy; | ||||
if (error == 0) { | if (error == 0) { | ||||
(void)(*so->so_proto->pr_usrreqs->pru_ready)(so, m, npages); | (void)so->so_proto->pr_ready(so, m, npages); | ||||
} else { | } else { | ||||
so->so_proto->pr_usrreqs->pru_abort(so); | so->so_proto->pr_abort(so); | ||||
so->so_error = EIO; | so->so_error = EIO; | ||||
mb_free_notready(m, npages); | mb_free_notready(m, npages); | ||||
} | } | ||||
sorele(so); | sorele(so); | ||||
CURVNET_RESTORE(); | CURVNET_RESTORE(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | if (error) { | ||||
break; | break; | ||||
} | } | ||||
npages += mpages; | npages += mpages; | ||||
} | } | ||||
CURVNET_SET(so->so_vnet); | CURVNET_SET(so->so_vnet); | ||||
if (error != 0) { | if (error != 0) { | ||||
so->so_proto->pr_usrreqs->pru_abort(so); | so->so_proto->pr_abort(so); | ||||
so->so_error = EIO; | so->so_error = EIO; | ||||
mb_free_notready(m, total_pages - npages); | mb_free_notready(m, total_pages - npages); | ||||
} | } | ||||
sorele(so); | sorele(so); | ||||
CURVNET_RESTORE(); | CURVNET_RESTORE(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 240 Lines • Show Last 20 Lines |