summaryrefslogtreecommitdiffstats
path: root/sys/netipsec/key.h
diff options
context:
space:
mode:
authorfabient <fabient@FreeBSD.org>2011-03-31 15:23:32 +0000
committerfabient <fabient@FreeBSD.org>2011-03-31 15:23:32 +0000
commitd56170701edd485dd31c6c68254daab567f5d249 (patch)
tree67cb0da741da7bd58b8f2eaa65607147ebf7f0af /sys/netipsec/key.h
parent3666785171ab6fafe3466579d69d661e79599f96 (diff)
downloadFreeBSD-src-d56170701edd485dd31c6c68254daab567f5d249.zip
FreeBSD-src-d56170701edd485dd31c6c68254daab567f5d249.tar.gz
Optimisation in IPSEC(4):
- Remove contention on ISR during the crypto operation by using rwlock(9). - Remove a second lookup of the SA in the callback. Gain on 6 cores CPU with SHA1/AES128 can be up to 30%. Reviewed by: vanhu MFC after: 1 month
Diffstat (limited to 'sys/netipsec/key.h')
-rw-r--r--sys/netipsec/key.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/netipsec/key.h b/sys/netipsec/key.h
index e85acd1..f246dbc 100644
--- a/sys/netipsec/key.h
+++ b/sys/netipsec/key.h
@@ -76,10 +76,13 @@ extern void _key_freesp(struct secpolicy **, const char*, int);
extern struct secasvar *key_allocsa(union sockaddr_union *, u_int, u_int32_t,
const char*, int);
+extern void key_addrefsa(struct secasvar *, const char*, int);
extern void key_freesav(struct secasvar **, const char*, int);
#define KEY_ALLOCSA(dst, proto, spi) \
key_allocsa(dst, proto, spi, __FILE__, __LINE__)
+#define KEY_ADDREFSA(sav) \
+ key_addrefsa(sav, __FILE__, __LINE__)
#define KEY_FREESAV(psav) \
key_freesav(psav, __FILE__, __LINE__)
OpenPOWER on IntegriCloud