Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1415023
| From | Christophe Leroy <christophe.leroy@c-s.fr> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v2 6/7] crypto: talitos - implement cra_priority |
| Date | 2016-06-06 15:10 +0200 |
| Message-ID | <rH2s2-5nS-37@gated-at.bofh.it> (permalink) |
| References | <rH2s2-5nS-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
SEC1 doesn't have IPSEC_ESP descriptor type but it is able to perform
IPSEC using HMAC_SNOOP_NO_AFEU, which is also existing on SEC2
In order to be able to define descriptors templates for SEC1 without
breaking SEC2+, we have to give lower priority to HMAC_SNOOP_NO_AFEU
so that SEC2+ selects IPSEC_ESP and not HMAC_SNOOP_NO_AFEU which is
less performant.
This is done by adding a priority field in the template. If the field
is 0, we use the default priority, otherwise we used the one in the
field.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
drivers/crypto/talitos.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c
index ff8cf39..dfd3a93 100644
--- a/drivers/crypto/talitos.c
+++ b/drivers/crypto/talitos.c
@@ -2120,6 +2120,7 @@ static int ahash_setkey(struct crypto_ahash *tfm, const u8 *key,
struct talitos_alg_template {
u32 type;
+ u32 priority;
union {
struct crypto_alg crypto;
struct ahash_alg hash;
@@ -2897,7 +2898,10 @@ static struct talitos_crypto_alg *talitos_alg_alloc(struct device *dev,
}
alg->cra_module = THIS_MODULE;
- alg->cra_priority = TALITOS_CRA_PRIORITY;
+ if (t_alg->algt.priority)
+ alg->cra_priority = t_alg->algt.priority;
+ else
+ alg->cra_priority = TALITOS_CRA_PRIORITY;
alg->cra_alignmask = 0;
alg->cra_ctxsize = sizeof(struct talitos_ctx);
alg->cra_flags |= CRYPTO_ALG_KERN_DRIVER_ONLY;
--
2.1.0
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2 0/7] crypto: talitos - implementation of AEAD for SEC1 Christophe Leroy <christophe.leroy@c-s.fr> - 2016-06-06 15:10 +0200 [PATCH v2 3/7] crypto: talitos - making mapping helpers more generic Christophe Leroy <christophe.leroy@c-s.fr> - 2016-06-06 15:10 +0200 [PATCH v2 4/7] crypto: talitos - Implement AEAD for SEC1 using HMAC_SNOOP_NO_AFEU Christophe Leroy <christophe.leroy@c-s.fr> - 2016-06-06 15:10 +0200 [PATCH v2 7/7] crypto: talitos - templates for AEAD using HMAC_SNOOP_NO_AFEU Christophe Leroy <christophe.leroy@c-s.fr> - 2016-06-06 15:10 +0200 [PATCH v2 5/7] crypto: talitos - sg_to_link_tbl() not used anymore, remove it Christophe Leroy <christophe.leroy@c-s.fr> - 2016-06-06 15:10 +0200 [PATCH v2 1/7] crypto: talitos - using helpers for all talitos_ptr operations Christophe Leroy <christophe.leroy@c-s.fr> - 2016-06-06 15:10 +0200 [PATCH v2 2/7] crypto: talitos - move mapping helpers before IPSEC functions Christophe Leroy <christophe.leroy@c-s.fr> - 2016-06-06 15:10 +0200 [PATCH v2 6/7] crypto: talitos - implement cra_priority Christophe Leroy <christophe.leroy@c-s.fr> - 2016-06-06 15:10 +0200 Re: [PATCH v2 0/7] crypto: talitos - implementation of AEAD for SEC1 Herbert Xu <herbert@gondor.apana.org.au> - 2016-06-08 10:40 +0200
csiph-web