From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id EC404A0562; Wed, 14 Apr 2021 14:21:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 70D01161A50; Wed, 14 Apr 2021 14:21:06 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 37567161A4E for ; Wed, 14 Apr 2021 14:21:05 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 13ECAWWo028676; Wed, 14 Apr 2021 05:21:02 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=eTbMTO8IFhv/+J6H59bjbnSrVOxyBL7w/BqgVwa5wr4=; b=PCEI1K+uRZFlOVSFzP2sk9iVOCtCNjFYFbXIxcKBIYfCyOShDz7yQXU8vNPZ1IpiWJmx EY4wyxWwW62OpJJuwted6aTyYtRh4Qp840r3F7EvYx79C9Om381DGBOGA7zDdgi6s3Ua Q394HSu9uVi9pFj9DinHwXh3HZ4ufN7hw3ctvQR9f7RCR7qhVenZMWa+FvqSXKwKZctp smDcTY1MhpMJQWlfJWvMzXHhTYg2cdXpOm9bzKMCtpeOXES3HsWL74c0gbZlx3y7Y6rz H658sWQhHQEvrhNnK6fYdW+oM8+4A6aNdJN8r8D+oJhNV88+RX6Nftx/yL+8yYTQzJsr vw== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com with ESMTP id 37wn4wsywj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 14 Apr 2021 05:21:02 -0700 Received: from SC-EXCH04.marvell.com (10.93.176.84) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 14 Apr 2021 05:21:00 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 14 Apr 2021 05:21:01 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 14 Apr 2021 05:21:00 -0700 Received: from localhost.localdomain (unknown [10.28.36.185]) by maili.marvell.com (Postfix) with ESMTP id E227C3F703F; Wed, 14 Apr 2021 05:20:55 -0700 (PDT) From: To: , , , , CC: , , , , , , , , , , , , Date: Wed, 14 Apr 2021 17:50:35 +0530 Message-ID: <20210414122036.1262579-4-gakhil@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210414122036.1262579-1-gakhil@marvell.com> References: <561328fb16b18404a30a2401c6bfb3a7f373a0f4.1618309291.git.sthotton@marvell.com> <20210414122036.1262579-1-gakhil@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: juSDZUwCSfZFzbqKnkuJ_vG251iGu68K X-Proofpoint-GUID: juSDZUwCSfZFzbqKnkuJ_vG251iGu68K X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761 definitions=2021-04-14_07:2021-04-14, 2021-04-14 signatures=0 Subject: [dpdk-dev] [PATCH v9 3/4] test/event_crypto: use crypto adapter enqueue API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Shijith Thotton Use rte_event_crypto_adapter_enqueue() API to enqueue events to crypto adapter if forward mode is supported in driver. Signed-off-by: Shijith Thotton Acked-by: Abhinandan Gujjar --- app/test/test_event_crypto_adapter.c | 33 ++++++++++++++++++---------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c index 335211cd8..f689bc1f2 100644 --- a/app/test/test_event_crypto_adapter.c +++ b/app/test/test_event_crypto_adapter.c @@ -64,6 +64,7 @@ struct event_crypto_adapter_test_params { struct rte_mempool *session_priv_mpool; struct rte_cryptodev_config *config; uint8_t crypto_event_port_id; + uint8_t internal_port_op_fwd; }; struct rte_event response_info = { @@ -110,9 +111,12 @@ send_recv_ev(struct rte_event *ev) struct rte_event recv_ev; int ret; - ret = rte_event_enqueue_burst(evdev, TEST_APP_PORT_ID, ev, NUM); - TEST_ASSERT_EQUAL(ret, NUM, - "Failed to send event to crypto adapter\n"); + if (params.internal_port_op_fwd) + ret = rte_event_crypto_adapter_enqueue(evdev, TEST_APP_PORT_ID, + ev, NUM); + else + ret = rte_event_enqueue_burst(evdev, TEST_APP_PORT_ID, ev, NUM); + TEST_ASSERT_EQUAL(ret, NUM, "Failed to send event to crypto adapter\n"); while (rte_event_dequeue_burst(evdev, TEST_APP_PORT_ID, &recv_ev, NUM, 0) == 0) @@ -747,9 +751,12 @@ configure_event_crypto_adapter(enum rte_event_crypto_adapter_mode mode) !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND)) goto adapter_create; - if ((mode == RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD) && - !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD)) - return -ENOTSUP; + if (mode == RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD) { + if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) + params.internal_port_op_fwd = 1; + else + return -ENOTSUP; + } if ((mode == RTE_EVENT_CRYPTO_ADAPTER_OP_NEW) && !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW)) @@ -771,9 +778,11 @@ configure_event_crypto_adapter(enum rte_event_crypto_adapter_mode mode) TEST_ASSERT_SUCCESS(ret, "Failed to add queue pair\n"); - ret = rte_event_crypto_adapter_event_port_get(TEST_ADAPTER_ID, - ¶ms.crypto_event_port_id); - TEST_ASSERT_SUCCESS(ret, "Failed to get event port\n"); + if (!params.internal_port_op_fwd) { + ret = rte_event_crypto_adapter_event_port_get(TEST_ADAPTER_ID, + ¶ms.crypto_event_port_id); + TEST_ASSERT_SUCCESS(ret, "Failed to get event port\n"); + } return TEST_SUCCESS; } @@ -809,15 +818,15 @@ test_crypto_adapter_conf(enum rte_event_crypto_adapter_mode mode) if (!crypto_adapter_setup_done) { ret = configure_event_crypto_adapter(mode); - if (!ret) { + if (ret) + return ret; + if (!params.internal_port_op_fwd) { qid = TEST_CRYPTO_EV_QUEUE_ID; ret = rte_event_port_link(evdev, params.crypto_event_port_id, &qid, NULL, 1); TEST_ASSERT(ret >= 0, "Failed to link queue %d " "port=%u\n", qid, params.crypto_event_port_id); - } else { - return ret; } crypto_adapter_setup_done = 1; } -- 2.25.1