Skip to content

Commit

Permalink
crypto/cnxk: update auth key size
Browse files Browse the repository at this point in the history
Update auth key size in capabilities for to support
SHA256_HMAC for cn9k.

Signed-off-by: Archana Muniganti <[email protected]>
Acked-by: Anoob Joseph <[email protected]>
Acked-by: Akhil Goyal <[email protected]>
  • Loading branch information
MunigantiArchana authored and Akhil Goyal committed Nov 4, 2021
1 parent ba62b47 commit 30351b0
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,26 @@ cn10k_sec_crypto_caps_update(struct rte_cryptodev_capabilities cnxk_caps[],
}
}

static void
cn9k_sec_crypto_caps_update(struct rte_cryptodev_capabilities cnxk_caps[])
{

struct rte_cryptodev_capabilities *caps;
int i = 0;

while ((caps = &cnxk_caps[i++])->op != RTE_CRYPTO_OP_TYPE_UNDEFINED) {
if ((caps->op == RTE_CRYPTO_OP_TYPE_SYMMETRIC) &&
(caps->sym.xform_type == RTE_CRYPTO_SYM_XFORM_AUTH) &&
(caps->sym.auth.algo == RTE_CRYPTO_AUTH_SHA256_HMAC)) {
caps->sym.auth.key_size.min = 32;
caps->sym.auth.key_size.max = 64;
caps->sym.auth.key_size.increment = 1;

break;
}
}
}

static void
sec_crypto_caps_populate(struct rte_cryptodev_capabilities cnxk_caps[],
union cpt_eng_caps *hw_caps)
Expand All @@ -962,6 +982,8 @@ sec_crypto_caps_populate(struct rte_cryptodev_capabilities cnxk_caps[],

if (roc_model_is_cn10k())
cn10k_sec_crypto_caps_update(cnxk_caps, &cur_pos);
else
cn9k_sec_crypto_caps_update(cnxk_caps);

sec_caps_add(cnxk_caps, &cur_pos, caps_end, RTE_DIM(caps_end));
}
Expand Down

0 comments on commit 30351b0

Please sign in to comment.