From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0047.outbound.protection.outlook.com [104.47.33.47]) by dpdk.org (Postfix) with ESMTP id C1FF2235 for ; Mon, 7 May 2018 07:21:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=plWGSClDlMJ0G3U4RRcQUBCKNbmiGgBfo52Y82ggPOM=; b=Iy3uDybWB+xo1OsT/KYdvwWkpCrA6d4AXZ6TdpL6o3dPtp2URNrj1I7T8RSVcP7/H3q9uqeKNJWir854MlSvtfKP71kMK9XZqaX5qlRf2UilgdvfSighnTZxHy6M3lYdogjKg7y5V3hpj/3YYcwrG7DvVAJrWLV8QaDsYJt3QMc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin (122.178.239.6) by CY1PR07MB2522.namprd07.prod.outlook.com (2a01:111:e400:c636::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.735.16; Mon, 7 May 2018 05:21:11 +0000 Date: Mon, 7 May 2018 10:50:54 +0530 From: Jerin Jacob To: Abhinandan Gujjar Cc: hemant.agrawal@nxp.com, akhil.goyal@nxp.com, dev@dpdk.org, narender.vangati@intel.com, nikhil.rao@intel.com, gage.eads@intel.com Message-ID: <20180507052053.GA25735@jerin> References: <1525546030-11204-1-git-send-email-abhinandan.gujjar@intel.com> <1525546030-11204-5-git-send-email-abhinandan.gujjar@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1525546030-11204-5-git-send-email-abhinandan.gujjar@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [122.178.239.6] X-ClientProxiedBy: MA1PR0101CA0019.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::29) To CY1PR07MB2522.namprd07.prod.outlook.com (2a01:111:e400:c636::13) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(2017052603328)(7153060)(7193020); SRVR:CY1PR07MB2522; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2522; 3:Hlhsuc+pd2+mWUQQmYHyGOUlYJVsyaLT4xxP2K6wbSULnhpFJFLAn1eTrPJ7mnU0SMNb6OAMae9tiJ3ccVWldS3SjR/Ch9UZTlXlH6LN/DNpaCehdoibfMGrhYJ4UZyfxVDcGtivXDxBw4uSc91ankJsynTxoIjFypyRch0i9NRDNjpqR9P6bDSeTkU4i+3piiAyJGK7aKUdDSrAG70C7xenyyTlT1Pu+HPfeHeulMoiDadsK6tk4kysVxfn4Kia; 25:C3wlV9FON/TO/fjUq7Do3ONG8dMQ3xTBKbRdme7rUUnoas8nwh0DW59CsSJxIQ+QGEAjrlDFVn5cR/wcHqsnuyBpZLlG17VWLG7vmhxKO0J7eEPBoXxU8IFLONwc8Jsr+fe5nlsSRYj/ywYglVLMUhYf9WlmF7fmTdmEB+Vhgu7UV7L5n1D2TAJGi3BVGSmxusokRyuBaeerc9VmG5yS9CUwhdNJkY9lLGaGWKe7HHWlW/lW8aHYgCXis86DLcW+8GW37Um001g053CfTVrNoEi1LTakVgMrDfo+ipkgAbmI2voj+XMo5inBzZIAcKf+M5S6C8t4oRr1ynFMRCVTRQ==; 31:BfgadDqhfk5h+Pv7uzgTFD6dGMQf2PK1kFqM4+qi+pcsfr/+Pxp++9kVRkkc3R15a6d3qSHN0ZaSEPd6XdtZZkUHg990VYd1BNJsps7GUZmp9Yao1paJIqa5HGTm0PkREY6hF/cEMXVChA3SMMv50S1DFl5WuHMOZ5J1srER74kAaFACM8UI5IsHGvL60e3JoY7zuuh410fuNYzoTqLxOhkjrej4Mhiw3iJXlhucBQA= X-MS-TrafficTypeDiagnostic: CY1PR07MB2522: X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2522; 20:Z8bYBpmRFCeRt6E1gbyRt1c3DGOw5K3LAePPo4l3q0hTy9xpaO3SYTFVjJP8BdA3+v9iq2kvOYG/3shiTet4PhphH0c02jTf/g0I6TpVD1miB3M7ails68yXD2u9wHA+lD+hbcwQ2jNq2BRwISE8Gl/4/cY5ZE+edQWrITDjQsPgNBMx4e2DLLawBAwO/IkQLNZ58vpotV/a+3mwDe5QizFFSbLtN7gAHItWjLy7xSitZVDJ+Agb911wHJNtZ+ODMVDRjNbvq/tSGEZapatYbLsXX7insHhHL1XcQnwycdF7JSvQJZ8eAKXaLyctSChlIHrhJOQRtbV4d3OcCXd9t3RS3P9aKOdsL+C3nT/s/xqXfvlXF0PgC15HqyEV71i1qBBOSDXGDODBwnl90dq3xwE6JMTs5MjsVMieGb7s70JlxdtT+f/Jlw3jSq2FBnE1ZD3Sps79Pd0lbkbYKW5jL5vbxihln5zDqN/0sXQV7xYTmnmhqev0iJTPsXDtTwL0AKMjS7JMfFCepvCAjocfEwLN5LWYDRdk9K+J3Urb6PKlcpp2R9wdsyn/f53UQ/y9Q6WYZw8HGK3avlwAGBIocGuvaYNAAUt0MwoRJpXbIsw= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(228905959029699); X-MS-Exchange-SenderADCheck: 0 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231254)(944501410)(52105095)(3002001)(93006095)(10201501046)(149027)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(6072148)(201708071742011); SRVR:CY1PR07MB2522; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2522; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2522; 4:dbfdT3Mu7aE3TUjLIqPOSF3IUhPdW6nxz0/HJfjAWmQlc2dD1O0TkWLUTzjAnW6xLviN8VSfsHtakGtetk/GeM3ADPYateoDfd79qsm2s1TX3ALd2axxiukDH53IyyGHAnb9FXm5CsFT6oAeySQUtVcXdK/O0ciXVCSVej2IszmG/TvPXBDKku+sNMvMH/bX044UuJ9BhszkErmIHJxhxAf0n4xna7GPb00dKMaXgY19sHcJfKQv5ePNuX7CJ/JN4iz6hWSjX283NfFteeNZlQQCiJgnzGrhjnzmeeY7KcGfzWcC/8DbltihU6YYjlO7vmMxc7Z3iqipdBsA9DO05Ifc1SmDGz2sjs9Wpi1wuLw= X-Forefront-PRVS: 066517B35B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(39380400002)(346002)(396003)(366004)(39850400004)(13464003)(199004)(189003)(6916009)(5660300001)(476003)(50466002)(478600001)(105586002)(68736007)(44832011)(4326008)(106356001)(6666003)(486006)(33656002)(97736004)(25786009)(446003)(956004)(26005)(16526019)(186003)(42882007)(305945005)(52116002)(229853002)(33716001)(66066001)(6496006)(81166006)(81156014)(3846002)(8676002)(8656006)(8936002)(47776003)(11346002)(316002)(1076002)(23726003)(2906002)(6116002)(53936002)(33896004)(5890100001)(386003)(6246003)(72206003)(9686003)(59450400001)(7736002)(16586007)(58126008)(76176011)(55016002)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR07MB2522; H:jerin; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR07MB2522; 23:2Y7g+6z5G0y9gBwCofJzN4Fi+IziirRLs9gEVuq4Y?= =?us-ascii?Q?j2oHM13B1DI/PpxRL5m59oVlQkUPvs7KFXcggHk8K+FJT7Un7G4uaHkALex4?= =?us-ascii?Q?eeFGd3wPjUJAiFscRc+vj3Y6UJLHAjCi8/e3xy8khHuEriULIPnqzOhdjHZp?= =?us-ascii?Q?Ye4+8UnmdSFn33WXr9G+hG0ievK5DHNXoUKstzhCHyb/ejMG9qcoWaSzFkg8?= =?us-ascii?Q?UkixMJ0nC1rrv0DJ/IMB12JOmgoap+BylYewWZCQ9PAQuIRhkTygc91SQMSA?= =?us-ascii?Q?4ss9MYFKkAAlYea99lrtv1f7D2NX0aleDMp0fhc6DCusV4mlFxIvDXOsnc9B?= =?us-ascii?Q?ZySpaZVSWnDrkFUML4NfZWrIDRTASlqsp89dMwSmGPPchtfF3OigLeBmlK4T?= =?us-ascii?Q?A3cKAlcuuJNhbHYJT/ADWUMgQ9BkO6tjwX69mfjcwsghXu8+s8C0buEbut1q?= =?us-ascii?Q?G1pBOIeDPQlgcQEOK59DTiqh8PMLw8N4G9oQGopW5eafW+wgapfcOD/yhKqz?= =?us-ascii?Q?MT6f1HGxAiW0v1CK/uebgFLIx/hUDP46vtlsvM+55POz49a/qBrT8AYq1aJY?= =?us-ascii?Q?/18z5JAB/BVmY6Oxpaho+HpphHbWeBmnpvrtDb7Ge0iKcsPAUEwL6Zb+iQIn?= =?us-ascii?Q?EW2hc3ZnHRVu1B9ipa/sgU8phapXoH0JSTk++0aX4SnNynpCG8ct56Vz4DtC?= =?us-ascii?Q?zh6KNZb2mhKjAJ/wOFpv2PeFzRtGtjViW/hIJtcYSBYkYYT5DRd+Z4YbBlYt?= =?us-ascii?Q?RAiRxJqiU0AFibYaDjofx9RK5vTB3ZEYC8Yo/aqW5+spaRDxzKJzKzyWL+3t?= =?us-ascii?Q?ns25fH3v4EnpLDTQcVCfjYzS5CBOT7mGRXn/xiVEyqP0KSA+dPlgHxqTCvVN?= =?us-ascii?Q?urX0nrzfdChTIHbg8yZ8KmvZrFpSIFVwggKY5Ps2LDHQQ0q3EoUkw7iK9JBl?= =?us-ascii?Q?biMjrO6ni8yY9pfnqErcjsFktNuZdW9tX//DxOVIiQIO+bhD+SziIGK/sn49?= =?us-ascii?Q?UnhJelwKBihwoefHtcK//j4HYa5NDRDdiY5nH3Y7ihBg9N/IBDsbBKRGcb3+?= =?us-ascii?Q?/q3AiozTvlN0a+mKF1S7KB/AdzNeysB7T2+tHBqErd7XX+dZhkjr6X+agbgS?= =?us-ascii?Q?4i8J+Z/IV8CvzksrB+MwIz1xBdy43uhEiW/zj16EZJ/zmtP+6KrXwHqZRs6H?= =?us-ascii?Q?zcH2waG7MUYa6xJ6YlYqN1nkC+iIw+U3VxTk7qScPSq/pytpvEYfLBeA+cwU?= =?us-ascii?Q?N54e9wU0L6LOLXf+s/2KbGIE3pCc3JwOrlMKfznp2pQByM0x94KnlD7RZAJS?= =?us-ascii?Q?WL03wfRUY1c2qr502hApGQk2mKL5y/yWaMZJ2H8vPWxWt4Nx/8Nterk9gYmj?= =?us-ascii?Q?juqsctou2X+uoTlXrNSrPKObjhJnxB/Kj6n+gNmLSS8msIC?= X-Microsoft-Antispam-Message-Info: gsZDh72mH75x5zIZK3ORVmoJP2qs9PnCc5n+faOsjcAg3YS81GGE5fLp5PQnou3+MHflJJ0HtIV1AkOymfBBMQkjhl6ReCJ7o1jlU4tSeR90S5ALMaVZNI5xeYplE7fVtXVWA0vIZd8vFqYmUQkLnVoJ+xmI0vVsxgQQmerHdQwy1w3xC39r62BzzDeENBNY X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2522; 6:N4xvEBpywpAV6kuYyE4lijnyNozpsKDIwfWWsA7ruiWf3A+7WlB9kiCPBWVTj1zA22SyGdYNScFFEXojPDSn0MoHrnoqtfrgPJ7NjmuLwvyFQ6OLAdNiPMp76W+ojfcepSvtibjbWBpwTMBi+fYIs+kaQFyMMxkE8eNvN3LTGkpibfLe7Gqi4m/YVKoX1/963YZW5sM9RycZtmV4VZVEiNlUifLX4Vk2EJvNWbjMRiTEdifL8/JKJ7c2jbcOSguHDxkRTXzIbf5n+4lCPoZcTbpESXIG0SsGjoyjsrALRKqPDgcwSsfJ8w5CFf5SV3qiUMJWym3V8IdF0oiMpoQvb8yjUOnos2dguoJnkvyf8LYMIQtoaCE+1XWNwTczjtNaQg08BTB8tX7tBfwKp+BTciK5uBRF4a1P91uxLkGLcOAg66RytcvHm/gxDDZ4U/xnwNgHJQQCCViNIL2flRpPAQ==; 5:c52kWFtVzUaTS3aosE8km3weVkoAWhj4z38ZD3dfz/8GaNd3k6hB9Xq5sCUg6a/7GS4dTjoINWjePL4pzBrm7K3jbgpEp454d/nkfZ+v72RayOmTv5Jn8UXd0XY82D9YnsqDkFXbzQUobDIzy8TokHAUHvh3MzqUyY+SVdnKDOE=; 24:5JJVaJIqEojNJmp7A9Y7K1B4dj9NH0Dwom3RoFXCvI/gd9NhFME4GGW07W5Uiuselp2z1wiGtiy2EMsnhl6CuAz8ZW4QS3Pn/H4+E8ltQIo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2522; 7:xeFgSYHW5/v9flDBpBH7YGtHrmEmm9LklznBoCgfCSwp3lirCTc1+JJDOPKCP8W5/WJfECl4+7rvxFv21odQ6ee+n8fTLmmic17l0RcKSc3MECtU+bwwOvB3Xu/Db/pFpRlMeHPctCBmEaxbi7kkisJK8qSVUIPdf3Su6YXzNwqMpXpHO3AHm7x9NBdSillaKe1sdNGGXyrYfD1waftIIgdMb/ikj+NcEWSFyB2NAQvL740F1XnCzzCutzVpiOjG X-MS-Office365-Filtering-Correlation-Id: c3bb9227-f2da-4ecb-6884-08d5b3da5a2c X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 May 2018 05:21:11.8486 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c3bb9227-f2da-4ecb-6884-08d5b3da5a2c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2522 Subject: Re: [dpdk-dev] [v3,4/5] test: add event crypto adapter auto-test X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 May 2018 05:21:17 -0000 -----Original Message----- > Date: Sun, 6 May 2018 00:17:09 +0530 > From: Abhinandan Gujjar > To: jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, > akhil.goyal@nxp.com, dev@dpdk.org > CC: narender.vangati@intel.com, abhinandan.gujjar@intel.com, > nikhil.rao@intel.com, gage.eads@intel.com > Subject: [v3,4/5] test: add event crypto adapter auto-test > X-Mailer: git-send-email 1.9.1 > > Signed-off-by: Abhinandan Gujjar > --- > MAINTAINERS | 1 + > test/test/Makefile | 1 + > test/test/test_event_crypto_adapter.c | 913 ++++++++++++++++++++++++++++++++++ > 3 files changed, 915 insertions(+) > create mode 100644 test/test/test_event_crypto_adapter.c > > diff --git a/MAINTAINERS b/MAINTAINERS > index 991b465..60ebef7 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -366,6 +366,7 @@ Eventdev Crypto Adapter API - EXPERIMENTAL > M: Abhinandan Gujjar > T: git://dpdk.org/next/dpdk-next-eventdev > F: lib/librte_eventdev/*crypto_adapter* > +F: test/test/test_event_crypto_adapter.c Shared(x86_64-native-linuxapp-gcc+shared) build fails due to test_event_crypto_adapter.o: In function `test_crypto_adapter_qp_add_del': test_event_crypto_adapter.c:(.text+0x43): undefined reference to `rte_event_crypto_adapter_caps_get' test_event_crypto_adapter.o: In function `test_crypto_adapter_conf_op_new_mode': test_event_crypto_adapter.c:(.text+0x16c): undefined reference to `rte_event_crypto_adapter_caps_get' test_event_crypto_adapter.o: In function `test_crypto_adapter_conf_op_forward_mode': test_event_crypto_adapter.c:(.text+0x138f): undefined reference to `rte_event_crypto_adapter_caps_get' test_event_crypto_adapter.o: In function `test_op_new_mode': test_event_crypto_adapter.c:(.text+0x181c): undefined reference to `rte_event_crypto_adapter_caps_get' test_event_crypto_adapter.o: In function `test_sessionless_with_op_new_mode': test_event_crypto_adapter.c:(.text+0x2111): undefined reference to `rte_event_crypto_adapter_caps_get' test_event_crypto_adapter.o:test_event_crypto_adapter.c:(.text+0x2261): more undefined references to `rte_event_crypto_adapter_caps_get' follow > > Raw device API - EXPERIMENTAL > M: Shreyansh Jain > diff --git a/test/test/Makefile b/test/test/Makefile > index 2630ab4..3a45ab2 100644 > --- a/test/test/Makefile > +++ b/test/test/Makefile > @@ -185,6 +185,7 @@ SRCS-y += test_eventdev.c > SRCS-y += test_event_ring.c > SRCS-y += test_event_eth_rx_adapter.c > SRCS-y += test_event_timer_adapter.c > +SRCS-y += test_event_crypto_adapter.c > endif > > ifeq ($(CONFIG_RTE_LIBRTE_RAWDEV),y) > diff --git a/test/test/test_event_crypto_adapter.c b/test/test/test_event_crypto_adapter.c > new file mode 100644 > index 0000000..099adcb > --- /dev/null > +++ b/test/test/test_event_crypto_adapter.c > @@ -0,0 +1,913 @@ > +static void > +test_crypto_adapter_stop(void) > +{ > + uint32_t evdev_service_id, adapter_service_id; > + > + /* retrieve service ids */ > + rte_event_dev_service_id_get(evdev, &evdev_service_id); > + rte_event_crypto_adapter_service_id_get( > + TEST_ADAPTER_ID, &adapter_service_id); > + > + /* stop services */ > + rte_service_runstate_set(evdev_service_id, 0); > + rte_service_runstate_set(adapter_service_id, 0); > + rte_service_lcore_stop(slcore_id); > + rte_service_lcore_del(slcore_id); In HW case, These service core wont be there. Right? So I think, you can check the return value of rte_event_dev_service_id_get() and decide to invoke rte_service_ runtime operations. > + rte_event_crypto_adapter_stop(TEST_ADAPTER_ID); > + rte_event_dev_stop(evdev); > +} > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(c) 2018 Intel Corporation > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include "test.h" > + > +#define PKT_TRACE 0 > +#define NUM 1 > +#define DEFAULT_NUM_XFORMS (2) > +#define NUM_MBUFS (8191) > +#define MBUF_CACHE_SIZE (256) > +#define MAXIMUM_IV_LENGTH (16) > +#define DEFAULT_NUM_OPS_INFLIGHT (128) > +#define TEST_APP_PORT_ID 0 > +#define TEST_APP_EV_QUEUE_ID 0 > +#define TEST_CRYPTO_EV_QUEUE_ID 1 > +#define TEST_ADAPTER_ID 0 > +#define TEST_CDEV_ID 0 > +#define TEST_CDEV_QP_ID 0 > +#define PACKET_LENGTH 64 > +#define NB_TEST_PORTS 1 > +#define NB_TEST_QUEUES 2 > +#define CRYPTODEV_NAME_NULL_PMD crypto_null > + > +#define MBUF_SIZE (sizeof(struct rte_mbuf) + \ > + RTE_PKTMBUF_HEADROOM + PACKET_LENGTH) > +#define IV_OFFSET (sizeof(struct rte_crypto_op) + \ > + sizeof(struct rte_crypto_sym_op) + \ > + DEFAULT_NUM_XFORMS * \ > + sizeof(struct rte_crypto_sym_xform)) > + > + > +static const uint8_t text_64B[] = { > + 0x05, 0x15, 0x77, 0x32, 0xc9, 0x66, 0x91, 0x50, > + 0x93, 0x9f, 0xbb, 0x4e, 0x2e, 0x5a, 0x02, 0xd0, > + 0x2d, 0x9d, 0x31, 0x5d, 0xc8, 0x9e, 0x86, 0x36, > + 0x54, 0x5c, 0x50, 0xe8, 0x75, 0x54, 0x74, 0x5e, > + 0xd5, 0xa2, 0x84, 0x21, 0x2d, 0xc5, 0xf8, 0x1c, > + 0x55, 0x1a, 0xba, 0x91, 0xce, 0xb5, 0xa3, 0x1e, > + 0x31, 0xbf, 0xe9, 0xa1, 0x97, 0x5c, 0x2b, 0xd6, > + 0x57, 0xa5, 0x9f, 0xab, 0xbd, 0xb0, 0x9b, 0x9c > +}; > + > +struct event_crypto_adapter_test_params { > + struct rte_mempool *mbuf_pool; > + struct rte_mempool *op_mpool; > + struct rte_mempool *session_mpool; > + struct rte_cryptodev_config *config; > + uint8_t crypto_event_port_id; > +}; > + > +struct rte_event response_info = { > + .queue_id = TEST_APP_EV_QUEUE_ID, > + .sched_type = RTE_SCHED_TYPE_ATOMIC, > + .flow_id = 0xAABB, > + .sub_event_type = 0, > + .event_type = 0, > + .priority = 0, > + .impl_opaque = 0 > +}; > + > +struct rte_event_crypto_request request_info = { > + .cdev_id = TEST_CDEV_ID, > + .queue_pair_id = TEST_CDEV_QP_ID > +}; > + > +static struct event_crypto_adapter_test_params params; > +static uint8_t crypto_adapter_setup_done; > +static uint32_t slcore_id; > +static int evdev; > + > +static struct rte_mbuf * > +alloc_fill_mbuf(struct rte_mempool *mpool, const uint8_t *data, > + size_t len, uint8_t blocksize) > +{ > + struct rte_mbuf *m = rte_pktmbuf_alloc(mpool); > + size_t t_len = len - (blocksize ? (len % blocksize) : 0); > + > + if (m) { > + char *dst = rte_pktmbuf_append(m, t_len); > + > + if (!dst) { > + rte_pktmbuf_free(m); > + return NULL; > + } > + > + rte_memcpy(dst, (const void *)data, t_len); > + } > + return m; > +} > + > +static int > +send_recv_ev(struct rte_event *ev) > +{ > + struct rte_crypto_op *op; > + 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"); > + > + while (rte_event_dequeue_burst(evdev, > + TEST_APP_PORT_ID, &recv_ev, NUM, 0) == 0) > + rte_pause(); > + > + op = recv_ev.event_ptr; > +#if PKT_TRACE > + struct rte_mbuf *m = op->sym->m_src; > + rte_pktmbuf_dump(stdout, m, rte_pktmbuf_pkt_len(m)); > +#endif > + rte_pktmbuf_free(op->sym->m_src); > + rte_crypto_op_free(op); > + > + return TEST_SUCCESS; > +} > + > +static int > +test_crypto_adapter_stats(void) > +{ > + struct rte_event_crypto_adapter_stats stats; > + > + rte_event_crypto_adapter_stats_get(TEST_ADAPTER_ID, &stats); > + printf(" +------------------------------------------------------+\n"); > + printf(" + Crypto adapter stats for instance %u:\n", TEST_ADAPTER_ID); > + printf(" + Event port poll count %lu\n", > + stats.event_poll_count); > + printf(" + Event dequeue count %lu\n", > + stats.event_deq_count); > + printf(" + Cryptodev enqueue count %lu\n", > + stats.crypto_enq_count); > + printf(" + Cryptodev enqueue failed count %lu\n", > + stats.crypto_enq_fail); > + printf(" + Cryptodev dequeue count %lu\n", > + stats.crypto_deq_count); > + printf(" + Event enqueue count %lu\n", > + stats.event_enq_count); > + printf(" + Event enqueue retry count %lu\n", > + stats.event_enq_retry_count); > + printf(" + Event enqueue fail count %lu\n", > + stats.event_enq_fail_count); > + printf(" +------------------------------------------------------+\n"); > + > + rte_event_crypto_adapter_stats_reset(TEST_ADAPTER_ID); > + return TEST_SUCCESS; > +} > + > +static int > +test_op_forward_mode(uint8_t session_less) > +{ > + struct rte_crypto_sym_xform cipher_xform; > + struct rte_cryptodev_sym_session *sess; > + union rte_event_crypto_metadata m_data; > + struct rte_crypto_sym_op *sym_op; > + struct rte_crypto_op *op; > + struct rte_mbuf *m; > + struct rte_event ev; > + uint32_t cap; > + int ret; > + > + memset(&m_data, 0, sizeof(m_data)); > + > + m = alloc_fill_mbuf(params.mbuf_pool, text_64B, PACKET_LENGTH, 0); > + TEST_ASSERT_NOT_NULL(m, "Failed to allocate mbuf!\n"); > +#if PKT_TRACE > + rte_pktmbuf_dump(stdout, m, rte_pktmbuf_pkt_len(m)); > +#endif > + /* Setup Cipher Parameters */ > + cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; > + cipher_xform.next = NULL; > + > + cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_NULL; > + cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT; > + > + op = rte_crypto_op_alloc(params.op_mpool, > + RTE_CRYPTO_OP_TYPE_SYMMETRIC); > + TEST_ASSERT_NOT_NULL(op, > + "Failed to allocate symmetric crypto operation struct\n"); > + > + sym_op = op->sym; > + > + if (!session_less) { > + sess = rte_cryptodev_sym_session_create(params.session_mpool); > + TEST_ASSERT_NOT_NULL(sess, "Session creation failed\n"); > + > + /* Create Crypto session*/ > + rte_cryptodev_sym_session_init(TEST_CDEV_ID, sess, > + &cipher_xform, params.session_mpool); > + > + ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, > + evdev, &cap); > + TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n"); > + > + if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) { > + /* Fill in private date information */ > + rte_memcpy(&m_data.response_info, &response_info, > + sizeof(response_info)); > + rte_memcpy(&m_data.request_info, &request_info, > + sizeof(request_info)); > + rte_cryptodev_sym_session_set_private_data(sess, > + &m_data, sizeof(m_data)); > + } > + > + rte_crypto_op_attach_sym_session(op, sess); > + } else { > + struct rte_crypto_sym_xform *first_xform; > + > + rte_crypto_op_sym_xforms_alloc(op, NUM); > + op->sess_type = RTE_CRYPTO_OP_SESSIONLESS; > + first_xform = &cipher_xform; > + sym_op->xform = first_xform; > + uint32_t len = IV_OFFSET + MAXIMUM_IV_LENGTH + > + (sizeof(struct rte_crypto_sym_xform) * 2); > + op->private_data_offset = len; > + /* Fill in private data information */ > + rte_memcpy(&m_data.response_info, &response_info, > + sizeof(response_info)); > + rte_memcpy(&m_data.request_info, &request_info, > + sizeof(request_info)); > + rte_memcpy((uint8_t *)op + len, &m_data, sizeof(m_data)); > + } > + > + sym_op->m_src = m; > + sym_op->cipher.data.offset = 0; > + sym_op->cipher.data.length = PACKET_LENGTH; > + > + /* Fill in event info and update event_ptr with rte_crypto_op */ > + memset(&ev, 0, sizeof(ev)); > + ev.queue_id = TEST_CRYPTO_EV_QUEUE_ID; > + ev.sched_type = RTE_SCHED_TYPE_ATOMIC; > + ev.flow_id = 0xAABB; > + ev.event_ptr = op; > + > + ret = send_recv_ev(&ev); > + TEST_ASSERT_SUCCESS(ret, "Failed to send/receive event to " > + "crypto adapter\n"); > + > + test_crypto_adapter_stats(); > + > + return TEST_SUCCESS; > +} > + > +static int > +map_adapter_service_core(void) > +{ > + uint32_t adapter_service_id; > + > + TEST_ASSERT_SUCCESS(rte_event_crypto_adapter_service_id_get( > + TEST_ADAPTER_ID, &adapter_service_id), > + "Failed to get event crypto adapter service id"); > + > + TEST_ASSERT_SUCCESS(rte_service_map_lcore_set(adapter_service_id, > + slcore_id, 1), "Failed to map adapter service"); > + > + return TEST_SUCCESS; > +} > + > +static int > +test_sessionless_with_op_forward_mode(void) > +{ > + uint32_t cap; > + int ret; > + > + ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap); > + TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n"); > + > + if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD)) > + map_adapter_service_core(); > + > + TEST_ASSERT_SUCCESS(rte_event_crypto_adapter_start(TEST_ADAPTER_ID), > + "Failed to start event crypto adapter"); > + > + ret = test_op_forward_mode(1); > + TEST_ASSERT_SUCCESS(ret, "Sessionless - ENQ-DEQ mode test failed\n"); > + return TEST_SUCCESS; > +} > + > +static int > +test_session_with_op_forward_mode(void) > +{ > + uint32_t cap; > + int ret; > + > + ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap); > + TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n"); > + > + if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD)) > + map_adapter_service_core(); > + > + TEST_ASSERT_SUCCESS(rte_event_crypto_adapter_start(TEST_ADAPTER_ID > + ), "Failed to start event crypto adapter"); > + > + ret = test_op_forward_mode(0); > + TEST_ASSERT_SUCCESS(ret, "Session based - ENQ-DEQ mode test failed\n"); > + return TEST_SUCCESS; > +} > + > +static int > +send_op_recv_ev(struct rte_crypto_op *op) > +{ > + struct rte_crypto_op *recv_op; > + struct rte_event ev; > + int ret; > + > + ret = rte_cryptodev_enqueue_burst(TEST_CDEV_ID, TEST_CDEV_QP_ID, > + &op, NUM); > + TEST_ASSERT_EQUAL(ret, NUM, "Failed to enqueue to cryptodev\n"); > + memset(&ev, 0, sizeof(ev)); > + > + while (rte_event_dequeue_burst(evdev, > + TEST_APP_PORT_ID, &ev, NUM, 0) == 0) > + rte_pause(); > + > + recv_op = ev.event_ptr; > +#if PKT_TRACE > + struct rte_mbuf *m = recv_op->sym->m_src; > + rte_pktmbuf_dump(stdout, m, rte_pktmbuf_pkt_len(m)); > +#endif > + rte_pktmbuf_free(recv_op->sym->m_src); > + rte_crypto_op_free(recv_op); > + > + return TEST_SUCCESS; > +} > + > +static int > +test_op_new_mode(uint8_t session_less) > +{ > + struct rte_crypto_sym_xform cipher_xform; > + struct rte_cryptodev_sym_session *sess; > + union rte_event_crypto_metadata m_data; > + struct rte_crypto_sym_op *sym_op; > + struct rte_crypto_op *op; > + struct rte_mbuf *m; > + uint32_t cap; > + int ret; > + > + memset(&m_data, 0, sizeof(m_data)); > + > + m = alloc_fill_mbuf(params.mbuf_pool, text_64B, PACKET_LENGTH, 0); > + TEST_ASSERT_NOT_NULL(m, "Failed to allocate mbuf!\n"); > +#if PKT_TRACE > + rte_pktmbuf_dump(stdout, m, rte_pktmbuf_pkt_len(m)); > +#endif > + /* Setup Cipher Parameters */ > + cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; > + cipher_xform.next = NULL; > + > + cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_NULL; > + cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT; > + > + op = rte_crypto_op_alloc(params.op_mpool, > + RTE_CRYPTO_OP_TYPE_SYMMETRIC); > + TEST_ASSERT_NOT_NULL(op, "Failed to allocate crypto_op!\n"); > + > + sym_op = op->sym; > + > + if (!session_less) { > + sess = rte_cryptodev_sym_session_create(params.session_mpool); > + TEST_ASSERT_NOT_NULL(sess, "Session creation failed\n"); > + > + ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, > + evdev, &cap); > + TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n"); > + > + if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) { > + /* Fill in private data information */ > + rte_memcpy(&m_data.response_info, &response_info, > + sizeof(m_data)); > + rte_cryptodev_sym_session_set_private_data(sess, > + &m_data, sizeof(m_data)); > + } > + rte_cryptodev_sym_session_init(TEST_CDEV_ID, sess, > + &cipher_xform, params.session_mpool); > + rte_crypto_op_attach_sym_session(op, sess); > + } else { > + struct rte_crypto_sym_xform *first_xform; > + > + rte_crypto_op_sym_xforms_alloc(op, NUM); > + op->sess_type = RTE_CRYPTO_OP_SESSIONLESS; > + first_xform = &cipher_xform; > + sym_op->xform = first_xform; > + uint32_t len = IV_OFFSET + MAXIMUM_IV_LENGTH + > + (sizeof(struct rte_crypto_sym_xform) * 2); > + op->private_data_offset = len; > + /* Fill in private data information */ > + rte_memcpy(&m_data.response_info, &response_info, > + sizeof(m_data)); > + rte_memcpy((uint8_t *)op + len, &m_data, sizeof(m_data)); > + } > + > + sym_op->m_src = m; > + sym_op->cipher.data.offset = 0; > + sym_op->cipher.data.length = PACKET_LENGTH; > + > + ret = send_op_recv_ev(op); > + TEST_ASSERT_SUCCESS(ret, "Failed to enqueue op to cryptodev\n"); > + > + test_crypto_adapter_stats(); > + > + return TEST_SUCCESS; > +} > + > +static int > +test_sessionless_with_op_new_mode(void) > +{ > + uint32_t cap; > + int ret; > + > + ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap); > + TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n"); > + > + if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) || > + !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW)) > + map_adapter_service_core(); > + > + /* start the event crypto adapter */ > + TEST_ASSERT_SUCCESS(rte_event_crypto_adapter_start(TEST_ADAPTER_ID), > + "Failed to start event crypto adapter"); > + > + ret = test_op_new_mode(1); > + TEST_ASSERT_SUCCESS(ret, "Sessionless - DEQ_ONLY test failed\n"); > + return TEST_SUCCESS; > +} > + > +static int > +test_session_with_op_new_mode(void) > +{ > + uint32_t cap; > + int ret; > + > + ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap); > + TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n"); > + > + if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) || > + !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW)) > + map_adapter_service_core(); > + > + TEST_ASSERT_SUCCESS(rte_event_crypto_adapter_start(TEST_ADAPTER_ID), > + "Failed to start event crypto adapter"); > + > + ret = test_op_new_mode(0); > + TEST_ASSERT_SUCCESS(ret, "Session based - DEQ_ONLY test failed\n"); > + return TEST_SUCCESS; > +} > + > +static int > +configure_cryptodev(void) > +{ > + struct rte_cryptodev_qp_conf qp_conf; > + struct rte_cryptodev_config conf; > + struct rte_cryptodev_info info; > + unsigned int session_size; > + uint8_t nb_devs; > + int ret; > + > + params.mbuf_pool = rte_pktmbuf_pool_create( > + "CRYPTO_ADAPTER_MBUFPOOL", > + NUM_MBUFS, MBUF_CACHE_SIZE, 0, MBUF_SIZE, > + rte_socket_id()); > + if (params.mbuf_pool == NULL) { > + RTE_LOG(ERR, USER1, "Can't create CRYPTO_MBUFPOOL\n"); > + return TEST_FAILED; > + } > + > + params.op_mpool = rte_crypto_op_pool_create( > + "EVENT_CRYPTO_SYM_OP_POOL", > + RTE_CRYPTO_OP_TYPE_SYMMETRIC, > + NUM_MBUFS, MBUF_CACHE_SIZE, > + DEFAULT_NUM_XFORMS * > + sizeof(struct rte_crypto_sym_xform) + > + MAXIMUM_IV_LENGTH, > + rte_socket_id()); > + if (params.op_mpool == NULL) { > + RTE_LOG(ERR, USER1, "Can't create CRYPTO_OP_POOL\n"); > + return TEST_FAILED; > + } > + > + /* Create a NULL crypto device */ > + nb_devs = rte_cryptodev_device_count_by_driver( > + rte_cryptodev_driver_id_get( > + RTE_STR(CRYPTODEV_NAME_NULL_PMD))); > + if (!nb_devs) { > + ret = rte_vdev_init( > + RTE_STR(CRYPTODEV_NAME_NULL_PMD), NULL); > + > + TEST_ASSERT(ret == 0, "Failed to create pmd:%s instance\n", > + RTE_STR(CRYPTODEV_NAME_NULL_PMD)); > + } > + > + nb_devs = rte_cryptodev_count(); > + if (!nb_devs) { > + RTE_LOG(ERR, USER1, "No crypto devices found?\n"); > + return TEST_FAILED; > + } > + > + /* > + * Create mempool with maximum number of sessions * 2, > + * to include the session headers & private data > + */ > + session_size = rte_cryptodev_get_private_session_size(TEST_CDEV_ID); > + session_size += sizeof(union rte_event_crypto_metadata); > + > + params.session_mpool = rte_mempool_create( > + "CRYPTO_ADAPTER_SESSION_MP", > + info.sym.max_nb_sessions * 2, > + session_size, > + 0, 0, NULL, NULL, NULL, > + NULL, SOCKET_ID_ANY, > + 0); > + > + TEST_ASSERT_NOT_NULL(params.session_mpool, > + "session mempool allocation failed\n"); > + > + rte_cryptodev_info_get(TEST_CDEV_ID, &info); > + conf.nb_queue_pairs = info.max_nb_queue_pairs; > + conf.socket_id = SOCKET_ID_ANY; > + > + TEST_ASSERT_SUCCESS(rte_cryptodev_configure(TEST_CDEV_ID, > + &conf), > + "Failed to configure cryptodev %u with %u qps\n", > + TEST_CDEV_ID, conf.nb_queue_pairs); > + > + qp_conf.nb_descriptors = DEFAULT_NUM_OPS_INFLIGHT; > + > + TEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup( > + TEST_CDEV_ID, TEST_CDEV_QP_ID, &qp_conf, > + rte_cryptodev_socket_id(TEST_CDEV_ID), > + params.session_mpool), > + "Failed to setup queue pair %u on cryptodev %u\n", > + TEST_CDEV_QP_ID, TEST_CDEV_ID); > + > + return TEST_SUCCESS; > +} > + > +static inline void > +evdev_set_conf_values(struct rte_event_dev_config *dev_conf, > + struct rte_event_dev_info *info) > +{ > + memset(dev_conf, 0, sizeof(struct rte_event_dev_config)); > + dev_conf->dequeue_timeout_ns = info->min_dequeue_timeout_ns; > + dev_conf->nb_event_ports = NB_TEST_PORTS; > + dev_conf->nb_event_queues = NB_TEST_QUEUES; > + dev_conf->nb_event_queue_flows = info->max_event_queue_flows; > + dev_conf->nb_event_port_dequeue_depth = > + info->max_event_port_dequeue_depth; > + dev_conf->nb_event_port_enqueue_depth = > + info->max_event_port_enqueue_depth; > + dev_conf->nb_event_port_enqueue_depth = > + info->max_event_port_enqueue_depth; > + dev_conf->nb_events_limit = > + info->max_num_events; > +} > + > +static int > +configure_eventdev(void) > +{ > + const char *eventdev_name = "event_sw0"; > + struct rte_event_queue_conf queue_conf; > + struct rte_event_dev_config devconf; > + struct rte_event_dev_info info; > + uint32_t queue_count; > + uint32_t port_count; > + int ret; > + uint8_t qid; > + > + evdev = rte_event_dev_get_dev_id(eventdev_name); > + if (evdev < 0) { > + if (rte_vdev_init(eventdev_name, NULL) < 0) { > + RTE_LOG(DEBUG, USER1, "Error creating eventdev\n"); > + return TEST_FAILED; > + } > + evdev = rte_event_dev_get_dev_id(eventdev_name); > + if (evdev < 0) { > + RTE_LOG(DEBUG, USER1, "Error finding eventdev!\n"); > + return TEST_FAILED; > + } > + } > + > + ret = rte_event_dev_info_get(evdev, &info); > + TEST_ASSERT_SUCCESS(ret, "Failed to get event dev info\n"); > + > + evdev_set_conf_values(&devconf, &info); > + > + ret = rte_event_dev_configure(evdev, &devconf); > + TEST_ASSERT_SUCCESS(ret, "Failed to configure eventdev\n"); > + > + /* Set up event queue */ > + ret = rte_event_dev_attr_get(evdev, RTE_EVENT_DEV_ATTR_QUEUE_COUNT, > + &queue_count); > + TEST_ASSERT_SUCCESS(ret, "Queue count get failed\n"); > + TEST_ASSERT_EQUAL(queue_count, 2, "Unexpected queue count\n"); > + > + qid = TEST_APP_EV_QUEUE_ID; > + ret = rte_event_queue_setup(evdev, qid, NULL); > + TEST_ASSERT_SUCCESS(ret, "Failed to setup queue=%d\n", qid); > + > + queue_conf.nb_atomic_flows = info.max_event_queue_flows; > + queue_conf.nb_atomic_order_sequences = 32; > + queue_conf.schedule_type = RTE_SCHED_TYPE_ATOMIC; > + queue_conf.priority = RTE_EVENT_DEV_PRIORITY_HIGHEST; > + queue_conf.event_queue_cfg = RTE_EVENT_QUEUE_CFG_SINGLE_LINK; > + > + qid = TEST_CRYPTO_EV_QUEUE_ID; > + ret = rte_event_queue_setup(evdev, qid, &queue_conf); > + TEST_ASSERT_SUCCESS(ret, "Failed to setup queue=%u\n", qid); > + > + /* Set up event port */ > + ret = rte_event_dev_attr_get(evdev, RTE_EVENT_DEV_ATTR_PORT_COUNT, > + &port_count); > + TEST_ASSERT_SUCCESS(ret, "Port count get failed\n"); > + TEST_ASSERT_EQUAL(port_count, 1, "Unexpected port count\n"); > + > + ret = rte_event_port_setup(evdev, TEST_APP_PORT_ID, NULL); > + TEST_ASSERT_SUCCESS(ret, "Failed to setup port=%d\n", > + TEST_APP_PORT_ID); > + > + qid = TEST_APP_EV_QUEUE_ID; > + ret = rte_event_port_link(evdev, TEST_APP_PORT_ID, &qid, NULL, 1); > + TEST_ASSERT(ret >= 0, "Failed to link queue port=%d\n", > + TEST_APP_PORT_ID); > + > + return TEST_SUCCESS; > +} > + > +static void > +test_crypto_adapter_free(void) > +{ > + rte_event_crypto_adapter_free(TEST_ADAPTER_ID); > +} > + > +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; > + > + /* Create adapter with default port creation callback */ > + ret = rte_event_crypto_adapter_create(TEST_ADAPTER_ID, > + TEST_CDEV_ID, > + &conf, 0); > + TEST_ASSERT_SUCCESS(ret, "Failed to create event crypto adapter\n"); > + > + return TEST_SUCCESS; > +} > + > +static int > +test_crypto_adapter_qp_add_del(void) > +{ > + uint32_t cap; > + int ret; > + > + ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap); > + TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n"); > + > + if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) { > + ret = rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID, > + TEST_CDEV_ID, TEST_CDEV_QP_ID, &response_info); > + } else > + ret = rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID, > + TEST_CDEV_ID, TEST_CDEV_QP_ID, NULL); > + > + TEST_ASSERT_SUCCESS(ret, "Failed to create add queue pair\n"); > + > + ret = rte_event_crypto_adapter_queue_pair_del(TEST_ADAPTER_ID, > + TEST_CDEV_ID, TEST_CDEV_QP_ID); > + TEST_ASSERT_SUCCESS(ret, "Failed to delete add queue pair\n"); > + > + return TEST_SUCCESS; > +} > + > +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; > + > + /* Create adapter with default port creation callback */ > + ret = rte_event_crypto_adapter_create(TEST_ADAPTER_ID, > + TEST_CDEV_ID, > + &conf, mode); > + TEST_ASSERT_SUCCESS(ret, "Failed to create event crypto adapter\n"); > + > + ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap); > + TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n"); > + > + if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) { > + ret = rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID, > + TEST_CDEV_ID, TEST_CDEV_QP_ID, &response_info); > + } else > + ret = rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID, > + TEST_CDEV_ID, TEST_CDEV_QP_ID, NULL); > + > + 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"); > + > + return TEST_SUCCESS; > +} > + > +