diff options
author | Luiz Otavio O Souza <luiz@netgate.com> | 2015-09-15 13:33:28 -0500 |
---|---|---|
committer | Luiz Otavio O Souza <luiz@netgate.com> | 2015-10-20 11:51:32 -0500 |
commit | 373f155b959a37075bee99150a72ced22bbdc4e9 (patch) | |
tree | 68cfc9a28c858f39dadeb48cf1847a84289b1d54 /sys/geom/eli/g_eli_privacy.c | |
parent | e1d74c4df60335f7c9005bac00da240856a5935d (diff) | |
download | FreeBSD-src-373f155b959a37075bee99150a72ced22bbdc4e9.zip FreeBSD-src-373f155b959a37075bee99150a72ced22bbdc4e9.tar.gz |
MFC r271148:
use a straight buffer instead of an iov w/ 1 segment... The aesni
driver when it hits a mbuf/iov buffer, it mallocs and copies the data
for processing.. This improves perf by ~8-10% on my machine...
I have thoughts of fixing AES-NI so that it can better handle segmented
buffers, which should help improve IPSEC performance, but that is for
the future...
TAG: IPSEC-HEAD
Issue: #4841
Diffstat (limited to 'sys/geom/eli/g_eli_privacy.c')
-rw-r--r-- | sys/geom/eli/g_eli_privacy.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/sys/geom/eli/g_eli_privacy.c b/sys/geom/eli/g_eli_privacy.c index cad3881..2e6a211 100644 --- a/sys/geom/eli/g_eli_privacy.c +++ b/sys/geom/eli/g_eli_privacy.c @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include <sys/proc.h> #include <sys/sched.h> #include <sys/smp.h> -#include <sys/uio.h> #include <sys/vnode.h> #include <vm/uma.h> @@ -230,8 +229,6 @@ g_eli_crypto_run(struct g_eli_worker *wr, struct bio *bp) struct g_eli_softc *sc; struct cryptop *crp; struct cryptodesc *crd; - struct uio *uio; - struct iovec *iov; u_int i, nsec, secsize; int err, error; off_t dstoff; @@ -254,8 +251,6 @@ g_eli_crypto_run(struct g_eli_worker *wr, struct bio *bp) */ size = sizeof(*crp) * nsec; size += sizeof(*crd) * nsec; - size += sizeof(*uio) * nsec; - size += sizeof(*iov) * nsec; /* * If we write the data we cannot destroy current bio_data content, * so we need to allocate more memory for encrypted data. @@ -280,28 +275,18 @@ g_eli_crypto_run(struct g_eli_worker *wr, struct bio *bp) for (i = 0, dstoff = bp->bio_offset; i < nsec; i++, dstoff += secsize) { crp = (struct cryptop *)p; p += sizeof(*crp); crd = (struct cryptodesc *)p; p += sizeof(*crd); - uio = (struct uio *)p; p += sizeof(*uio); - iov = (struct iovec *)p; p += sizeof(*iov); - - iov->iov_len = secsize; - iov->iov_base = data; - data += secsize; - - uio->uio_iov = iov; - uio->uio_iovcnt = 1; - uio->uio_segflg = UIO_SYSSPACE; - uio->uio_resid = secsize; crp->crp_sid = wr->w_sid; crp->crp_ilen = secsize; crp->crp_olen = secsize; crp->crp_opaque = (void *)bp; - crp->crp_buf = (void *)uio; + crp->crp_buf = (void *)data; + data += secsize; if (bp->bio_cmd == BIO_WRITE) crp->crp_callback = g_eli_crypto_write_done; else /* if (bp->bio_cmd == BIO_READ) */ crp->crp_callback = g_eli_crypto_read_done; - crp->crp_flags = CRYPTO_F_IOV | CRYPTO_F_CBIFSYNC | CRYPTO_F_REL; + crp->crp_flags = CRYPTO_F_CBIFSYNC | CRYPTO_F_REL; if (g_eli_batch) crp->crp_flags |= CRYPTO_F_BATCH; crp->crp_desc = crd; |