Commit 61bb86bb authored by Kim Phillips's avatar Kim Phillips Committed by Herbert Xu

crypto: caam - set descriptor sharing type to SERIAL

SHARE_WAIT, whilst more optimal for association-less crypto,
has the ability to start thrashing the CCB descriptor/key
caches, given high levels of traffic across multiple security
associations (and thus keys).

Switch to using the SERIAL sharing type, which prefers
the last used CCB for the SA.  On a 2-DECO platform
such as the P3041, this can improve performance by
about 3.7%.
Signed-off-by: default avatarKim Phillips <kim.phillips@freescale.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 95bcaa39
...@@ -205,7 +205,7 @@ static void init_sh_desc_key_aead(u32 *desc, struct caam_ctx *ctx, ...@@ -205,7 +205,7 @@ static void init_sh_desc_key_aead(u32 *desc, struct caam_ctx *ctx,
{ {
u32 *key_jump_cmd; u32 *key_jump_cmd;
init_sh_desc(desc, HDR_SHARE_WAIT); init_sh_desc(desc, HDR_SHARE_SERIAL);
/* Skip if already shared */ /* Skip if already shared */
key_jump_cmd = append_jump(desc, JUMP_JSL | JUMP_TEST_ALL | key_jump_cmd = append_jump(desc, JUMP_JSL | JUMP_TEST_ALL |
...@@ -302,7 +302,7 @@ static int aead_set_sh_desc(struct crypto_aead *aead) ...@@ -302,7 +302,7 @@ static int aead_set_sh_desc(struct crypto_aead *aead)
desc = ctx->sh_desc_dec; desc = ctx->sh_desc_dec;
/* aead_decrypt shared descriptor */ /* aead_decrypt shared descriptor */
init_sh_desc(desc, HDR_SHARE_WAIT); init_sh_desc(desc, HDR_SHARE_SERIAL);
/* Skip if already shared */ /* Skip if already shared */
key_jump_cmd = append_jump(desc, JUMP_JSL | JUMP_TEST_ALL | key_jump_cmd = append_jump(desc, JUMP_JSL | JUMP_TEST_ALL |
...@@ -564,7 +564,7 @@ static int ablkcipher_setkey(struct crypto_ablkcipher *ablkcipher, ...@@ -564,7 +564,7 @@ static int ablkcipher_setkey(struct crypto_ablkcipher *ablkcipher,
/* ablkcipher_encrypt shared descriptor */ /* ablkcipher_encrypt shared descriptor */
desc = ctx->sh_desc_enc; desc = ctx->sh_desc_enc;
init_sh_desc(desc, HDR_SHARE_WAIT); init_sh_desc(desc, HDR_SHARE_SERIAL);
/* Skip if already shared */ /* Skip if already shared */
key_jump_cmd = append_jump(desc, JUMP_JSL | JUMP_TEST_ALL | key_jump_cmd = append_jump(desc, JUMP_JSL | JUMP_TEST_ALL |
JUMP_COND_SHRD); JUMP_COND_SHRD);
...@@ -605,7 +605,7 @@ static int ablkcipher_setkey(struct crypto_ablkcipher *ablkcipher, ...@@ -605,7 +605,7 @@ static int ablkcipher_setkey(struct crypto_ablkcipher *ablkcipher,
/* ablkcipher_decrypt shared descriptor */ /* ablkcipher_decrypt shared descriptor */
desc = ctx->sh_desc_dec; desc = ctx->sh_desc_dec;
init_sh_desc(desc, HDR_SHARE_WAIT); init_sh_desc(desc, HDR_SHARE_SERIAL);
/* Skip if already shared */ /* Skip if already shared */
key_jump_cmd = append_jump(desc, JUMP_JSL | JUMP_TEST_ALL | key_jump_cmd = append_jump(desc, JUMP_JSL | JUMP_TEST_ALL |
JUMP_COND_SHRD); JUMP_COND_SHRD);
......
...@@ -225,7 +225,7 @@ static inline void init_sh_desc_key_ahash(u32 *desc, struct caam_hash_ctx *ctx) ...@@ -225,7 +225,7 @@ static inline void init_sh_desc_key_ahash(u32 *desc, struct caam_hash_ctx *ctx)
{ {
u32 *key_jump_cmd; u32 *key_jump_cmd;
init_sh_desc(desc, HDR_SHARE_WAIT); init_sh_desc(desc, HDR_SHARE_SERIAL);
if (ctx->split_key_len) { if (ctx->split_key_len) {
/* Skip if already shared */ /* Skip if already shared */
...@@ -311,7 +311,7 @@ static int ahash_set_sh_desc(struct crypto_ahash *ahash) ...@@ -311,7 +311,7 @@ static int ahash_set_sh_desc(struct crypto_ahash *ahash)
/* ahash_update shared descriptor */ /* ahash_update shared descriptor */
desc = ctx->sh_desc_update; desc = ctx->sh_desc_update;
init_sh_desc(desc, HDR_SHARE_WAIT); init_sh_desc(desc, HDR_SHARE_SERIAL);
/* Import context from software */ /* Import context from software */
append_cmd(desc, CMD_SEQ_LOAD | LDST_SRCDST_BYTE_CONTEXT | append_cmd(desc, CMD_SEQ_LOAD | LDST_SRCDST_BYTE_CONTEXT |
......
...@@ -193,7 +193,7 @@ static inline void rng_create_sh_desc(struct caam_rng_ctx *ctx) ...@@ -193,7 +193,7 @@ static inline void rng_create_sh_desc(struct caam_rng_ctx *ctx)
struct device *jrdev = ctx->jrdev; struct device *jrdev = ctx->jrdev;
u32 *desc = ctx->sh_desc; u32 *desc = ctx->sh_desc;
init_sh_desc(desc, HDR_SHARE_WAIT); init_sh_desc(desc, HDR_SHARE_SERIAL);
/* Propagate errors from shared to job descriptor */ /* Propagate errors from shared to job descriptor */
append_cmd(desc, SET_OK_NO_PROP_ERRORS | CMD_LOAD); append_cmd(desc, SET_OK_NO_PROP_ERRORS | CMD_LOAD);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment