@@ -532,8 +532,7 @@ main(int argc, char **argv)
for (ctx.td_idx = 0; ctx.td_idx < RTE_DIM(alg_list); ctx.td_idx++) {
printf("\n\n Algorithm combination:");
- test_ipsec_display_alg(alg_list[ctx.td_idx].param1,
- alg_list[ctx.td_idx].param2);
+ test_sec_alg_display(alg_list[ctx.td_idx].param1, alg_list[ctx.td_idx].param2);
printf(" ----------------------");
printf("\n%20s%20s%20s%20s%20s%20s\n\n",
@@ -10540,8 +10540,7 @@ test_ipsec_proto_all(const struct ipsec_test_flags *flags)
return TEST_FAILED;
if (flags->display_alg)
- test_ipsec_display_alg(alg_list[i].param1,
- alg_list[i].param2);
+ test_sec_alg_display(alg_list[i].param1, alg_list[i].param2);
pass_cnt++;
}
@@ -10586,8 +10585,7 @@ test_ipsec_ah_proto_all(const struct ipsec_test_flags *flags)
return TEST_FAILED;
if (flags->display_alg)
- test_ipsec_display_alg(ah_alg_list[i].param1,
- ah_alg_list[i].param2);
+ test_sec_alg_display(ah_alg_list[i].param1, ah_alg_list[i].param2);
pass_cnt++;
}
@@ -549,32 +549,6 @@ test_ipsec_td_update(struct ipsec_test_data td_inb[],
}
}
-void
-test_ipsec_display_alg(const struct crypto_param *param1,
- const struct crypto_param *param2)
-{
- if (param1->type == RTE_CRYPTO_SYM_XFORM_AEAD) {
- printf("\t%s [%d]",
- rte_cryptodev_get_aead_algo_string(param1->alg.aead),
- param1->key_length * 8);
- } else if (param1->type == RTE_CRYPTO_SYM_XFORM_AUTH) {
- printf("\t%s",
- rte_cryptodev_get_auth_algo_string(param1->alg.auth));
- if (param1->alg.auth != RTE_CRYPTO_AUTH_NULL)
- printf(" [%dB ICV]", param1->digest_length);
- } else {
- printf("\t%s",
- rte_cryptodev_get_cipher_algo_string(param1->alg.cipher));
- if (param1->alg.cipher != RTE_CRYPTO_CIPHER_NULL)
- printf(" [%d]", param1->key_length * 8);
- printf(" %s",
- rte_cryptodev_get_auth_algo_string(param2->alg.auth));
- if (param2->alg.auth != RTE_CRYPTO_AUTH_NULL)
- printf(" [%dB ICV]", param2->digest_length);
- }
- printf("\n");
-}
-
static int
test_ipsec_tunnel_hdr_len_get(const struct ipsec_test_data *td)
{
@@ -155,9 +155,6 @@ void test_ipsec_td_update(struct ipsec_test_data td_inb[],
int nb_td,
const struct ipsec_test_flags *flags);
-void test_ipsec_display_alg(const struct crypto_param *param1,
- const struct crypto_param *param2);
-
int test_ipsec_post_process(const struct rte_mbuf *m,
const struct ipsec_test_data *td,
struct ipsec_test_data *res_d, bool silent,
@@ -1345,8 +1345,7 @@ test_ipsec_inline_proto_all(const struct ipsec_test_flags *flags)
if (ret == TEST_FAILED) {
printf("\n TEST FAILED");
- test_ipsec_display_alg(alg_list[i].param1,
- alg_list[i].param2);
+ test_sec_alg_display(alg_list[i].param1, alg_list[i].param2);
fail_cnt++;
continue;
}
@@ -1360,15 +1359,13 @@ test_ipsec_inline_proto_all(const struct ipsec_test_flags *flags)
if (ret == TEST_FAILED) {
printf("\n TEST FAILED");
- test_ipsec_display_alg(alg_list[i].param1,
- alg_list[i].param2);
+ test_sec_alg_display(alg_list[i].param1, alg_list[i].param2);
fail_cnt++;
continue;
}
if (flags->display_alg)
- test_ipsec_display_alg(alg_list[i].param1,
- alg_list[i].param2);
+ test_sec_alg_display(alg_list[i].param1, alg_list[i].param2);
pass_cnt++;
}
@@ -81,3 +81,28 @@ test_sec_crypto_caps_auth_verify(const struct rte_security_capability *sec_cap,
return -ENOTSUP;
}
+
+void
+test_sec_alg_display(const struct crypto_param *param1, const struct crypto_param *param2)
+{
+ if (param1->type == RTE_CRYPTO_SYM_XFORM_AEAD) {
+ printf("\t%s [%d]",
+ rte_cryptodev_get_aead_algo_string(param1->alg.aead),
+ param1->key_length * 8);
+ } else if (param1->type == RTE_CRYPTO_SYM_XFORM_AUTH) {
+ printf("\t%s",
+ rte_cryptodev_get_auth_algo_string(param1->alg.auth));
+ if (param1->alg.auth != RTE_CRYPTO_AUTH_NULL)
+ printf(" [%dB ICV]", param1->digest_length);
+ } else {
+ printf("\t%s",
+ rte_cryptodev_get_cipher_algo_string(param1->alg.cipher));
+ if (param1->alg.cipher != RTE_CRYPTO_CIPHER_NULL)
+ printf(" [%d]", param1->key_length * 8);
+ printf(" %s",
+ rte_cryptodev_get_auth_algo_string(param2->alg.auth));
+ if (param2->alg.auth != RTE_CRYPTO_AUTH_NULL)
+ printf(" [%dB ICV]", param2->digest_length);
+ }
+ printf("\n");
+}
@@ -141,4 +141,6 @@ int test_sec_crypto_caps_cipher_verify(const struct rte_security_capability *sec
int test_sec_crypto_caps_auth_verify(const struct rte_security_capability *sec_cap,
struct rte_crypto_sym_xform *auth);
+void test_sec_alg_display(const struct crypto_param *param1, const struct crypto_param *param2);
+
#endif