[v3] test/ipsec: fix test suite setup function

Message ID 1547741036-21329-1-git-send-email-bernard.iremonger@intel.com (mailing list archive)
State Accepted, archived
Headers
Series [v3] test/ipsec: fix test suite setup function |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS
ci/Intel-compilation fail apply issues

Commit Message

Iremonger, Bernard Jan. 17, 2019, 4:03 p.m. UTC
  Check for valid crypto_null device before continuing.
Use valid_dev instead of valid_devs[].
Replace valid_dev_count with valid_dev_found
Call create_crypto_session for one driver only.
Refactor code so that driver capabilities can be checked in
the testsuite_setup function.

Fixes: 05fe65eb66b2 ("test/ipsec: introduce functional test")
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 test/test/test_ipsec.c | 305 ++++++++++++++++++++-----------------------------
 1 file changed, 121 insertions(+), 184 deletions(-)
  

Comments

Ananyev, Konstantin Jan. 17, 2019, 5:05 p.m. UTC | #1
> -----Original Message-----
> From: Iremonger, Bernard
> Sent: Thursday, January 17, 2019 4:04 PM
> To: dev@dpdk.org; Ananyev, Konstantin <konstantin.ananyev@intel.com>
> Cc: Iremonger, Bernard <bernard.iremonger@intel.com>
> Subject: [PATCH v3] test/ipsec: fix test suite setup function
> 
> Check for valid crypto_null device before continuing.
> Use valid_dev instead of valid_devs[].
> Replace valid_dev_count with valid_dev_found
> Call create_crypto_session for one driver only.
> Refactor code so that driver capabilities can be checked in
> the testsuite_setup function.
> 
> Fixes: 05fe65eb66b2 ("test/ipsec: introduce functional test")
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> ---
> --

Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

> 2.7.4
  
Thomas Monjalon Jan. 17, 2019, 11:30 p.m. UTC | #2
> > Check for valid crypto_null device before continuing.
> > Use valid_dev instead of valid_devs[].
> > Replace valid_dev_count with valid_dev_found
> > Call create_crypto_session for one driver only.
> > Refactor code so that driver capabilities can be checked in
> > the testsuite_setup function.
> > 
> > Fixes: 05fe65eb66b2 ("test/ipsec: introduce functional test")
> > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> 
> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

Applied, thanks
  

Patch

diff --git a/test/test/test_ipsec.c b/test/test/test_ipsec.c
index ff1a1c4..777d8f7 100644
--- a/test/test/test_ipsec.c
+++ b/test/test/test_ipsec.c
@@ -62,8 +62,8 @@  struct ipsec_testsuite_params {
 	struct rte_cryptodev_config conf;
 	struct rte_cryptodev_qp_conf qp_conf;
 
-	uint8_t valid_devs[RTE_CRYPTO_MAX_DEVS];
-	uint8_t valid_dev_count;
+	uint8_t valid_dev;
+	uint8_t valid_dev_found;
 };
 
 struct ipsec_unitest_params {
@@ -213,16 +213,112 @@  find_match_auth_algo(const char *auth_keyword)
 	return NULL;
 }
 
+static void
+fill_crypto_xform(struct ipsec_unitest_params *ut_params,
+	const struct supported_auth_algo *auth_algo,
+	const struct supported_cipher_algo *cipher_algo)
+{
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+	ut_params->auth_xform.auth.algo = auth_algo->algo;
+	ut_params->auth_xform.auth.key.data = global_key;
+	ut_params->auth_xform.auth.key.length = auth_algo->key_len;
+	ut_params->auth_xform.auth.digest_length = auth_algo->digest_len;
+	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY;
+
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+	ut_params->cipher_xform.cipher.algo = cipher_algo->algo;
+	ut_params->cipher_xform.cipher.key.data = global_key;
+	ut_params->cipher_xform.cipher.key.length = cipher_algo->key_len;
+	ut_params->cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_DECRYPT;
+	ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET;
+	ut_params->cipher_xform.cipher.iv.length = cipher_algo->iv_len;
+
+	if (ut_params->ipsec_xform.direction ==
+			RTE_SECURITY_IPSEC_SA_DIR_INGRESS) {
+		ut_params->crypto_xforms = &ut_params->auth_xform;
+		ut_params->auth_xform.next = &ut_params->cipher_xform;
+		ut_params->cipher_xform.next = NULL;
+	} else {
+		ut_params->crypto_xforms = &ut_params->cipher_xform;
+		ut_params->cipher_xform.next = &ut_params->auth_xform;
+		ut_params->auth_xform.next = NULL;
+	}
+}
+
+static int
+check_cryptodev_capablity(const struct ipsec_unitest_params *ut,
+		uint8_t dev_id)
+{
+	struct rte_cryptodev_sym_capability_idx cap_idx;
+	const struct rte_cryptodev_symmetric_capability *cap;
+	int rc = -1;
+
+	cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+	cap_idx.algo.auth = ut->auth_xform.auth.algo;
+	cap = rte_cryptodev_sym_capability_get(dev_id, &cap_idx);
+
+	if (cap != NULL) {
+		rc = rte_cryptodev_sym_capability_check_auth(cap,
+				ut->auth_xform.auth.key.length,
+				ut->auth_xform.auth.digest_length, 0);
+		if (rc == 0) {
+			cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+			cap_idx.algo.cipher = ut->cipher_xform.cipher.algo;
+			cap = rte_cryptodev_sym_capability_get(
+					dev_id, &cap_idx);
+			if (cap != NULL)
+				rc = rte_cryptodev_sym_capability_check_cipher(
+					cap,
+					ut->cipher_xform.cipher.key.length,
+					ut->cipher_xform.cipher.iv.length);
+		}
+	}
+
+	return rc;
+}
+
 static int
 testsuite_setup(void)
 {
 	struct ipsec_testsuite_params *ts_params = &testsuite_params;
+	struct ipsec_unitest_params *ut_params = &unittest_params;
+	const struct supported_auth_algo *auth_algo;
+	const struct supported_cipher_algo *cipher_algo;
 	struct rte_cryptodev_info info;
-	uint32_t nb_devs, dev_id;
+	uint32_t i, nb_devs, dev_id;
 	size_t sess_sz;
+	int rc;
 
 	memset(ts_params, 0, sizeof(*ts_params));
 
+	uparams.auth = RTE_CRYPTO_SYM_XFORM_AUTH;
+	uparams.cipher = RTE_CRYPTO_SYM_XFORM_CIPHER;
+	strcpy(uparams.auth_algo, "null");
+	strcpy(uparams.cipher_algo, "null");
+
+	auth_algo = find_match_auth_algo(uparams.auth_algo);
+	cipher_algo = find_match_cipher_algo(uparams.cipher_algo);
+	fill_crypto_xform(ut_params, auth_algo, cipher_algo);
+
+	nb_devs = rte_cryptodev_count();
+	if (nb_devs < 1) {
+		RTE_LOG(ERR, USER1, "No crypto devices found?\n");
+		return TEST_FAILED;
+	}
+
+	/* Find first valid crypto device */
+	for (i = 0; i < nb_devs; i++) {
+		rc = check_cryptodev_capablity(ut_params, i);
+		if (rc == 0) {
+			ts_params->valid_dev = i;
+			ts_params->valid_dev_found = 1;
+			break;
+		}
+	}
+
+	if (ts_params->valid_dev_found == 0)
+		return TEST_FAILED;
+
 	ts_params->mbuf_pool = rte_pktmbuf_pool_create(
 			"CRYPTO_MBUFPOOL",
 			NUM_MBUFS, MBUF_CACHE_SIZE, 0, MBUF_SIZE,
@@ -245,16 +341,8 @@  testsuite_setup(void)
 		return TEST_FAILED;
 	}
 
-	nb_devs = rte_cryptodev_count();
-	if (nb_devs < 1) {
-		RTE_LOG(ERR, USER1, "No crypto devices found?\n");
-		return TEST_FAILED;
-	}
-
-	ts_params->valid_devs[ts_params->valid_dev_count++] = 0;
-
 	/* Set up all the qps on the first of the valid devices found */
-	dev_id = ts_params->valid_devs[0];
+	dev_id = ts_params->valid_dev;
 
 	rte_cryptodev_info_get(dev_id, &info);
 
@@ -353,9 +441,9 @@  ut_setup(void)
 	ts_params->conf.socket_id = SOCKET_ID_ANY;
 
 	/* Start the device */
-	TEST_ASSERT_SUCCESS(rte_cryptodev_start(ts_params->valid_devs[0]),
+	TEST_ASSERT_SUCCESS(rte_cryptodev_start(ts_params->valid_dev),
 			"Failed to start cryptodev %u",
-			ts_params->valid_devs[0]);
+			ts_params->valid_dev);
 
 	return TEST_SUCCESS;
 }
@@ -399,7 +487,7 @@  ut_teardown(void)
 			rte_mempool_avail_count(ts_params->mbuf_pool));
 
 	/* Stop the device */
-	rte_cryptodev_stop(ts_params->valid_devs[0]);
+	rte_cryptodev_stop(ts_params->valid_dev);
 }
 
 #define IPSEC_MAX_PAD_SIZE	UINT8_MAX
@@ -540,37 +628,6 @@  setup_test_string_tunneled(struct rte_mempool *mpool, const char *string,
 }
 
 static int
-check_cryptodev_capablity(const struct ipsec_unitest_params *ut,
-		uint8_t devid)
-{
-	struct rte_cryptodev_sym_capability_idx cap_idx;
-	const struct rte_cryptodev_symmetric_capability *cap;
-	int rc = -1;
-
-	cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
-	cap_idx.algo.auth = ut->auth_xform.auth.algo;
-	cap = rte_cryptodev_sym_capability_get(devid, &cap_idx);
-
-	if (cap != NULL) {
-		rc = rte_cryptodev_sym_capability_check_auth(cap,
-				ut->auth_xform.auth.key.length,
-				ut->auth_xform.auth.digest_length, 0);
-		if (rc == 0) {
-			cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
-			cap_idx.algo.cipher = ut->cipher_xform.cipher.algo;
-			cap = rte_cryptodev_sym_capability_get(devid, &cap_idx);
-			if (cap != NULL)
-				rc = rte_cryptodev_sym_capability_check_cipher(
-					cap,
-					ut->cipher_xform.cipher.key.length,
-					ut->cipher_xform.cipher.iv.length);
-		}
-	}
-
-	return rc;
-}
-
-static int
 create_dummy_sec_session(struct ipsec_unitest_params *ut,
 	struct rte_cryptodev_qp_conf *qp, uint32_t j)
 {
@@ -589,93 +646,39 @@  create_dummy_sec_session(struct ipsec_unitest_params *ut,
 
 static int
 create_crypto_session(struct ipsec_unitest_params *ut,
-	struct rte_cryptodev_qp_conf *qp, const uint8_t crypto_dev[],
-	uint32_t crypto_dev_num, uint32_t j)
+	struct rte_cryptodev_qp_conf *qp, uint8_t dev_id, uint32_t j)
 {
 	int32_t rc;
-	uint32_t devnum, i;
 	struct rte_cryptodev_sym_session *s;
-	uint8_t devid[RTE_CRYPTO_MAX_DEVS];
-
-	/* check which cryptodevs support SA */
-	devnum = 0;
-	for (i = 0; i < crypto_dev_num; i++) {
-		if (check_cryptodev_capablity(ut, crypto_dev[i]) == 0)
-			devid[devnum++] = crypto_dev[i];
-	}
-
-	if (devnum == 0)
-		return -ENODEV;
 
 	s = rte_cryptodev_sym_session_create(qp->mp_session);
 	if (s == NULL)
 		return -ENOMEM;
 
-	/* initiliaze SA crypto session for all supported devices */
-	for (i = 0; i != devnum; i++) {
-		rc = rte_cryptodev_sym_session_init(devid[i], s,
+	/* initiliaze SA crypto session for device */
+	rc = rte_cryptodev_sym_session_init(dev_id, s,
 			ut->crypto_xforms, qp->mp_session_private);
-		if (rc != 0)
-			break;
-	}
-
-	if (i == devnum) {
+	if (rc == 0) {
 		ut->ss[j].crypto.ses = s;
 		return 0;
+	} else {
+		/* failure, do cleanup */
+		rte_cryptodev_sym_session_clear(dev_id, s);
+		rte_cryptodev_sym_session_free(s);
+		return rc;
 	}
-
-	/* failure, do cleanup */
-	while (i-- != 0)
-		rte_cryptodev_sym_session_clear(devid[i], s);
-
-	rte_cryptodev_sym_session_free(s);
-	return rc;
 }
 
 static int
 create_session(struct ipsec_unitest_params *ut,
-	struct rte_cryptodev_qp_conf *qp, const uint8_t crypto_dev[],
-	uint32_t crypto_dev_num, uint32_t j)
+	struct rte_cryptodev_qp_conf *qp, uint8_t crypto_dev, uint32_t j)
 {
 	if (ut->ss[j].type == RTE_SECURITY_ACTION_TYPE_NONE)
-		return create_crypto_session(ut, qp, crypto_dev,
-			crypto_dev_num, j);
+		return create_crypto_session(ut, qp, crypto_dev, j);
 	else
 		return create_dummy_sec_session(ut, qp, j);
 }
 
-static void
-fill_crypto_xform(struct ipsec_unitest_params *ut_params,
-	const struct supported_auth_algo *auth_algo,
-	const struct supported_cipher_algo *cipher_algo)
-{
-	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
-	ut_params->auth_xform.auth.algo = auth_algo->algo;
-	ut_params->auth_xform.auth.key.data = global_key;
-	ut_params->auth_xform.auth.key.length = auth_algo->key_len;
-	ut_params->auth_xform.auth.digest_length = auth_algo->digest_len;
-	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY;
-
-	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
-	ut_params->cipher_xform.cipher.algo = cipher_algo->algo;
-	ut_params->cipher_xform.cipher.key.data = global_key;
-	ut_params->cipher_xform.cipher.key.length = cipher_algo->key_len;
-	ut_params->cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_DECRYPT;
-	ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET;
-	ut_params->cipher_xform.cipher.iv.length = cipher_algo->iv_len;
-
-	if (ut_params->ipsec_xform.direction ==
-			RTE_SECURITY_IPSEC_SA_DIR_INGRESS) {
-		ut_params->crypto_xforms = &ut_params->auth_xform;
-		ut_params->auth_xform.next = &ut_params->cipher_xform;
-		ut_params->cipher_xform.next = NULL;
-	} else {
-		ut_params->crypto_xforms = &ut_params->cipher_xform;
-		ut_params->cipher_xform.next = &ut_params->auth_xform;
-		ut_params->auth_xform.next = NULL;
-	}
-}
-
 static int
 fill_ipsec_param(uint32_t replay_win_sz, uint64_t flags)
 {
@@ -740,8 +743,7 @@  create_sa(enum rte_security_session_action_type action_type,
 		"failed to allocate memory for rte_ipsec_sa\n");
 
 	ut->ss[j].type = action_type;
-	rc = create_session(ut, &ts->qp_conf, ts->valid_devs,
-		ts->valid_dev_count, j);
+	rc = create_session(ut, &ts->qp_conf, ts->valid_dev, j);
 	if (rc != 0)
 		return TEST_FAILED;
 
@@ -768,14 +770,14 @@  crypto_ipsec(uint16_t num_pkts)
 		RTE_LOG(ERR, USER1, "rte_ipsec_pkt_crypto_prepare fail\n");
 		return TEST_FAILED;
 	}
-	k = rte_cryptodev_enqueue_burst(ts_params->valid_devs[0], 0,
+	k = rte_cryptodev_enqueue_burst(ts_params->valid_dev, 0,
 		ut_params->cop, num_pkts);
 	if (k != num_pkts) {
 		RTE_LOG(ERR, USER1, "rte_cryptodev_enqueue_burst fail\n");
 		return TEST_FAILED;
 	}
 
-	k = rte_cryptodev_dequeue_burst(ts_params->valid_devs[0], 0,
+	k = rte_cryptodev_dequeue_burst(ts_params->valid_dev, 0,
 		ut_params->cop, num_pkts);
 	if (k != num_pkts) {
 		RTE_LOG(ERR, USER1, "rte_cryptodev_dequeue_burst fail\n");
@@ -882,7 +884,7 @@  crypto_ipsec_2sa(void)
 				"rte_ipsec_pkt_crypto_prepare fail\n");
 			return TEST_FAILED;
 		}
-		k = rte_cryptodev_enqueue_burst(ts_params->valid_devs[0], 0,
+		k = rte_cryptodev_enqueue_burst(ts_params->valid_dev, 0,
 				ut_params->cop + i, 1);
 		if (k != 1) {
 			RTE_LOG(ERR, USER1,
@@ -891,7 +893,7 @@  crypto_ipsec_2sa(void)
 		}
 	}
 
-	k = rte_cryptodev_dequeue_burst(ts_params->valid_devs[0], 0,
+	k = rte_cryptodev_dequeue_burst(ts_params->valid_dev, 0,
 		ut_params->cop, BURST_SIZE);
 	if (k != BURST_SIZE) {
 		RTE_LOG(ERR, USER1, "rte_cryptodev_dequeue_burst fail\n");
@@ -1021,7 +1023,7 @@  crypto_ipsec_2sa_4grp(void)
 				"rte_ipsec_pkt_crypto_prepare fail\n");
 			return TEST_FAILED;
 		}
-		k = rte_cryptodev_enqueue_burst(ts_params->valid_devs[0], 0,
+		k = rte_cryptodev_enqueue_burst(ts_params->valid_dev, 0,
 				ut_params->cop + i, 1);
 		if (k != 1) {
 			RTE_LOG(ERR, USER1,
@@ -1030,7 +1032,7 @@  crypto_ipsec_2sa_4grp(void)
 		}
 	}
 
-	k = rte_cryptodev_dequeue_burst(ts_params->valid_devs[0], 0,
+	k = rte_cryptodev_dequeue_burst(ts_params->valid_dev, 0,
 		ut_params->cop, BURST_SIZE);
 	if (k != BURST_SIZE) {
 		RTE_LOG(ERR, USER1, "rte_cryptodev_dequeue_burst fail\n");
@@ -1188,11 +1190,6 @@  test_ipsec_crypto_inb_burst_null_null(int i)
 	uint16_t j;
 	int rc;
 
-	uparams.auth = RTE_CRYPTO_SYM_XFORM_AUTH;
-	uparams.cipher = RTE_CRYPTO_SYM_XFORM_CIPHER;
-	strcpy(uparams.auth_algo, "null");
-	strcpy(uparams.cipher_algo, "null");
-
 	/* create rte_ipsec_sa */
 	rc = create_sa(RTE_SECURITY_ACTION_TYPE_NONE,
 			test_cfg[i].replay_win_sz, test_cfg[i].flags, 0);
@@ -1296,11 +1293,6 @@  test_ipsec_crypto_outb_burst_null_null(int i)
 	uint16_t j;
 	int32_t rc;
 
-	uparams.auth = RTE_CRYPTO_SYM_XFORM_AUTH;
-	uparams.cipher = RTE_CRYPTO_SYM_XFORM_CIPHER;
-	strcpy(uparams.auth_algo, "null");
-	strcpy(uparams.cipher_algo, "null");
-
 	/* create rte_ipsec_sa*/
 	rc = create_sa(RTE_SECURITY_ACTION_TYPE_NONE,
 			test_cfg[i].replay_win_sz, test_cfg[i].flags, 0);
@@ -1411,11 +1403,6 @@  test_ipsec_inline_crypto_inb_burst_null_null(int i)
 	int32_t rc;
 	uint32_t n;
 
-	uparams.auth = RTE_CRYPTO_SYM_XFORM_AUTH;
-	uparams.cipher = RTE_CRYPTO_SYM_XFORM_CIPHER;
-	strcpy(uparams.auth_algo, "null");
-	strcpy(uparams.cipher_algo, "null");
-
 	/* create rte_ipsec_sa*/
 	rc = create_sa(RTE_SECURITY_ACTION_TYPE_INLINE_CRYPTO,
 			test_cfg[i].replay_win_sz, test_cfg[i].flags, 0);
@@ -1495,11 +1482,6 @@  test_ipsec_inline_proto_inb_burst_null_null(int i)
 	int32_t rc;
 	uint32_t n;
 
-	uparams.auth = RTE_CRYPTO_SYM_XFORM_AUTH;
-	uparams.cipher = RTE_CRYPTO_SYM_XFORM_CIPHER;
-	strcpy(uparams.auth_algo, "null");
-	strcpy(uparams.cipher_algo, "null");
-
 	/* create rte_ipsec_sa*/
 	rc = create_sa(RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL,
 			test_cfg[i].replay_win_sz, test_cfg[i].flags, 0);
@@ -1609,11 +1591,6 @@  test_ipsec_inline_crypto_outb_burst_null_null(int i)
 	int32_t rc;
 	uint32_t n;
 
-	uparams.auth = RTE_CRYPTO_SYM_XFORM_AUTH;
-	uparams.cipher = RTE_CRYPTO_SYM_XFORM_CIPHER;
-	strcpy(uparams.auth_algo, "null");
-	strcpy(uparams.cipher_algo, "null");
-
 	/* create rte_ipsec_sa */
 	rc = create_sa(RTE_SECURITY_ACTION_TYPE_INLINE_CRYPTO,
 			test_cfg[i].replay_win_sz, test_cfg[i].flags, 0);
@@ -1693,11 +1670,6 @@  test_ipsec_inline_proto_outb_burst_null_null(int i)
 	int32_t rc;
 	uint32_t n;
 
-	uparams.auth = RTE_CRYPTO_SYM_XFORM_AUTH;
-	uparams.cipher = RTE_CRYPTO_SYM_XFORM_CIPHER;
-	strcpy(uparams.auth_algo, "null");
-	strcpy(uparams.cipher_algo, "null");
-
 	/* create rte_ipsec_sa */
 	rc = create_sa(RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL,
 			test_cfg[i].replay_win_sz, test_cfg[i].flags, 0);
@@ -1775,11 +1747,6 @@  test_ipsec_lksd_proto_inb_burst_null_null(int i)
 	uint16_t j;
 	int rc;
 
-	uparams.auth = RTE_CRYPTO_SYM_XFORM_AUTH;
-	uparams.cipher = RTE_CRYPTO_SYM_XFORM_CIPHER;
-	strcpy(uparams.auth_algo, "null");
-	strcpy(uparams.cipher_algo, "null");
-
 	/* create rte_ipsec_sa */
 	rc = create_sa(RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL,
 			test_cfg[i].replay_win_sz, test_cfg[i].flags, 0);
@@ -1894,11 +1861,6 @@  test_ipsec_replay_inb_inside_null_null(int i)
 	struct ipsec_unitest_params *ut_params = &unittest_params;
 	int rc;
 
-	uparams.auth = RTE_CRYPTO_SYM_XFORM_AUTH;
-	uparams.cipher = RTE_CRYPTO_SYM_XFORM_CIPHER;
-	strcpy(uparams.auth_algo, "null");
-	strcpy(uparams.cipher_algo, "null");
-
 	/* create rte_ipsec_sa*/
 	rc = create_sa(RTE_SECURITY_ACTION_TYPE_NONE,
 			test_cfg[i].replay_win_sz, test_cfg[i].flags, 0);
@@ -1993,11 +1955,6 @@  test_ipsec_replay_inb_outside_null_null(int i)
 	struct ipsec_unitest_params *ut_params = &unittest_params;
 	int rc;
 
-	uparams.auth = RTE_CRYPTO_SYM_XFORM_AUTH;
-	uparams.cipher = RTE_CRYPTO_SYM_XFORM_CIPHER;
-	strcpy(uparams.auth_algo, "null");
-	strcpy(uparams.cipher_algo, "null");
-
 	/* create rte_ipsec_sa */
 	rc = create_sa(RTE_SECURITY_ACTION_TYPE_NONE,
 			test_cfg[i].replay_win_sz, test_cfg[i].flags, 0);
@@ -2099,11 +2056,6 @@  test_ipsec_replay_inb_repeat_null_null(int i)
 	struct ipsec_unitest_params *ut_params = &unittest_params;
 	int rc;
 
-	uparams.auth = RTE_CRYPTO_SYM_XFORM_AUTH;
-	uparams.cipher = RTE_CRYPTO_SYM_XFORM_CIPHER;
-	strcpy(uparams.auth_algo, "null");
-	strcpy(uparams.cipher_algo, "null");
-
 	/* create rte_ipsec_sa */
 	rc = create_sa(RTE_SECURITY_ACTION_TYPE_NONE,
 			test_cfg[i].replay_win_sz, test_cfg[i].flags, 0);
@@ -2205,11 +2157,6 @@  test_ipsec_replay_inb_inside_burst_null_null(int i)
 	int rc;
 	int j;
 
-	uparams.auth = RTE_CRYPTO_SYM_XFORM_AUTH;
-	uparams.cipher = RTE_CRYPTO_SYM_XFORM_CIPHER;
-	strcpy(uparams.auth_algo, "null");
-	strcpy(uparams.cipher_algo, "null");
-
 	/* create rte_ipsec_sa*/
 	rc = create_sa(RTE_SECURITY_ACTION_TYPE_NONE,
 			test_cfg[i].replay_win_sz, test_cfg[i].flags, 0);
@@ -2344,11 +2291,6 @@  test_ipsec_crypto_inb_burst_2sa_null_null(int i)
 	if (num_pkts != BURST_SIZE)
 		return rc;
 
-	uparams.auth = RTE_CRYPTO_SYM_XFORM_AUTH;
-	uparams.cipher = RTE_CRYPTO_SYM_XFORM_CIPHER;
-	strcpy(uparams.auth_algo, "null");
-	strcpy(uparams.cipher_algo, "null");
-
 	/* create rte_ipsec_sa */
 	rc = create_sa(RTE_SECURITY_ACTION_TYPE_NONE,
 			test_cfg[i].replay_win_sz, test_cfg[i].flags, 0);
@@ -2437,11 +2379,6 @@  test_ipsec_crypto_inb_burst_2sa_4grp_null_null(int i)
 	if (num_pkts != BURST_SIZE)
 		return rc;
 
-	uparams.auth = RTE_CRYPTO_SYM_XFORM_AUTH;
-	uparams.cipher = RTE_CRYPTO_SYM_XFORM_CIPHER;
-	strcpy(uparams.auth_algo, "null");
-	strcpy(uparams.cipher_algo, "null");
-
 	/* create rte_ipsec_sa */
 	rc = create_sa(RTE_SECURITY_ACTION_TYPE_NONE,
 			test_cfg[i].replay_win_sz, test_cfg[i].flags, 0);