#ifdef RTE_LIBRTE_SECURITY
static int
-security_proto_supported(enum rte_security_session_protocol proto)
+security_proto_supported(enum rte_security_session_action_type action,
+ enum rte_security_session_protocol proto)
{
struct crypto_testsuite_params *ts_params = &testsuite_params;
while ((capability = &capabilities[i++])->action !=
RTE_SECURITY_ACTION_TYPE_NONE) {
- if (capability->protocol == proto)
+ if (capability->action == action &&
+ capability->protocol == proto)
return 0;
}
/* Verify the capabilities */
struct rte_security_capability_idx sec_cap_idx;
- sec_cap_idx.action = RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL;
+ sec_cap_idx.action = ut_params->type;
sec_cap_idx.protocol = RTE_SECURITY_PROTOCOL_PDCP;
sec_cap_idx.pdcp.domain = pdcp_test_params[i].domain;
if (rte_security_capability_get(ctx, &sec_cap_idx) == NULL)
rte_pktmbuf_append(ut_params->obuf, output_vec_len);
}
- /* Set crypto type as IPSEC */
- ut_params->type = RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL;
-
/* Setup Cipher Parameters */
ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
ut_params->cipher_xform.cipher.algo = pdcp_test_params[i].cipher_alg;
}
struct rte_security_session_conf sess_conf = {
- .action_type = RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL,
+ .action_type = ut_params->type,
.protocol = RTE_SECURITY_PROTOCOL_PDCP,
{.pdcp = {
.bearer = pdcp_test_bearer[i],
/* Verify the capabilities */
struct rte_security_capability_idx sec_cap_idx;
- sec_cap_idx.action = RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL;
+ sec_cap_idx.action = ut_params->type;
sec_cap_idx.protocol = RTE_SECURITY_PROTOCOL_PDCP;
sec_cap_idx.pdcp.domain = pdcp_test_params[i].domain;
if (rte_security_capability_get(ctx, &sec_cap_idx) == NULL)
ut_params->obuf->nb_segs = segs;
}
- ut_params->type = RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL;
-
/* Setup Cipher Parameters */
ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
ut_params->cipher_xform.cipher.algo = pdcp_test_params[i].cipher_alg;
}
struct rte_security_session_conf sess_conf = {
- .action_type = RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL,
+ .action_type = ut_params->type,
.protocol = RTE_SECURITY_PROTOCOL_PDCP,
{.pdcp = {
.bearer = pdcp_test_bearer[i],
test_PDCP_PROTO_all(void)
{
struct crypto_testsuite_params *ts_params = &testsuite_params;
+ struct crypto_unittest_params *ut_params = &unittest_params;
struct rte_cryptodev_info dev_info;
int status;
if (!(feat_flags & RTE_CRYPTODEV_FF_SECURITY))
return -ENOTSUP;
- if (security_proto_supported(RTE_SECURITY_PROTOCOL_PDCP) < 0)
+ /* Set action type */
+ ut_params->type = gbl_action_type == RTE_SECURITY_ACTION_TYPE_NONE ?
+ RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL :
+ gbl_action_type;
+
+ if (security_proto_supported(ut_params->type,
+ RTE_SECURITY_PROTOCOL_PDCP) < 0)
return -ENOTSUP;
status = test_PDCP_PROTO_cplane_encap_all();
const struct rte_cryptodev_symmetric_capability *sym_cap;
int j = 0;
- sec_cap_idx.action = RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL;
+ sec_cap_idx.action = ut_params->type;
sec_cap_idx.protocol = RTE_SECURITY_PROTOCOL_DOCSIS;
sec_cap_idx.docsis.direction = RTE_SECURITY_DOCSIS_UPLINK;
memcpy(ciphertext, d_td->ciphertext.data, d_td->ciphertext.len);
- /* Set session action type */
- ut_params->type = RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL;
-
/* Setup cipher session parameters */
ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_DOCSISBPI;
const struct rte_cryptodev_symmetric_capability *sym_cap;
int j = 0;
- sec_cap_idx.action = RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL;
+ sec_cap_idx.action = ut_params->type;
sec_cap_idx.protocol = RTE_SECURITY_PROTOCOL_DOCSIS;
sec_cap_idx.docsis.direction = RTE_SECURITY_DOCSIS_DOWNLINK;
memcpy(plaintext, d_td->plaintext.data, d_td->plaintext.len);
- /* Set session action type */
- ut_params->type = RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL;
-
/* Setup cipher session parameters */
ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_DOCSISBPI;
test_DOCSIS_PROTO_all(void)
{
struct crypto_testsuite_params *ts_params = &testsuite_params;
+ struct crypto_unittest_params *ut_params = &unittest_params;
struct rte_cryptodev_info dev_info;
int status;
if (!(feat_flags & RTE_CRYPTODEV_FF_SECURITY))
return -ENOTSUP;
- if (security_proto_supported(RTE_SECURITY_PROTOCOL_DOCSIS) < 0)
+ /* Set action type */
+ ut_params->type = gbl_action_type == RTE_SECURITY_ACTION_TYPE_NONE ?
+ RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL :
+ gbl_action_type;
+
+ if (security_proto_supported(ut_params->type,
+ RTE_SECURITY_PROTOCOL_DOCSIS) < 0)
return -ENOTSUP;
status = test_DOCSIS_PROTO_uplink_all();