summaryrefslogtreecommitdiff
path: root/net/xfrm/xfrm_ipcomp.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-11-22 15:25:55 -0500
committerDavid S. Miller <davem@davemloft.net>2012-11-22 15:25:55 -0500
commit242a18d1374cebacd301f6b0ce1fd70d6c5afee6 (patch)
treeb5b6079bd153f3461c92895dd7a4435cf3a80bd5 /net/xfrm/xfrm_ipcomp.c
parentf2fb4ab2a647d6576812cbb3ae1979538112f6c8 (diff)
parent0afe21fdf6cfe0fe8a184d82a399773cc331bf40 (diff)
downloadolio-linux-3.10-242a18d1374cebacd301f6b0ce1fd70d6c5afee6.tar.xz
olio-linux-3.10-242a18d1374cebacd301f6b0ce1fd70d6c5afee6.zip
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next
Steffen Klassert says: ==================== This pull request is intended for net-next and contains the following changes: 1) Remove a redundant check when initializing the xfrm replay functions, from Ulrich Weber. 2) Use a faster per-cpu helper when allocating ipcomt transforms, from Shan Wei. 3) Use a static gc threshold value for ipv6, simmilar to what we do for ipv4 now. 4) Remove a commented out function call. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/xfrm/xfrm_ipcomp.c')
-rw-r--r--net/xfrm/xfrm_ipcomp.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/net/xfrm/xfrm_ipcomp.c b/net/xfrm/xfrm_ipcomp.c
index e5246fbe36c..2906d520eea 100644
--- a/net/xfrm/xfrm_ipcomp.c
+++ b/net/xfrm/xfrm_ipcomp.c
@@ -276,18 +276,16 @@ static struct crypto_comp * __percpu *ipcomp_alloc_tfms(const char *alg_name)
struct crypto_comp * __percpu *tfms;
int cpu;
- /* This can be any valid CPU ID so we don't need locking. */
- cpu = raw_smp_processor_id();
list_for_each_entry(pos, &ipcomp_tfms_list, list) {
struct crypto_comp *tfm;
- tfms = pos->tfms;
- tfm = *per_cpu_ptr(tfms, cpu);
+ /* This can be any valid CPU ID so we don't need locking. */
+ tfm = __this_cpu_read(*pos->tfms);
if (!strcmp(crypto_comp_name(tfm), alg_name)) {
pos->users++;
- return tfms;
+ return pos->tfms;
}
}