[dpdk-dev] [PATCH v4 1/5] test/crypto: add lookaside IPsec tests
Akhil Goyal
gakhil at marvell.com
Tue Sep 21 18:08:17 CEST 2021
Hi Anoob,
Few minor comments, Please see inline.
Apart from that,
Acked-by: Akhil Goyal <gakhil at marvell.com>
>
Update title as
Test/crypto: add lookaside IPsec cases.
> +static int
> +security_proto_supported(enum rte_security_session_action_type action,
> + enum rte_security_session_protocol proto);
> +
> +static int
> +dev_configure_and_start(uint64_t ff_disable);
> +
Do we really need to forward declare?
> static struct rte_mbuf *
> setup_test_string(struct rte_mempool *mpool,
> const char *string, size_t len, uint8_t blocksize)
> @@ -753,6 +763,43 @@ crypto_gen_testsuite_setup(void)
>
> #ifdef RTE_LIB_SECURITY
> static int
> +ipsec_proto_testsuite_setup(void)
> +{
> + struct crypto_testsuite_params *ts_params = &testsuite_params;
> + struct crypto_unittest_params *ut_params = &unittest_params;
> + struct rte_cryptodev_info dev_info;
> + int ret = 0;
> +
> + rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
> +
> + if (!(dev_info.feature_flags & RTE_CRYPTODEV_FF_SECURITY)) {
> + RTE_LOG(INFO, USER1, "Feature flag requirements for IPsec
> Proto "
> + "testsuite not met\n");
> + return TEST_SKIPPED;
> + }
> +
> + /* Reconfigure to enable security */
Update comment like
/*Reconfigure to enable security and disable crypto */
BTW, shouldn't this be dev_configure_and_start(0)
Why is sym and asym disabled here?
> + dev_configure_and_start(RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO
> |
> + RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO);
Return value not taken care here.
> +
> + /* Set action type */
> + ut_params->type =
> RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL;
> +
> + if (security_proto_supported(
> +
> RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL,
> + RTE_SECURITY_PROTOCOL_IPSEC) < 0) {
> + RTE_LOG(INFO, USER1, "Capability requirements for IPsec
> Proto "
> + "test not met\n");
> + ret = TEST_SKIPPED;
> + }
> +
> + /* Stop the device */
> + rte_cryptodev_stop(ts_params->valid_devs[0]);
Add a comment that the device will be started again in ut_setup_security()
> +
> + ret = test_ipsec_post_process(ut_params->ibuf, &td[i],
> + res_d_tmp, silent);
> + if (ret != TEST_SUCCESS)
> + goto crypto_op_free;
> +
> + rte_crypto_op_free(ut_params->op);
> + ut_params->op = NULL;
> +
> + rte_pktmbuf_free(ut_params->ibuf);
> + ut_params->ibuf = NULL;
> + }
> +
> +crypto_op_free:
> + rte_crypto_op_free(ut_params->op);
> + ut_params->op = NULL;
> +
> + rte_pktmbuf_free(ut_params->ibuf);
> + ut_params->ibuf = NULL;
> +
Above four lines are getting executed again in the success cases.
More information about the dev
mailing list