test/event: fix function arguments for crypto adapter
authorAnkur Dwivedi <adwivedi@marvell.com>
Thu, 8 Oct 2020 12:52:33 +0000 (18:22 +0530)
committerJerin Jacob <jerinj@marvell.com>
Thu, 15 Oct 2020 20:01:47 +0000 (22:01 +0200)
The arguments passed to rte_event_crypto_adapter_caps_get() and
rte_event_crypto_adapter_create() are incorrect.

In the rte_event_crypto_adapter_caps_get(), event device id should
be the first argument and cryptodev id should be the second argument.
In the rte_event_crypto_adapter_create(), the event device id should
be the second argument.

Fixes: 3c2c535ecfc0 ("test: add event crypto adapter auto-test")
Cc: stable@dpdk.org
Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
app/test/test_event_crypto_adapter.c

index db9d75d..37bcbec 100644 (file)
@@ -201,8 +201,8 @@ test_op_forward_mode(uint8_t session_less)
                                &cipher_xform, params.session_priv_mpool);
                TEST_ASSERT_SUCCESS(ret, "Failed to init session\n");
 
-               ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
-                                                       evdev, &cap);
+               ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID,
+                                                       &cap);
                TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
 
                if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) {
@@ -288,7 +288,7 @@ test_sessionless_with_op_forward_mode(void)
        uint32_t cap;
        int ret;
 
-       ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
+       ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap);
        TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
 
        if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
@@ -313,7 +313,7 @@ test_session_with_op_forward_mode(void)
        uint32_t cap;
        int ret;
 
-       ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
+       ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap);
        TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
 
        if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
@@ -394,8 +394,8 @@ test_op_new_mode(uint8_t session_less)
                                params.session_mpool);
                TEST_ASSERT_NOT_NULL(sess, "Session creation failed\n");
 
-               ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
-                                                       evdev, &cap);
+               ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID,
+                                                       &cap);
                TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
 
                if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) {
@@ -444,7 +444,7 @@ test_sessionless_with_op_new_mode(void)
        uint32_t cap;
        int ret;
 
-       ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
+       ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap);
        TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
 
        if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
@@ -470,7 +470,7 @@ test_session_with_op_new_mode(void)
        uint32_t cap;
        int ret;
 
-       ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
+       ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap);
        TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
 
        if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
@@ -692,7 +692,7 @@ test_crypto_adapter_create(void)
 
        /* Create adapter with default port creation callback */
        ret = rte_event_crypto_adapter_create(TEST_ADAPTER_ID,
-                                             TEST_CDEV_ID,
+                                             evdev,
                                              &conf, 0);
        TEST_ASSERT_SUCCESS(ret, "Failed to create event crypto adapter\n");
 
@@ -705,7 +705,7 @@ test_crypto_adapter_qp_add_del(void)
        uint32_t cap;
        int ret;
 
-       ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
+       ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap);
        TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
 
        if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {