diff options
author | sam <sam@FreeBSD.org> | 2003-06-30 05:09:32 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2003-06-30 05:09:32 +0000 |
commit | e6dfb3860abe2078a8f73134b2a74981de357e28 (patch) | |
tree | 5f6e66583ac67766f3158c80d1f5db5a2c905add /sys/netipsec | |
parent | 3764707074b08f5916418458d97a4853a7738e21 (diff) | |
download | FreeBSD-src-e6dfb3860abe2078a8f73134b2a74981de357e28.zip FreeBSD-src-e6dfb3860abe2078a8f73134b2a74981de357e28.tar.gz |
consolidate callback optimization check in one location by adding a flag
for crypto operations that indicates the crypto code should do the check
in crypto_done
MFC after: 1 day
Diffstat (limited to 'sys/netipsec')
-rw-r--r-- | sys/netipsec/xform_ah.c | 22 | ||||
-rw-r--r-- | sys/netipsec/xform_esp.c | 22 | ||||
-rw-r--r-- | sys/netipsec/xform_ipcomp.c | 22 |
3 files changed, 6 insertions, 60 deletions
diff --git a/sys/netipsec/xform_ah.c b/sys/netipsec/xform_ah.c index 02176fd..1d67703 100644 --- a/sys/netipsec/xform_ah.c +++ b/sys/netipsec/xform_ah.c @@ -687,16 +687,7 @@ ah_input(struct mbuf *m, struct secasvar *sav, int skip, int protoff) /* Crypto operation descriptor. */ crp->crp_ilen = m->m_pkthdr.len; /* Total input length. */ - crp->crp_flags = CRYPTO_F_IMBUF; - /* - * When using crypto support the operates "synchronously" (e.g. - * software crypto) mark the operation for immediate callback to - * avoid the context switch. This increases the amount of kernel - * stack required to process a frame but we assume there is enough - * to do this. - */ - if (CRYPTO_SESID2CAPS(sav->tdb_cryptoid) & CRYPTOCAP_F_SYNC) - crp->crp_flags |= CRYPTO_F_CBIMM; + crp->crp_flags = CRYPTO_F_IMBUF | CRYPTO_F_CBIFSYNC; crp->crp_buf = (caddr_t) m; crp->crp_callback = ah_input_cb; crp->crp_sid = sav->tdb_cryptoid; @@ -1099,16 +1090,7 @@ ah_output( /* Crypto operation descriptor. */ crp->crp_ilen = m->m_pkthdr.len; /* Total input length. */ - crp->crp_flags = CRYPTO_F_IMBUF; - /* - * When using crypto support the operates "synchronously" (e.g. - * software crypto) mark the operation for immediate callback to - * avoid the context switch. This increases the amount of kernel - * stack required to process a frame but we assume there is enough - * to do this. - */ - if (CRYPTO_SESID2CAPS(sav->tdb_cryptoid) & CRYPTOCAP_F_SYNC) - crp->crp_flags |= CRYPTO_F_CBIMM; + crp->crp_flags = CRYPTO_F_IMBUF | CRYPTO_F_CBIFSYNC; crp->crp_buf = (caddr_t) m; crp->crp_callback = ah_output_cb; crp->crp_sid = sav->tdb_cryptoid; diff --git a/sys/netipsec/xform_esp.c b/sys/netipsec/xform_esp.c index 82f4049..b92d843 100644 --- a/sys/netipsec/xform_esp.c +++ b/sys/netipsec/xform_esp.c @@ -395,16 +395,7 @@ esp_input(struct mbuf *m, struct secasvar *sav, int skip, int protoff) /* Crypto operation descriptor */ crp->crp_ilen = m->m_pkthdr.len; /* Total input length */ - crp->crp_flags = CRYPTO_F_IMBUF; - /* - * When using crypto support the operates "synchronously" (e.g. - * software crypto) mark the operation for immediate callback to - * avoid the context switch. This increases the amount of kernel - * stack required to process a frame but we assume there is enough - * to do this. - */ - if (CRYPTO_SESID2CAPS(sav->tdb_cryptoid) & CRYPTOCAP_F_SYNC) - crp->crp_flags |= CRYPTO_F_CBIMM; + crp->crp_flags = CRYPTO_F_IMBUF | CRYPTO_F_CBIFSYNC; crp->crp_buf = (caddr_t) m; crp->crp_callback = esp_input_cb; crp->crp_sid = sav->tdb_cryptoid; @@ -842,16 +833,7 @@ esp_output( /* Crypto operation descriptor. */ crp->crp_ilen = m->m_pkthdr.len; /* Total input length. */ - crp->crp_flags = CRYPTO_F_IMBUF; - /* - * When using crypto support the operates "synchronously" (e.g. - * software crypto) mark the operation for immediate callback to - * avoid the context switch. This increases the amount of kernel - * stack required to process a frame but we assume there is enough - * to do this. - */ - if (CRYPTO_SESID2CAPS(sav->tdb_cryptoid) & CRYPTOCAP_F_SYNC) - crp->crp_flags |= CRYPTO_F_CBIMM; + crp->crp_flags = CRYPTO_F_IMBUF | CRYPTO_F_CBIFSYNC; crp->crp_buf = (caddr_t) m; crp->crp_callback = esp_output_cb; crp->crp_opaque = (caddr_t) tc; diff --git a/sys/netipsec/xform_ipcomp.c b/sys/netipsec/xform_ipcomp.c index aee9382..59e6210 100644 --- a/sys/netipsec/xform_ipcomp.c +++ b/sys/netipsec/xform_ipcomp.c @@ -173,16 +173,7 @@ ipcomp_input(struct mbuf *m, struct secasvar *sav, int skip, int protoff) /* Crypto operation descriptor */ crp->crp_ilen = m->m_pkthdr.len - (skip + hlen); - crp->crp_flags = CRYPTO_F_IMBUF; - /* - * When using crypto support the operates "synchronously" (e.g. - * software crypto) mark the operation for immediate callback to - * avoid the context switch. This increases the amount of kernel - * stack required to process a frame but we assume there is enough - * to do this. - */ - if (CRYPTO_SESID2CAPS(sav->tdb_cryptoid) & CRYPTOCAP_F_SYNC) - crp->crp_flags |= CRYPTO_F_CBIMM; + crp->crp_flags = CRYPTO_F_IMBUF | CRYPTO_F_CBIFSYNC; crp->crp_buf = (caddr_t) m; crp->crp_callback = ipcomp_input_cb; crp->crp_sid = sav->tdb_cryptoid; @@ -486,16 +477,7 @@ ipcomp_output( /* Crypto operation descriptor */ crp->crp_ilen = m->m_pkthdr.len; /* Total input length */ - crp->crp_flags = CRYPTO_F_IMBUF; - /* - * When using crypto support the operates "synchronously" (e.g. - * software crypto) mark the operation for immediate callback to - * avoid the context switch. This increases the amount of kernel - * stack required to process a frame but we assume there is enough - * to do this. - */ - if (CRYPTO_SESID2CAPS(sav->tdb_cryptoid) & CRYPTOCAP_F_SYNC) - crp->crp_flags |= CRYPTO_F_CBIMM; + crp->crp_flags = CRYPTO_F_IMBUF | CRYPTO_F_CBIFSYNC; crp->crp_buf = (caddr_t) m; crp->crp_callback = ipcomp_output_cb; crp->crp_opaque = (caddr_t) tc; |