diff options
| author | Herbert Xu <herbert@gondor.apana.org.au> | 2005-01-25 05:53:42 -0800 |
|---|---|---|
| committer | David S. Miller <davem@nuts.davemloft.net> | 2005-01-25 05:53:42 -0800 |
| commit | d113f0f0334c5dfbf5dd7909c80fb12b0359fa72 (patch) | |
| tree | cea68f9657c764237d6f8275f229cb1bbd34ca1a /include | |
| parent | 7a303cfdb151440b97c540dc1f3a5e43b8c3d802 (diff) | |
[XFRM]: Probe selected algorithm only.
This patch removes an annoying problem in xfrm_user. As it is every
time an SA is added it probes every known algorithm in the universe.
Now if they all existed it would be OK. However, for the ones which
don't actually exist this causes multiple /sbin/modprobe processes to
be spawned which slows the system down when you're adding hundreds of
SAs.
Since we know the type of algorithm required when we're adding a new
SA, we can get away with only probing the selected algorithms. This
is what the following patch does for xfrm_user.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: James Morris <jmorris@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/crypto.h | 8 | ||||
| -rw-r--r-- | include/net/xfrm.h | 6 |
2 files changed, 11 insertions, 3 deletions
diff --git a/include/linux/crypto.h b/include/linux/crypto.h index 4626d40e8c6e..387da6a3e58c 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h @@ -16,6 +16,7 @@ #ifndef _LINUX_CRYPTO_H #define _LINUX_CRYPTO_H +#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/types.h> @@ -121,7 +122,14 @@ int crypto_unregister_alg(struct crypto_alg *alg); /* * Algorithm query interface. */ +#ifdef CONFIG_CRYPTO int crypto_alg_available(const char *name, u32 flags); +#else +static inline int crypto_alg_available(const char *name, u32 flags) +{ + return 0; +} +#endif /* * Transforms: user-instantiated objects which encapsulate algorithms diff --git a/include/net/xfrm.h b/include/net/xfrm.h index d29831f449c1..40222ee71455 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -873,9 +873,9 @@ extern struct xfrm_algo_desc *xfrm_ealg_get_byidx(unsigned int idx); extern struct xfrm_algo_desc *xfrm_aalg_get_byid(int alg_id); extern struct xfrm_algo_desc *xfrm_ealg_get_byid(int alg_id); extern struct xfrm_algo_desc *xfrm_calg_get_byid(int alg_id); -extern struct xfrm_algo_desc *xfrm_aalg_get_byname(char *name); -extern struct xfrm_algo_desc *xfrm_ealg_get_byname(char *name); -extern struct xfrm_algo_desc *xfrm_calg_get_byname(char *name); +extern struct xfrm_algo_desc *xfrm_aalg_get_byname(char *name, int probe); +extern struct xfrm_algo_desc *xfrm_ealg_get_byname(char *name, int probe); +extern struct xfrm_algo_desc *xfrm_calg_get_byname(char *name, int probe); struct crypto_tfm; typedef void (icv_update_fn_t)(struct crypto_tfm *, struct scatterlist *, unsigned int); |
