Changeset View
Changeset View
Standalone View
Standalone View
netipsec/xform_ah.c
Show First 20 Lines • Show All 649 Lines • ▼ Show 20 Lines | if (error != 0) { | ||||
AHSTAT_INC(ahs_hdrops); | AHSTAT_INC(ahs_hdrops); | ||||
free(xd, M_XDATA); | free(xd, M_XDATA); | ||||
crypto_freereq(crp); | crypto_freereq(crp); | ||||
return (error); | return (error); | ||||
} | } | ||||
/* Crypto operation descriptor. */ | /* Crypto operation descriptor. */ | ||||
crp->crp_ilen = m->m_pkthdr.len; /* Total input length. */ | crp->crp_ilen = m->m_pkthdr.len; /* Total input length. */ | ||||
crp->crp_flags = CRYPTO_F_IMBUF | CRYPTO_F_CBIFSYNC; | crp->crp_flags = CRYPTO_F_IMBUF; | ||||
if (V_crypto_mp_dispatch) | |||||
crp->crp_flags |= CRYPTO_F_MPDISPATCH | CRYPTO_F_REORDER; | |||||
jhb: I feel like I'd rather do the F_PERCPU check in the crypto code itself (e.g. in… | |||||
Not Done Inline ActionsThat is what I did first. emeric.poupon_stormshield.eu: That is what I did first.
Unfortunately, if you request a MP dispatch and the underlying crypto… | |||||
else | |||||
crp->crp_flags |= CRYPTO_F_CBIFSYNC; | |||||
crp->crp_buf = (caddr_t) m; | crp->crp_buf = (caddr_t) m; | ||||
crp->crp_callback = ah_input_cb; | crp->crp_callback = ah_input_cb; | ||||
crp->crp_sid = cryptoid; | crp->crp_sid = cryptoid; | ||||
crp->crp_opaque = (caddr_t) xd; | crp->crp_opaque = (caddr_t) xd; | ||||
/* These are passed as-is to the callback. */ | /* These are passed as-is to the callback. */ | ||||
xd->sav = sav; | xd->sav = sav; | ||||
xd->nxt = ah->ah_nxt; | xd->nxt = ah->ah_nxt; | ||||
▲ Show 20 Lines • Show All 355 Lines • ▼ Show 20 Lines | if (error != 0) { | ||||
m = NULL; /* mbuf was free'd by ah_massage_headers. */ | m = NULL; /* mbuf was free'd by ah_massage_headers. */ | ||||
free(xd, M_XDATA); | free(xd, M_XDATA); | ||||
crypto_freereq(crp); | crypto_freereq(crp); | ||||
goto bad; | goto bad; | ||||
} | } | ||||
/* Crypto operation descriptor. */ | /* Crypto operation descriptor. */ | ||||
crp->crp_ilen = m->m_pkthdr.len; /* Total input length. */ | crp->crp_ilen = m->m_pkthdr.len; /* Total input length. */ | ||||
crp->crp_flags = CRYPTO_F_IMBUF | CRYPTO_F_CBIFSYNC; | crp->crp_flags = CRYPTO_F_IMBUF; | ||||
if (V_crypto_mp_dispatch) | |||||
crp->crp_flags |= CRYPTO_F_MPDISPATCH | CRYPTO_F_REORDER; | |||||
else | |||||
crp->crp_flags |= CRYPTO_F_CBIFSYNC; | |||||
crp->crp_buf = (caddr_t) m; | crp->crp_buf = (caddr_t) m; | ||||
crp->crp_callback = ah_output_cb; | crp->crp_callback = ah_output_cb; | ||||
crp->crp_sid = cryptoid; | crp->crp_sid = cryptoid; | ||||
crp->crp_opaque = (caddr_t) xd; | crp->crp_opaque = (caddr_t) xd; | ||||
/* These are passed as-is to the callback. */ | /* These are passed as-is to the callback. */ | ||||
xd->sp = sp; | xd->sp = sp; | ||||
xd->sav = sav; | xd->sav = sav; | ||||
▲ Show 20 Lines • Show All 105 Lines • Show Last 20 Lines |
I feel like I'd rather do the F_PERCPU check in the crypto code itself (e.g. in crypto_dispatch) rather than in consumers.