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

Function ktls_ocf_dispatch

freebsd/opencrypto/ktls_ocf.c:123–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123static int
124ktls_ocf_dispatch(struct ocf_session *os, struct cryptop *crp)
125{
126 struct ocf_operation oo;
127 int error;
128
129 oo.os = os;
130 oo.done = false;
131
132 crp->crp_opaque = &oo;
133 crp->crp_callback = ktls_ocf_callback;
134 for (;;) {
135 error = crypto_dispatch(crp);
136 if (error)
137 break;
138
139 mtx_lock(&os->lock);
140 while (!oo.done)
141 mtx_sleep(&oo, &os->lock, 0, "ocfktls", 0);
142 mtx_unlock(&os->lock);
143
144 if (crp->crp_etype != EAGAIN) {
145 error = crp->crp_etype;
146 break;
147 }
148
149 crp->crp_etype = 0;
150 crp->crp_flags &= ~CRYPTO_F_DONE;
151 oo.done = false;
152 counter_u64_add(ocf_retries, 1);
153 }
154 return (error);
155}
156
157static int
158ktls_ocf_tls_cbc_encrypt(struct ktls_session *tls,

Callers 4

ktls_ocf_tls_cbc_encryptFunction · 0.85

Calls 4

crypto_dispatchFunction · 0.85
mtx_lockFunction · 0.50
mtx_unlockFunction · 0.50
counter_u64_addFunction · 0.50

Tested by

no test coverage detected