diff mbox series

[5/6] test/event_crypto: use device cap instead of fixed values

Message ID 20191001113339.21767-5-hemant.agrawal@nxp.com
State New
Headers show
Series [1/6] test/event_crypto: fix missing IV value for AES algo | expand

Commit Message

Hemant Agrawal Oct. 1, 2019, 11:33 a.m. UTC
Instead of hardcoded event device capabilities,
it is better to enquire and use the device supported caps.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

---
 app/test/test_event_crypto_adapter.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

-- 
2.17.1
diff mbox series

Patch

diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c
index b9e3a439e..6b10909e3 100644
--- a/app/test/test_event_crypto_adapter.c
+++ b/app/test/test_event_crypto_adapter.c
@@ -703,12 +703,11 @@  test_crypto_adapter_free(void)
 static int
 test_crypto_adapter_create(void)
 {
-	struct rte_event_port_conf conf = {
-		.dequeue_depth = 8,
-		.enqueue_depth = 8,
-		.new_event_threshold = 1200,
-	};
 	int ret;
+	struct rte_event_port_conf conf;
+
+	ret = rte_event_port_default_conf_get(TEST_CDEV_ID, 0, &conf);
+	TEST_ASSERT_SUCCESS(ret, "Failed to get port0 info");
 
 	/* Create adapter with default port creation callback */
 	ret = rte_event_crypto_adapter_create(TEST_ADAPTER_ID,
@@ -747,14 +746,12 @@  test_crypto_adapter_qp_add_del(void)
 static int
 configure_event_crypto_adapter(enum rte_event_crypto_adapter_mode mode)
 {
-	struct rte_event_port_conf conf = {
-		.dequeue_depth = 8,
-		.enqueue_depth = 8,
-		.new_event_threshold = 1200,
-	};
-
 	uint32_t cap;
 	int ret;
+	struct rte_event_port_conf conf;
+
+	ret = rte_event_port_default_conf_get(TEST_CDEV_ID, 0, &conf);
+	TEST_ASSERT_SUCCESS(ret, "Failed to get port0 info");
 
 	/* Create adapter with default port creation callback */
 	ret = rte_event_crypto_adapter_create(TEST_ADAPTER_ID,