diff options
author | fabient <fabient@FreeBSD.org> | 2011-03-31 15:23:32 +0000 |
---|---|---|
committer | fabient <fabient@FreeBSD.org> | 2011-03-31 15:23:32 +0000 |
commit | d56170701edd485dd31c6c68254daab567f5d249 (patch) | |
tree | 67cb0da741da7bd58b8f2eaa65607147ebf7f0af /sys/netipsec/key.h | |
parent | 3666785171ab6fafe3466579d69d661e79599f96 (diff) | |
download | FreeBSD-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.h | 3 |
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__) |