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 B378EA04A3; Thu, 30 Dec 2021 12:56:36 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 34AFB40F35; Thu, 30 Dec 2021 12:56:36 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 3915240151 for ; Thu, 30 Dec 2021 12:56:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1640865394; x=1672401394; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=f2BALNbk/IsIAg80KQDiUeZxOkaUf8umAZQ+J3/IrGE=; b=KqWAoXWlN+54OPsCg6R4WS2VYmvnAf4uRCsT3kbZkdQo6baUFLBiLs2b EbaIU2CLkKkLV/22+t5zSA1otG2gkmXoCQazpQi7oSmLWDACHZYlDNEHD 3GbCo8RIpcRNWrKWuhevXj/a8ePBToSbQ/6K7kr3n61VcTaaZcJajnZkx V/8OikcrTTXd2iFaSdZGpASa5ULZAVyGx1b2xgNSR3uiAdxRQaOUUgFIm JY4lbXPR9h7QclnoKMzZK993Hpj2gFAuU6IGDW2MR9hMyjq8AGfV9kaiE ciacF4I8oPIa6HKPuQqIboIRIRcJXoIrRj8Gyl6tssDfr6CHIx8Qwg2Bb Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10212"; a="302413676" X-IronPort-AV: E=Sophos;i="5.88,248,1635231600"; d="scan'208";a="302413676" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Dec 2021 03:56:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,248,1635231600"; d="scan'208";a="572876126" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga008.fm.intel.com with ESMTP; 30 Dec 2021 03:56:32 -0800 Received: from fmsmsx606.amr.corp.intel.com (10.18.126.86) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Thu, 30 Dec 2021 03:56:31 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Thu, 30 Dec 2021 03:56:31 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.175) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Thu, 30 Dec 2021 03:56:31 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P/8nCukbMIOSbb2jXDFfyA/h44qVA606RtOxaDfp7MHGo1oCLHJaPfqdNhk0h7esjsRtnEKNAGReJYaEUlHBXi174HWRJ0OhxMI78zorIbc3lEll22qGUb2eIkZCllDCalp6UQVAvIE8FlCbygRtUHRzveC4pYacFJrlrizDExyQXyx0TtfQsHRrjhVCNlFwuwszz4Y3Pcl5FOzsMTZ46LBR49SncGfVlGTiPH/BtpIBvUa1HSpzHjhCrDIVOiP7PAvI0DP625NVP5s4Z+Qhle8s5dL2tIvdV7cSp82HaSReYKdzpaDn3k2Ucff6nXUuufs3RkaNrJFkfN6k5UepSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9bhp5IE1V7koslcaIWfJm649ztz71PmUDpoWAUlgPDg=; b=UNwQX5OogY8fg2vx/eon42lwJTWZcPgzTE2iIVOHpZ4cgfQic1g7cVysUted2iiMEnCYmNYFqa2eVWh6sWNOy1ijSkvcWOO3dLp7/aRWt+1EakjL8BZZQgxVQSbiGVVlypZ9t3dSb8NsM3aesvHetjpfPhwIc+Cw1yOQKQN6BB+jaZKkKR2UbYvTHwCtbcADejsutLFlARWhEQbk42BMNp1U21ctmzWE+T87xYZntd8uGNqNrzrQWJTAIVadAhzWhDak/8W1fCqZqhsTTnd/VIfoDlWMetc3pFM0p7BBq6HiRZS8IMkhS5s1HZtAtxH26mVPM635YJYOreKeYcwpww== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from PH0PR11MB4824.namprd11.prod.outlook.com (2603:10b6:510:38::13) by PH7PR11MB5915.namprd11.prod.outlook.com (2603:10b6:510:13c::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.19; Thu, 30 Dec 2021 11:56:24 +0000 Received: from PH0PR11MB4824.namprd11.prod.outlook.com ([fe80::e6:45d2:f932:b039]) by PH0PR11MB4824.namprd11.prod.outlook.com ([fe80::e6:45d2:f932:b039%9]) with mapi id 15.20.4823.023; Thu, 30 Dec 2021 11:56:24 +0000 From: "Gujjar, Abhinandan S" To: Shijith Thotton , "dev@dpdk.org" , Jerin Jacob CC: "anoobj@marvell.com" , "pbhagavatula@marvell.com" , "gakhil@marvell.com" Subject: RE: [PATCH v2] app/eventdev: add crypto producer mode Thread-Topic: [PATCH v2] app/eventdev: add crypto producer mode Thread-Index: AQHX9kf2ykAeJ0l0GEmCwOVV8O/l5qxK+0pA Date: Thu, 30 Dec 2021 11:56:24 +0000 Message-ID: References: <83932e16cff802f4701832c1798e31ec15b028f8.1640029478.git.sthotton@marvell.com> <5b7dadb222f6eb018c74983750052543eb5f0d8e.1640076426.git.sthotton@marvell.com> In-Reply-To: <5b7dadb222f6eb018c74983750052543eb5f0d8e.1640076426.git.sthotton@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.200.16 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 391303d3-873e-4846-dc24-08d9cb8b6775 x-ms-traffictypediagnostic: PH7PR11MB5915:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:15; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: SxMj7q8lEzG99+1mEqAA4QA4BsHsyGxP5Gm48sICz2t4alaM+TtaRF2k2kiQFbGlZDxSq00BiJf8BzX2tVps7cEr2+hnjf57k6Bh60QpqjdEmA/mx2RLcLjrwnquKgj8n8SRBmSDWDdTMFmxDnTQkHbv/i5G4OmbuyhNxysjWU164m5HCzdjydWrZVkDDhOMcyn8GCxaK9JuubC82Zg/u7x+Z9ggDf98BWRUjf8WRHWRrQrajJImtEGeYC8z4QhcFeDGSIwcDzxcTWsOXDaRaQrAPuhZ6TI0a0p3faq9epNYd0XSrKqUhrxp7BkS9QOnNfPtfakeA6v1ngIwulNKIUIaO9+LpWdtCaz69zg08ur7H+2ppiRAnchBFqBQUxUtWnhdWR2Wfo1cw7WBSyxD0A5U0ZPsWiZCcDtWIFUSmpvUfTvPmkOTjPf+eC2nAk7chg6vlJEgBZf46PaRv7PdgC307wMzOxVAKHFIZiDeZb7V1g4uKl2fqWM1WZeJuDzSM5Jlsd/z0aDG583fcfWuKPfeBbzEpTShxuGg6VEW49joLrSlOCt1aoExnrL/AfKp+qLWS4ymxjaifngvAanyJIuWNpUEgnZKzl8Na/XhVROnBm2B6vG+yUtNPs6RNf+flApNhb9k7MY7zuT0zAA1D7eCmDtlHS8VZTa0I8R3XTede9r+U5idYfK8Wjm0pwCYVPnedZHeXLrgq3mXxZ048ltgRB+uE6kF5ug7DjXE0lFOH27mCMiBdMtYA0kcR/BfvphZmmjlbCa4NdwQZSjJEdLExluIdVFsTMGfR3fwFR8= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB4824.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(6506007)(86362001)(76116006)(26005)(66476007)(38070700005)(7696005)(71200400001)(122000001)(8936002)(508600001)(2906002)(8676002)(966005)(110136005)(52536014)(53546011)(54906003)(55016003)(30864003)(4326008)(33656002)(83380400001)(82960400001)(316002)(66556008)(64756008)(66446008)(66946007)(186003)(38100700002)(5660300002)(9686003)(579004)(559001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?eL7WPUjO6E583cQZlL5l+kE1GraWidE71gHwvQtJeRsngnKgb6s2C6DD3l36?= =?us-ascii?Q?+nG286+osKmk/lmR3iV72OS7X0WyMTyMt6D6cKqskJd8LbmWFSa/DkumBRGQ?= =?us-ascii?Q?1I9rmSZBuq64tzGRdNnwdAnS36gbUa4ha7v4Y5HJ84antiAN+kL2RRNDJiV5?= =?us-ascii?Q?EVoH1h+GcWdg8qmUte+pdF0drQOCkQmogrO+8X7h3a4nTfSC0c1qUBm5ozQ5?= =?us-ascii?Q?wxA8T3TCsqlHg2ZN/PO9pk1/gfOmc2Cu2Xwkoxm2je0oI/OXIZ+apsLAgIRW?= =?us-ascii?Q?/4XJ8HjFThaLG6whXh8Kbfj5IsBNe1t7vzSNEtNNIwKpERF/rbHb6DRlPirE?= =?us-ascii?Q?N94y56omJKro7y6KnRMJVT7h2uUUBEoM38IYqIoah8nVBifjt50bl7AVRpkW?= =?us-ascii?Q?YMc6wTnd1wnkUZFE4mk5pHHjJSn26ZRBumDy5rlnSINUwu9r7+KHuwri1m1C?= =?us-ascii?Q?c6I49rgTRifWdB86YDtzuyHXlI2SloiYVWOdVj6i/1nTjaH5OmyjrEIsRTkL?= =?us-ascii?Q?qitCdojtaUVf96M6oN6qkgrDQ7/sET+90HhRUFv8NmT0yZRq9gqBBygAWOFV?= =?us-ascii?Q?GozIuE5fkZULx4Wnvpr+ZSxPlsFIH9DiIo+csHax1XRFbk8iuY38iED2l6ZG?= =?us-ascii?Q?pMBt+xZLFFryA18neSH0exf3lD9PaPeDUJ17vgacofBj5l2bC4VToJ4/LLnw?= =?us-ascii?Q?rtFHVDPvk+fY0uYrs9fCB0qItWzk+47/tK25CcsDSiI6+94SGa0JS3QXeGHN?= =?us-ascii?Q?o9w1YGhVBH+jZjAXffs8YTrMi3KStjY2JGP+YqDUUOwO3DPXT20yVbC3wv09?= =?us-ascii?Q?0Nyu7iMnnsaLdlaJpfnVoCnYN4Mqzsf0a3iPHjWO5zlkgRzeCdZv/OuyYJwp?= =?us-ascii?Q?WPN7htQyIfT4/RkyachojuwM5OK3HU4VtifsKfUT6+bzf8ZJwIjmP8qO24HJ?= =?us-ascii?Q?/laPNJlON7hfDRSD9oJXFyOcW3GRQXlk1dXxObgqqOz3DMpFjwQAhY3wugFm?= =?us-ascii?Q?byLp6dM8d5PcX1Pr0YRTboPf4IMpgYixUb7vmngr5x6qKSqGCs0CQvjDzzQa?= =?us-ascii?Q?JVzx3UrDkgig8yRQN3gJlGifw80UXqqEtaOoRoAJPULUPGYAz2mbpkP3P+vI?= =?us-ascii?Q?gQIziHwIj0U58fnXph/QOmTQEyvjWYY3QlPEN4Bpi7N3uwj74eimtuvFbCJK?= =?us-ascii?Q?lSt1DVRLcDDfpcX9uJOY4EwhouCzUWEEuS4UncXX1tANoo7OlAwewBw7rQQX?= =?us-ascii?Q?NebiQg/AAY3e+Zbmq0177IWxoujQtSf1RWUX/9suJp8szHM8cAmhkxigGEq/?= =?us-ascii?Q?VdP5PpT7UIpMUnhA+YzmJs3a6smF/5glTr2IHVsGB8DLndzUBC/vFIu3tuhO?= =?us-ascii?Q?QdB1/HKUO/diNGMlXGALhufr7tbx958y6L1KwLE+ak5UJx8x+o4AixRLzbMT?= =?us-ascii?Q?LcJrIWdOBnlZvKhpJ8eh/nIU3BRFnVve6LGCuj5ie8hM6QhQO1s2vpQFE2FI?= =?us-ascii?Q?eYKWfrFfoa4YgGAlVvSjKQXrRwzdIzwm2I1tVZJ7ojNh4MCKw3tvrq8L/APm?= =?us-ascii?Q?oE7Bn+6JUq/00mSEjmFjNDzwAsX8HceSGXz3kijD3NGJvoSOMPbZU3wukPo5?= =?us-ascii?Q?9CsgG3cv5n4OJcc4uZC256f+dVgTKgnvwXp3xk4LwzrinkRyMc0ftFD3fFDY?= =?us-ascii?Q?mncRdQ=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB4824.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 391303d3-873e-4846-dc24-08d9cb8b6775 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Dec 2021 11:56:24.4543 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 1Q3Zt7Qfa8J5JcK6iX5ozfO+BHKCjZOeoIuK6/GM2AHBF4WZuZGNE9zHbbnqN1cn+LIOkAQLHGAAPVWJrmiCh9GA9EPjlBron0hopgFikfo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB5915 X-OriginatorOrg: intel.com 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 Hi Shijith, > -----Original Message----- > From: Shijith Thotton > Sent: Tuesday, December 21, 2021 2:21 PM > To: dev@dpdk.org; Jerin Jacob > Cc: Shijith Thotton ; anoobj@marvell.com; > pbhagavatula@marvell.com; gakhil@marvell.com; Gujjar, Abhinandan S > > Subject: [PATCH v2] app/eventdev: add crypto producer mode >=20 > In crypto producer mode, producer core enqueues cryptodev with software > generated crypto ops and worker core dequeues crypto completion events fr= om > the eventdev. Event crypto metadata used for above processing is pre- > populated in each crypto session. >=20 > Parameter --prod_type_cryptodev can be used to enable crypto producer mod= e. > Parameter --crypto_adptr_mode can be set to select the crypto adapter mod= e, 0 > for OP_NEW and 1 for OP_FORWARD. >=20 > This mode can be used to measure the performance of crypto adapter. >=20 > Example: > ./dpdk-test-eventdev -l 0-2 -w -w -- \ > --prod_type_cryptodev --crypto_adptr_mode 1 --test=3Dperf_atq \ > --stlist=3Da --wlcores 1 --plcores 2 This patch has some perf failure as shown below. Could you please look into= this? 105300 --> performance testing fail Test environment and result as below: Ubuntu 20.04 Kernel: 4.15.0-generic Compiler: gcc 7.4 NIC: Intel Corporation Ethernet Converged Network Adapter 82599ES 10000 Mbp= s Target: x86_64-native-linuxapp-gcc Fail/Total: 0/4 Detail performance results:=20 +------------+---------+----------+-------------+--------------------------= ----+ | frame_size | txd/rxd | num_cpus | num_threads | throughput difference fr= om | | | | | | expected = | +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D+ | 64 | 512 | 1 | 1 | 0.3% = | +------------+---------+----------+-------------+--------------------------= ----+ | 64 | 2048 | 1 | 1 | -0.2% = | +------------+---------+----------+-------------+--------------------------= ----+ | 64 | 512 | 1 | 2 | 0.0% = | +------------+---------+----------+-------------+--------------------------= ----+ | 64 | 2048 | 1 | 2 | 0.3% = | +------------+---------+----------+-------------+--------------------------= ----+ Ubuntu 20.04 Kernel: 4.15.0-generic Compiler: gcc 7.4 NIC: Intel Corporation Ethernet Converged Network Adapter XL710-QDA2 40000 = Mbps Target: x86_64-native-linuxapp-gcc Fail/Total: 1/4 Detail performance results:=20 +------------+---------+----------+-------------+--------------------------= ----+ | frame_size | txd/rxd | num_cpus | num_threads | throughput difference fr= om | | | | | | expected = | +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D+ | 64 | 512 | 1 | 1 | 0.2% = | +------------+---------+----------+-------------+--------------------------= ----+ | 64 | 2048 | 1 | 1 | -0.7% = | +------------+---------+----------+-------------+--------------------------= ----+ | 64 | 512 | 1 | 2 | -1.5% = | +------------+---------+----------+-------------+--------------------------= ----+ | 64 | 2048 | 1 | 2 | -5.3% = | +------------+---------+----------+-------------+--------------------------= ----+ Ubuntu 20.04 ARM Kernel: 4.15.0-132-generic Compiler: gcc 7.5 NIC: Arm Intel Corporation Ethernet Converged Network Adapter XL710-QDA2 40= 000 Mbps Target: x86_64-native-linuxapp-gcc Fail/Total: 0/2 Detail performance results:=20 +------------+---------+----------+-------------+--------------------------= ----+ | frame_size | txd/rxd | num_cpus | num_threads | throughput difference fr= om | | | | | | expected = | +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D+ | 64 | 512 | 1 | 1 | 0.1% = | +------------+---------+----------+-------------+--------------------------= ----+ | 64 | 2048 | 1 | 1 | -0.5% = | +------------+---------+----------+-------------+--------------------------= ----+ To view detailed results, visit: https://lab.dpdk.org/results/dashboard/patchsets/20534/ >=20 > Signed-off-by: Shijith Thotton > --- > v2: > * Fix RHEL compilation warning. >=20 > app/test-eventdev/evt_common.h | 3 + > app/test-eventdev/evt_main.c | 13 +- > app/test-eventdev/evt_options.c | 27 ++ > app/test-eventdev/evt_options.h | 12 + > app/test-eventdev/evt_test.h | 6 + > app/test-eventdev/test_perf_atq.c | 51 ++++ > app/test-eventdev/test_perf_common.c | 406 ++++++++++++++++++++++++++- > app/test-eventdev/test_perf_common.h | 16 ++ app/test- > eventdev/test_perf_queue.c | 52 ++++ > doc/guides/tools/testeventdev.rst | 13 + > 10 files changed, 592 insertions(+), 7 deletions(-) >=20 > diff --git a/app/test-eventdev/evt_common.h b/app/test- > eventdev/evt_common.h index f466434459..2f301a7e79 100644 > --- a/app/test-eventdev/evt_common.h > +++ b/app/test-eventdev/evt_common.h > @@ -7,6 +7,7 @@ >=20 > #include > #include > +#include > #include > #include >=20 > @@ -39,6 +40,7 @@ enum evt_prod_type { > EVT_PROD_TYPE_SYNT, /* Producer type Synthetic i.e. CPU. */ > EVT_PROD_TYPE_ETH_RX_ADPTR, /* Producer type Eth Rx Adapter. */ > EVT_PROD_TYPE_EVENT_TIMER_ADPTR, /* Producer type Timer > Adapter. */ > + EVT_PROD_TYPE_EVENT_CRYPTO_ADPTR, /* Producer type Crypto > Adapter. */ > EVT_PROD_TYPE_MAX, > }; >=20 > @@ -77,6 +79,7 @@ struct evt_options { > uint64_t timer_tick_nsec; > uint64_t optm_timer_tick_nsec; > enum evt_prod_type prod_type; > + enum rte_event_crypto_adapter_mode crypto_adptr_mode; > }; >=20 > static inline bool > diff --git a/app/test-eventdev/evt_main.c b/app/test-eventdev/evt_main.c > index 194c980c7a..cef0fb1382 100644 > --- a/app/test-eventdev/evt_main.c > +++ b/app/test-eventdev/evt_main.c > @@ -161,12 +161,19 @@ main(int argc, char **argv) > goto mempool_destroy; > } > } > + /* Test specific cryptodev setup */ > + if (test->ops.cryptodev_setup) { > + if (test->ops.cryptodev_setup(test, &opt)) { > + evt_err("%s: cryptodev setup failed", opt.test_name); > + goto ethdev_destroy; > + } > + } >=20 > /* Test specific eventdev setup */ > if (test->ops.eventdev_setup) { > if (test->ops.eventdev_setup(test, &opt)) { > evt_err("%s: eventdev setup failed", opt.test_name); > - goto ethdev_destroy; > + goto cryptodev_destroy; > } > } >=20 > @@ -197,6 +204,10 @@ main(int argc, char **argv) > if (test->ops.eventdev_destroy) > test->ops.eventdev_destroy(test, &opt); >=20 > +cryptodev_destroy: > + if (test->ops.cryptodev_destroy) > + test->ops.cryptodev_destroy(test, &opt); > + > ethdev_destroy: > if (test->ops.ethdev_destroy) > test->ops.ethdev_destroy(test, &opt); diff --git a/app/test- > eventdev/evt_options.c b/app/test-eventdev/evt_options.c index > 753a7dbd7d..5ad1491020 100644 > --- a/app/test-eventdev/evt_options.c > +++ b/app/test-eventdev/evt_options.c > @@ -122,6 +122,26 @@ evt_parse_timer_prod_type_burst(struct evt_options > *opt, > return 0; > } >=20 > +static int > +evt_parse_crypto_prod_type(struct evt_options *opt, > + const char *arg __rte_unused) > +{ > + opt->prod_type =3D EVT_PROD_TYPE_EVENT_CRYPTO_ADPTR; > + return 0; > +} > + > +static int > +evt_parse_crypto_adptr_mode(struct evt_options *opt, const char *arg) { > + uint8_t mode; > + int ret; > + > + ret =3D parser_read_uint8(&mode, arg); > + opt->crypto_adptr_mode =3D mode ? > RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD : > + > RTE_EVENT_CRYPTO_ADAPTER_OP_NEW; > + return ret; > +} > + > static int > evt_parse_test_name(struct evt_options *opt, const char *arg) { @@ -335= ,6 > +355,7 @@ usage(char *program) > "\t--queue_priority : enable queue priority\n" > "\t--deq_tmo_nsec : global dequeue timeout\n" > "\t--prod_type_ethdev : use ethernet device as producer.\n" > + "\t--prod_type_cryptodev : use crypto device as producer.\n" > "\t--prod_type_timerdev : use event timer device as > producer.\n" > "\t expity_nsec would be the timeout\n" > "\t in ns.\n" > @@ -345,6 +366,8 @@ usage(char *program) > "\t--timer_tick_nsec : timer tick interval in ns.\n" > "\t--max_tmo_nsec : max timeout interval in ns.\n" > "\t--expiry_nsec : event timer expiry ns.\n" > + "\t--crypto_adptr_mode : 0 for OP_NEW mode (default) and\n" > + "\t 1 for OP_FORWARD mode.\n" > "\t--mbuf_sz : packet mbuf size.\n" > "\t--max_pkt_sz : max packet size.\n" > "\t--prod_enq_burst_sz : producer enqueue burst size.\n" > @@ -415,8 +438,10 @@ static struct option lgopts[] =3D { > { EVT_QUEUE_PRIORITY, 0, 0, 0 }, > { EVT_DEQ_TMO_NSEC, 1, 0, 0 }, > { EVT_PROD_ETHDEV, 0, 0, 0 }, > + { EVT_PROD_CRYPTODEV, 0, 0, 0 }, > { EVT_PROD_TIMERDEV, 0, 0, 0 }, > { EVT_PROD_TIMERDEV_BURST, 0, 0, 0 }, > + { EVT_CRYPTO_ADPTR_MODE, 1, 0, 0 }, > { EVT_NB_TIMERS, 1, 0, 0 }, > { EVT_NB_TIMER_ADPTRS, 1, 0, 0 }, > { EVT_TIMER_TICK_NSEC, 1, 0, 0 }, > @@ -455,8 +480,10 @@ evt_opts_parse_long(int opt_idx, struct evt_options > *opt) > { EVT_QUEUE_PRIORITY, evt_parse_queue_priority}, > { EVT_DEQ_TMO_NSEC, evt_parse_deq_tmo_nsec}, > { EVT_PROD_ETHDEV, evt_parse_eth_prod_type}, > + { EVT_PROD_CRYPTODEV, evt_parse_crypto_prod_type}, > { EVT_PROD_TIMERDEV, evt_parse_timer_prod_type}, > { EVT_PROD_TIMERDEV_BURST, > evt_parse_timer_prod_type_burst}, > + { EVT_CRYPTO_ADPTR_MODE, evt_parse_crypto_adptr_mode}, > { EVT_NB_TIMERS, evt_parse_nb_timers}, > { EVT_NB_TIMER_ADPTRS, evt_parse_nb_timer_adptrs}, > { EVT_TIMER_TICK_NSEC, evt_parse_timer_tick_nsec}, diff --git > a/app/test-eventdev/evt_options.h b/app/test-eventdev/evt_options.h index > 413d7092f0..2231c58801 100644 > --- a/app/test-eventdev/evt_options.h > +++ b/app/test-eventdev/evt_options.h > @@ -9,6 +9,7 @@ > #include >=20 > #include > +#include > #include > #include > #include > @@ -33,8 +34,10 @@ > #define EVT_QUEUE_PRIORITY ("queue_priority") > #define EVT_DEQ_TMO_NSEC ("deq_tmo_nsec") > #define EVT_PROD_ETHDEV ("prod_type_ethdev") > +#define EVT_PROD_CRYPTODEV ("prod_type_cryptodev") > #define EVT_PROD_TIMERDEV ("prod_type_timerdev") > #define EVT_PROD_TIMERDEV_BURST ("prod_type_timerdev_burst") > +#define EVT_CRYPTO_ADPTR_MODE ("crypto_adptr_mode") > #define EVT_NB_TIMERS ("nb_timers") > #define EVT_NB_TIMER_ADPTRS ("nb_timer_adptrs") > #define EVT_TIMER_TICK_NSEC ("timer_tick_nsec") > @@ -249,6 +252,8 @@ evt_prod_id_to_name(enum evt_prod_type prod_type) > return "Ethdev Rx Adapter"; > case EVT_PROD_TYPE_EVENT_TIMER_ADPTR: > return "Event timer adapter"; > + case EVT_PROD_TYPE_EVENT_CRYPTO_ADPTR: > + return "Event crypto adapter"; > } >=20 > return ""; > @@ -288,6 +293,13 @@ evt_dump_producer_type(struct evt_options *opt) > evt_dump("timer_tick_nsec", "%"PRIu64"", > opt->timer_tick_nsec); > break; > + case EVT_PROD_TYPE_EVENT_CRYPTO_ADPTR: > + snprintf(name, EVT_PROD_MAX_NAME_LEN, > + "Event crypto adapter producers"); > + evt_dump("crypto adapter mode", "%s", > + opt->crypto_adptr_mode ? "OP_FORWARD" : > "OP_NEW"); > + evt_dump("nb_cryptodev", "%u", rte_cryptodev_count()); > + break; > } > evt_dump("prod_type", "%s", name); > } > diff --git a/app/test-eventdev/evt_test.h b/app/test-eventdev/evt_test.h = index > f07d2c3336..50fa474ec2 100644 > --- a/app/test-eventdev/evt_test.h > +++ b/app/test-eventdev/evt_test.h > @@ -29,6 +29,8 @@ typedef int (*evt_test_mempool_setup_t) > (struct evt_test *test, struct evt_options *opt); typedef int > (*evt_test_ethdev_setup_t) > (struct evt_test *test, struct evt_options *opt); > +typedef int (*evt_test_cryptodev_setup_t) > + (struct evt_test *test, struct evt_options *opt); > typedef int (*evt_test_eventdev_setup_t) > (struct evt_test *test, struct evt_options *opt); typedef int > (*evt_test_launch_lcores_t) @@ -39,6 +41,8 @@ typedef void > (*evt_test_eventdev_destroy_t) > (struct evt_test *test, struct evt_options *opt); typedef void > (*evt_test_ethdev_destroy_t) > (struct evt_test *test, struct evt_options *opt); > +typedef void (*evt_test_cryptodev_destroy_t) > + (struct evt_test *test, struct evt_options *opt); > typedef void (*evt_test_mempool_destroy_t) > (struct evt_test *test, struct evt_options *opt); typedef void > (*evt_test_destroy_t) @@ -52,10 +56,12 @@ struct evt_test_ops { > evt_test_mempool_setup_t mempool_setup; > evt_test_ethdev_setup_t ethdev_setup; > evt_test_eventdev_setup_t eventdev_setup; > + evt_test_cryptodev_setup_t cryptodev_setup; > evt_test_launch_lcores_t launch_lcores; > evt_test_result_t test_result; > evt_test_eventdev_destroy_t eventdev_destroy; > evt_test_ethdev_destroy_t ethdev_destroy; > + evt_test_cryptodev_destroy_t cryptodev_destroy; > evt_test_mempool_destroy_t mempool_destroy; > evt_test_destroy_t test_destroy; > }; > diff --git a/app/test-eventdev/test_perf_atq.c b/app/test- > eventdev/test_perf_atq.c > index 8fd51004ee..dbb1dc8c0c 100644 > --- a/app/test-eventdev/test_perf_atq.c > +++ b/app/test-eventdev/test_perf_atq.c > @@ -48,6 +48,22 @@ perf_atq_worker(void *arg, const int > enable_fwd_latency) > continue; > } >=20 > + if (prod_crypto_type && > + (ev.event_type =3D=3D RTE_EVENT_TYPE_CRYPTODEV)) { > + struct rte_crypto_op *op =3D ev.event_ptr; > + > + if (op->status =3D=3D RTE_CRYPTO_OP_STATUS_SUCCESS) { > + if (op->sym->m_dst =3D=3D NULL) > + ev.event_ptr =3D op->sym->m_src; > + else > + ev.event_ptr =3D op->sym->m_dst; > + rte_crypto_op_free(op); > + } else { > + rte_crypto_op_free(op); > + continue; > + } > + } > + > if (enable_fwd_latency && !prod_timer_type) > /* first stage in pipeline, mark ts to compute fwd latency */ > atq_mark_fwd_latency(&ev); > @@ -87,6 +103,25 @@ perf_atq_worker_burst(void *arg, const int > enable_fwd_latency) > } >=20 > for (i =3D 0; i < nb_rx; i++) { > + if (prod_crypto_type && > + (ev[i].event_type =3D=3D RTE_EVENT_TYPE_CRYPTODEV)) > { > + struct rte_crypto_op *op =3D ev[i].event_ptr; > + > + if (op->status =3D=3D > + RTE_CRYPTO_OP_STATUS_SUCCESS) { > + if (op->sym->m_dst =3D=3D NULL) > + ev[i].event_ptr =3D > + op->sym->m_src; > + else > + ev[i].event_ptr =3D > + op->sym->m_dst; > + rte_crypto_op_free(op); > + } else { > + rte_crypto_op_free(op); > + continue; > + } > + } > + > if (enable_fwd_latency && !prod_timer_type) { > rte_prefetch0(ev[i+1].event_ptr); > /* first stage in pipeline. > @@ -254,6 +289,20 @@ perf_atq_eventdev_setup(struct evt_test *test, struc= t > evt_options *opt) > return ret; > } > } > + } else if (opt->prod_type =3D=3D EVT_PROD_TYPE_EVENT_CRYPTO_ADPTR) { > + uint8_t cdev_id, cdev_count; > + > + cdev_count =3D rte_cryptodev_count(); > + for (cdev_id =3D 0; cdev_id < cdev_count; cdev_id++) { > + ret =3D rte_cryptodev_start(cdev_id); > + if (ret) { > + evt_err("Failed to start cryptodev %u", > + cdev_id); > + return ret; > + } > + } > + > + rte_event_crypto_adapter_start(t->crypto_adptr.id); > } >=20 > return 0; > @@ -295,12 +344,14 @@ static const struct evt_test_ops perf_atq =3D { > .opt_dump =3D perf_atq_opt_dump, > .test_setup =3D perf_test_setup, > .ethdev_setup =3D perf_ethdev_setup, > + .cryptodev_setup =3D perf_cryptodev_setup, > .mempool_setup =3D perf_mempool_setup, > .eventdev_setup =3D perf_atq_eventdev_setup, > .launch_lcores =3D perf_atq_launch_lcores, > .eventdev_destroy =3D perf_eventdev_destroy, > .mempool_destroy =3D perf_mempool_destroy, > .ethdev_destroy =3D perf_ethdev_destroy, > + .cryptodev_destroy =3D perf_cryptodev_destroy, > .test_result =3D perf_test_result, > .test_destroy =3D perf_test_destroy, > }; > diff --git a/app/test-eventdev/test_perf_common.c b/app/test- > eventdev/test_perf_common.c > index 9b73874151..7b964ab8dc 100644 > --- a/app/test-eventdev/test_perf_common.c > +++ b/app/test-eventdev/test_perf_common.c > @@ -6,6 +6,8 @@ >=20 > #include "test_perf_common.h" >=20 > +#define NB_CRYPTODEV_DESCRIPTORS 128 > + > int > perf_test_result(struct evt_test *test, struct evt_options *opt) { @@ -= 272,6 > +274,121 @@ perf_event_timer_producer_burst(void *arg) > return 0; > } >=20 > +static inline void > +crypto_adapter_enq_op_new(struct prod_data *p) { > + struct test_perf *t =3D p->t; > + const uint32_t nb_flows =3D t->nb_flows; > + const uint64_t nb_pkts =3D t->nb_pkts; > + struct rte_mempool *pool =3D t->pool; > + struct rte_crypto_sym_op *sym_op; > + struct evt_options *opt =3D t->opt; > + uint32_t flow_counter =3D 0; > + struct rte_crypto_op *op; > + struct rte_mbuf *m; > + uint64_t count =3D 0; > + uint16_t len; > + > + if (opt->verbose_level > 1) > + printf("%s(): lcore %d queue %d cdev_id %u cdev_qp_id %u\n", > + __func__, rte_lcore_id(), p->queue_id, p->cdev_id, > + p->cdev_qp_id); > + > + len =3D opt->mbuf_sz ? opt->mbuf_sz : RTE_ETHER_MIN_LEN; > + > + while (count < nb_pkts && t->done =3D=3D false) { > + m =3D rte_pktmbuf_alloc(pool); > + if (m =3D=3D NULL) > + continue; > + > + rte_pktmbuf_append(m, len); > + op =3D rte_crypto_op_alloc(t->crypto_adptr.op_pool, > + RTE_CRYPTO_OP_TYPE_SYMMETRIC); > + sym_op =3D op->sym; > + sym_op->m_src =3D m; > + sym_op->cipher.data.offset =3D 0; > + sym_op->cipher.data.length =3D len; > + rte_crypto_op_attach_sym_session( > + op, p->crypto_sess[flow_counter++ % nb_flows]); > + while (rte_cryptodev_enqueue_burst(p->cdev_id, p- > >cdev_qp_id, > + &op, 1) !=3D 1) { > + if (t->done) > + break; > + rte_pause(); > + } > + count++; > + } > +} > + > +static inline void > +crypto_adapter_enq_op_fwd(struct prod_data *p) { > + const uint8_t dev_id =3D p->dev_id; > + const uint8_t port =3D p->port_id; > + struct test_perf *t =3D p->t; > + const uint32_t nb_flows =3D t->nb_flows; > + const uint64_t nb_pkts =3D t->nb_pkts; > + struct rte_mempool *pool =3D t->pool; > + struct evt_options *opt =3D t->opt; > + struct rte_crypto_sym_op *sym_op; > + uint32_t flow_counter =3D 0; > + struct rte_crypto_op *op; > + struct rte_event ev; > + struct rte_mbuf *m; > + uint64_t count =3D 0; > + uint16_t len; > + > + if (opt->verbose_level > 1) > + printf("%s(): lcore %d port %d queue %d cdev_id %u cdev_qp_id > %u\n", > + __func__, rte_lcore_id(), port, p->queue_id, p->cdev_id, > + p->cdev_qp_id); > + > + ev.event =3D 0; > + ev.op =3D RTE_EVENT_OP_NEW; > + ev.queue_id =3D p->queue_id; > + ev.sched_type =3D RTE_SCHED_TYPE_ATOMIC; > + ev.event_type =3D RTE_EVENT_TYPE_CPU; > + len =3D opt->mbuf_sz ? opt->mbuf_sz : RTE_ETHER_MIN_LEN; > + > + while (count < nb_pkts && t->done =3D=3D false) { > + m =3D rte_pktmbuf_alloc(pool); > + if (m =3D=3D NULL) > + continue; > + > + rte_pktmbuf_append(m, len); > + op =3D rte_crypto_op_alloc(t->crypto_adptr.op_pool, > + RTE_CRYPTO_OP_TYPE_SYMMETRIC); > + sym_op =3D op->sym; > + sym_op->m_src =3D m; > + sym_op->cipher.data.offset =3D 0; > + sym_op->cipher.data.length =3D len; > + rte_crypto_op_attach_sym_session( > + op, p->crypto_sess[flow_counter++ % nb_flows]); > + ev.event_ptr =3D op; > + while (rte_event_crypto_adapter_enqueue(dev_id, port, &ev, 1) > !=3D > + 1) { > + if (t->done) > + break; > + rte_pause(); > + } > + count++; > + } > +} > + > +static inline int > +perf_event_crypto_producer(void *arg) > +{ > + struct prod_data *p =3D arg; > + struct evt_options *opt =3D p->t->opt; > + > + if (opt->crypto_adptr_mode =3D=3D > RTE_EVENT_CRYPTO_ADAPTER_OP_NEW) > + crypto_adapter_enq_op_new(p); > + else > + crypto_adapter_enq_op_fwd(p); > + > + return 0; > +} > + > static int > perf_producer_wrapper(void *arg) > { > @@ -298,6 +415,8 @@ perf_producer_wrapper(void *arg) > else if (t->opt->prod_type =3D=3D EVT_PROD_TYPE_EVENT_TIMER_ADPTR > && > t->opt->timdev_use_burst) > return perf_event_timer_producer_burst(arg); > + else if (t->opt->prod_type =3D=3D EVT_PROD_TYPE_EVENT_CRYPTO_ADPTR) > + return perf_event_crypto_producer(arg); > return 0; > } >=20 > @@ -405,8 +524,10 @@ perf_launch_lcores(struct evt_test *test, struct > evt_options *opt, > if (remaining <=3D 0) { > t->result =3D EVT_TEST_SUCCESS; > if (opt->prod_type =3D=3D EVT_PROD_TYPE_SYNT > || > - opt->prod_type =3D=3D > - > EVT_PROD_TYPE_EVENT_TIMER_ADPTR) { > + opt->prod_type =3D=3D > + > EVT_PROD_TYPE_EVENT_TIMER_ADPTR || > + opt->prod_type =3D=3D > + > EVT_PROD_TYPE_EVENT_CRYPTO_ADPTR) { > t->done =3D true; > break; > } > @@ -415,7 +536,8 @@ perf_launch_lcores(struct evt_test *test, struct > evt_options *opt, >=20 > if (new_cycles - dead_lock_cycles > dead_lock_sample && > (opt->prod_type =3D=3D EVT_PROD_TYPE_SYNT || > - opt->prod_type =3D=3D EVT_PROD_TYPE_EVENT_TIMER_ADPTR)) > { > + opt->prod_type =3D=3D EVT_PROD_TYPE_EVENT_TIMER_ADPTR > || > + opt->prod_type =3D=3D > EVT_PROD_TYPE_EVENT_CRYPTO_ADPTR)) { > remaining =3D t->outstand_pkts - processed_pkts(t); > if (dead_lock_remaining =3D=3D remaining) { > rte_event_dev_dump(opt->dev_id, stdout); > @@ -537,6 +659,96 @@ perf_event_timer_adapter_setup(struct test_perf *t) > return 0; > } >=20 > +static int > +perf_event_crypto_adapter_setup(struct test_perf *t, > + struct rte_event_port_conf port_conf) { > + struct evt_options *opt =3D t->opt; > + uint8_t cdev_id, cdev_count; > + int ret; > + > + t->crypto_adptr.id =3D 0; > + ret =3D rte_event_crypto_adapter_create(t->crypto_adptr.id, opt->dev_id= , > + &port_conf, 0); > + if (ret) > + return ret; > + > + cdev_count =3D rte_cryptodev_count(); > + for (cdev_id =3D 0; cdev_id < cdev_count; cdev_id++) { > + uint32_t cap; > + > + ret =3D rte_event_crypto_adapter_caps_get(opt->dev_id, > cdev_id, > + &cap); > + if (ret) { > + evt_err("Failed to get crypto adapter capabilities"); > + return ret; > + } > + > + if (((opt->crypto_adptr_mode =3D=3D > + RTE_EVENT_CRYPTO_ADAPTER_OP_NEW) && > + !(cap & > + > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW)) || > + ((opt->crypto_adptr_mode =3D=3D > + RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD) && > + !(cap & > + > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD))) { > + evt_err("crypto adapter %s mode unsupported\n", > + opt->crypto_adptr_mode ? "OP_FORWARD" : > + "OP_NEW"); > + return -EINVAL; > + } > + > + if (!(cap & > + > RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA)) { > + evt_err("Storing crypto session not supported"); > + return -EINVAL; > + } > + > + if (cap & > + > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) { > + struct rte_event response_info; > + > + response_info.event =3D 0; > + ret =3D rte_event_crypto_adapter_queue_pair_add( > + t->crypto_adptr.id, cdev_id, -1, > + &response_info); > + } else { > + ret =3D rte_event_crypto_adapter_queue_pair_add( > + t->crypto_adptr.id, cdev_id, -1, NULL); > + } > + if (ret) > + return ret; > + } > + > + return 0; > +} > + > +static struct rte_cryptodev_sym_session * > +cryptodev_session_create(struct prod_data *p, struct test_perf *t) { > + struct rte_crypto_sym_xform cipher_xform; > + struct rte_cryptodev_sym_session *sess; > + > + cipher_xform.type =3D RTE_CRYPTO_SYM_XFORM_CIPHER; > + cipher_xform.cipher.algo =3D RTE_CRYPTO_CIPHER_NULL; > + cipher_xform.cipher.op =3D RTE_CRYPTO_CIPHER_OP_ENCRYPT; > + cipher_xform.next =3D NULL; > + > + sess =3D rte_cryptodev_sym_session_create(t->crypto_adptr.sess_pool); > + if (sess =3D=3D NULL) { > + evt_err("Failed to create sym session"); > + return NULL; > + } > + > + if (rte_cryptodev_sym_session_init(p->cdev_id, sess, &cipher_xform, > + t->crypto_adptr.sess_priv_pool)) { > + evt_err("Failed to init session"); > + return NULL; > + } > + > + return sess; > +} > + > int > perf_event_dev_port_setup(struct evt_test *test, struct evt_options *opt= , > uint8_t stride, uint8_t nb_queues, > @@ -598,6 +810,55 @@ perf_event_dev_port_setup(struct evt_test *test, > struct evt_options *opt, > ret =3D perf_event_timer_adapter_setup(t); > if (ret) > return ret; > + } else if (opt->prod_type =3D=3D EVT_PROD_TYPE_EVENT_CRYPTO_ADPTR) { > + uint8_t cdev_id =3D 0; > + uint16_t qp_id =3D 0; > + > + prod =3D 0; > + for (; port < perf_nb_event_ports(opt); port++) { > + struct rte_cryptodev_sym_session *crypto_sess; > + union rte_event_crypto_metadata m_data; > + struct prod_data *p =3D &t->prod[port]; > + uint32_t flow_id; > + > + if (qp_id =3D=3D rte_cryptodev_queue_pair_count(cdev_id)) > { > + cdev_id++; > + qp_id =3D 0; > + } > + > + p->dev_id =3D opt->dev_id; > + p->port_id =3D port; > + p->queue_id =3D prod * stride; > + p->cdev_id =3D cdev_id; > + p->cdev_qp_id =3D qp_id; > + p->crypto_sess =3D rte_zmalloc_socket( > + NULL, sizeof(crypto_sess) * t->nb_flows, > + RTE_CACHE_LINE_SIZE, opt->socket_id); > + > + m_data.request_info.cdev_id =3D p->cdev_id; > + m_data.request_info.queue_pair_id =3D p->cdev_qp_id; > + m_data.response_info.op =3D RTE_EVENT_OP_NEW; > + m_data.response_info.sched_type =3D > RTE_SCHED_TYPE_ATOMIC; > + m_data.response_info.event_type =3D > RTE_EVENT_TYPE_CPU; > + m_data.response_info.queue_id =3D p->queue_id; > + for (flow_id =3D 0; flow_id < t->nb_flows; flow_id++) { > + crypto_sess =3D cryptodev_session_create(p, t); > + if (crypto_sess =3D=3D NULL) > + return -ENOMEM; > + > + m_data.response_info.flow_id =3D flow_id; > + rte_cryptodev_sym_session_set_user_data( > + crypto_sess, &m_data, > sizeof(m_data)); > + p->crypto_sess[flow_id] =3D crypto_sess; > + } > + p->t =3D t; > + qp_id++; > + prod++; > + } > + > + ret =3D perf_event_crypto_adapter_setup(t, *port_conf); > + if (ret) > + return ret; > } else { > prod =3D 0; > for ( ; port < perf_nb_event_ports(opt); port++) { @@ -659,7 > +920,8 @@ perf_opt_check(struct evt_options *opt, uint64_t nb_queues) > } >=20 > if (opt->prod_type =3D=3D EVT_PROD_TYPE_SYNT || > - opt->prod_type =3D=3D > EVT_PROD_TYPE_EVENT_TIMER_ADPTR) { > + opt->prod_type =3D=3D EVT_PROD_TYPE_EVENT_TIMER_ADPTR || > + opt->prod_type =3D=3D EVT_PROD_TYPE_EVENT_CRYPTO_ADPTR) { > /* Validate producer lcores */ > if (evt_lcores_has_overlap(opt->plcores, > rte_get_main_lcore())) { > @@ -767,8 +1029,7 @@ perf_ethdev_setup(struct evt_test *test, struct > evt_options *opt) > }, > }; >=20 > - if (opt->prod_type =3D=3D EVT_PROD_TYPE_SYNT || > - opt->prod_type =3D=3D > EVT_PROD_TYPE_EVENT_TIMER_ADPTR) > + if (opt->prod_type !=3D EVT_PROD_TYPE_ETH_RX_ADPTR) > return 0; >=20 > if (!rte_eth_dev_count_avail()) { > @@ -841,6 +1102,139 @@ void perf_ethdev_destroy(struct evt_test *test, > struct evt_options *opt) > } > } >=20 > +int > +perf_cryptodev_setup(struct evt_test *test, struct evt_options *opt) { > + uint8_t cdev_count, cdev_id, nb_plcores, nb_qps; > + struct test_perf *t =3D evt_test_priv(test); > + unsigned int max_session_size; > + uint32_t nb_sessions; > + int ret; > + > + if (opt->prod_type !=3D EVT_PROD_TYPE_EVENT_CRYPTO_ADPTR) > + return 0; > + > + cdev_count =3D rte_cryptodev_count(); > + if (cdev_count =3D=3D 0) { > + evt_err("No crypto devices available\n"); > + return -ENODEV; > + } > + > + t->crypto_adptr.op_pool =3D rte_crypto_op_pool_create( > + "crypto_op_pool", RTE_CRYPTO_OP_TYPE_SYMMETRIC, opt- > >pool_sz, > + 128, 0, rte_socket_id()); > + if (t->crypto_adptr.op_pool =3D=3D NULL) { > + evt_err("Failed to create crypto op pool"); > + return -ENOMEM; > + } > + > + nb_sessions =3D evt_nr_active_lcores(opt->plcores) * t->nb_flows; > + t->crypto_adptr.sess_pool =3D rte_cryptodev_sym_session_pool_create( > + "ca_sess_pool", nb_sessions, 0, 0, > + sizeof(union rte_event_crypto_metadata), SOCKET_ID_ANY); > + if (t->crypto_adptr.sess_pool =3D=3D NULL) { > + evt_err("Failed to create sym session pool"); > + ret =3D -ENOMEM; > + goto err; > + } > + > + max_session_size =3D 0; > + for (cdev_id =3D 0; cdev_id < cdev_count; cdev_id++) { > + unsigned int session_size; > + > + session_size =3D > + rte_cryptodev_sym_get_private_session_size(cdev_id); > + if (session_size > max_session_size) > + max_session_size =3D session_size; > + } > + max_session_size +=3D sizeof(union rte_event_crypto_metadata); > + t->crypto_adptr.sess_priv_pool =3D rte_mempool_create( > + "ca_sess_priv_pool", nb_sessions, max_session_size, 0, 0, > NULL, > + NULL, NULL, NULL, SOCKET_ID_ANY, 0); > + if (t->crypto_adptr.sess_priv_pool =3D=3D NULL) { > + evt_err("failed to create sym session private pool"); > + ret =3D -ENOMEM; > + goto err; > + } > + > + nb_plcores =3D evt_nr_active_lcores(opt->plcores); > + nb_qps =3D (nb_plcores % cdev_count) ? (nb_plcores / cdev_count) + 1 : > + nb_plcores / cdev_count; > + for (cdev_id =3D 0; cdev_id < cdev_count; cdev_id++) { > + struct rte_cryptodev_qp_conf qp_conf; > + struct rte_cryptodev_config conf; > + struct rte_cryptodev_info info; > + int qp_id; > + > + rte_cryptodev_info_get(cdev_id, &info); > + if (nb_qps > info.max_nb_queue_pairs) { > + evt_err("Not enough queue pairs per cryptodev (%u)", > + nb_qps); > + ret =3D -EINVAL; > + goto err; > + } > + > + conf.nb_queue_pairs =3D nb_qps; > + conf.socket_id =3D SOCKET_ID_ANY; > + conf.ff_disable =3D RTE_CRYPTODEV_FF_SECURITY; > + > + ret =3D rte_cryptodev_configure(cdev_id, &conf); > + if (ret) { > + evt_err("Failed to configure cryptodev (%u)", cdev_id); > + goto err; > + } > + > + qp_conf.nb_descriptors =3D NB_CRYPTODEV_DESCRIPTORS; > + qp_conf.mp_session =3D t->crypto_adptr.sess_pool; > + qp_conf.mp_session_private =3D t->crypto_adptr.sess_priv_pool; > + > + for (qp_id =3D 0; qp_id < conf.nb_queue_pairs; qp_id++) { > + ret =3D rte_cryptodev_queue_pair_setup( > + cdev_id, qp_id, &qp_conf, > + rte_cryptodev_socket_id(cdev_id)); > + if (ret) { > + evt_err("Failed to setup queue pairs on > cryptodev %u\n", > + cdev_id); > + goto err; > + } > + } > + } > + > + return 0; > +err: > + rte_mempool_free(t->crypto_adptr.op_pool); > + rte_mempool_free(t->crypto_adptr.sess_pool); > + rte_mempool_free(t->crypto_adptr.sess_priv_pool); > + > + return ret; > +} > + > +void > +perf_cryptodev_destroy(struct evt_test *test, struct evt_options *opt) > +{ > + uint8_t cdev_id, cdev_count =3D rte_cryptodev_count(); > + struct test_perf *t =3D evt_test_priv(test); > + > + RTE_SET_USED(opt); > + > + if (opt->prod_type !=3D EVT_PROD_TYPE_EVENT_CRYPTO_ADPTR) > + return; > + > + rte_event_crypto_adapter_stop(t->crypto_adptr.id); > + > + for (cdev_id =3D 0; cdev_id < cdev_count; cdev_id++) { > + rte_cryptodev_stop(cdev_id); > + rte_event_crypto_adapter_queue_pair_del(t->crypto_adptr.id, > + cdev_id, -1); > + } > + > + rte_event_crypto_adapter_free(t->crypto_adptr.id); > + > + rte_mempool_free(t->crypto_adptr.op_pool); > + rte_mempool_free(t->crypto_adptr.sess_pool); > + rte_mempool_free(t->crypto_adptr.sess_priv_pool); > +} > + > int > perf_mempool_setup(struct evt_test *test, struct evt_options *opt) { di= ff --git > a/app/test-eventdev/test_perf_common.h b/app/test- > eventdev/test_perf_common.h > index 14dcf80429..d9ad3a0b0d 100644 > --- a/app/test-eventdev/test_perf_common.h > +++ b/app/test-eventdev/test_perf_common.h > @@ -9,9 +9,11 @@ > #include > #include >=20 > +#include > #include > #include > #include > +#include > #include > #include > #include > @@ -37,9 +39,18 @@ struct prod_data { > uint8_t dev_id; > uint8_t port_id; > uint8_t queue_id; > + uint8_t cdev_id; > + uint16_t cdev_qp_id; > + struct rte_cryptodev_sym_session **crypto_sess; > struct test_perf *t; > } __rte_cache_aligned; >=20 > +struct crypto_adptr_data { > + uint8_t id; > + struct rte_mempool *op_pool; > + struct rte_mempool *sess_pool; > + struct rte_mempool *sess_priv_pool; > +}; >=20 > struct test_perf { > /* Don't change the offset of "done". Signal handler use this memory > @@ -58,6 +69,7 @@ struct test_perf { > uint8_t sched_type_list[EVT_MAX_STAGES] __rte_cache_aligned; > struct rte_event_timer_adapter *timer_adptr[ > RTE_EVENT_TIMER_ADAPTER_NUM_MAX] > __rte_cache_aligned; > + struct crypto_adptr_data crypto_adptr; > } __rte_cache_aligned; >=20 > struct perf_elt { > @@ -81,6 +93,8 @@ struct perf_elt { > const uint8_t port =3D w->port_id;\ > const uint8_t prod_timer_type =3D \ > opt->prod_type =3D=3D EVT_PROD_TYPE_EVENT_TIMER_ADPTR;\ > + const uint8_t prod_crypto_type =3D \ > + opt->prod_type =3D=3D EVT_PROD_TYPE_EVENT_CRYPTO_ADPTR;\ > uint8_t *const sched_type_list =3D &t->sched_type_list[0];\ > struct rte_mempool *const pool =3D t->pool;\ > const uint8_t nb_stages =3D t->opt->nb_stages;\ @@ -154,6 +168,7 @@ > int perf_test_result(struct evt_test *test, struct evt_options *opt); in= t > perf_opt_check(struct evt_options *opt, uint64_t nb_queues); int > perf_test_setup(struct evt_test *test, struct evt_options *opt); int > perf_ethdev_setup(struct evt_test *test, struct evt_options *opt); > +int perf_cryptodev_setup(struct evt_test *test, struct evt_options > +*opt); > int perf_mempool_setup(struct evt_test *test, struct evt_options *opt); = int > perf_event_dev_port_setup(struct evt_test *test, struct evt_options *opt, > uint8_t stride, uint8_t nb_queues, > @@ -164,6 +179,7 @@ int perf_launch_lcores(struct evt_test *test, struct > evt_options *opt, void perf_opt_dump(struct evt_options *opt, uint8_t > nb_queues); void perf_test_destroy(struct evt_test *test, struct evt_opt= ions > *opt); void perf_eventdev_destroy(struct evt_test *test, struct evt_opti= ons > *opt); > +void perf_cryptodev_destroy(struct evt_test *test, struct evt_options > +*opt); > void perf_ethdev_destroy(struct evt_test *test, struct evt_options *opt)= ; void > perf_mempool_destroy(struct evt_test *test, struct evt_options *opt); >=20 > diff --git a/app/test-eventdev/test_perf_queue.c b/app/test- > eventdev/test_perf_queue.c > index f4ea3a795f..5657c8b3cd 100644 > --- a/app/test-eventdev/test_perf_queue.c > +++ b/app/test-eventdev/test_perf_queue.c > @@ -49,6 +49,23 @@ perf_queue_worker(void *arg, const int > enable_fwd_latency) > rte_pause(); > continue; > } > + > + if (prod_crypto_type && > + (ev.event_type =3D=3D RTE_EVENT_TYPE_CRYPTODEV)) { > + struct rte_crypto_op *op =3D ev.event_ptr; > + > + if (op->status =3D=3D RTE_CRYPTO_OP_STATUS_SUCCESS) { > + if (op->sym->m_dst =3D=3D NULL) > + ev.event_ptr =3D op->sym->m_src; > + else > + ev.event_ptr =3D op->sym->m_dst; > + rte_crypto_op_free(op); > + } else { > + rte_crypto_op_free(op); > + continue; > + } > + } > + > if (enable_fwd_latency && !prod_timer_type) > /* first q in pipeline, mark timestamp to compute fwd latency */ > mark_fwd_latency(&ev, nb_stages); > @@ -88,6 +105,25 @@ perf_queue_worker_burst(void *arg, const int > enable_fwd_latency) > } >=20 > for (i =3D 0; i < nb_rx; i++) { > + if (prod_crypto_type && > + (ev[i].event_type =3D=3D RTE_EVENT_TYPE_CRYPTODEV)) > { > + struct rte_crypto_op *op =3D ev[i].event_ptr; > + > + if (op->status =3D=3D > + RTE_CRYPTO_OP_STATUS_SUCCESS) { > + if (op->sym->m_dst =3D=3D NULL) > + ev[i].event_ptr =3D > + op->sym->m_src; > + else > + ev[i].event_ptr =3D > + op->sym->m_dst; > + rte_crypto_op_free(op); > + } else { > + rte_crypto_op_free(op); > + continue; > + } > + } > + > if (enable_fwd_latency && !prod_timer_type) { > rte_prefetch0(ev[i+1].event_ptr); > /* first queue in pipeline. > @@ -269,6 +305,20 @@ perf_queue_eventdev_setup(struct evt_test *test, > struct evt_options *opt) > return ret; > } > } > + } else if (opt->prod_type =3D=3D EVT_PROD_TYPE_EVENT_CRYPTO_ADPTR) { > + uint8_t cdev_id, cdev_count; > + > + cdev_count =3D rte_cryptodev_count(); > + for (cdev_id =3D 0; cdev_id < cdev_count; cdev_id++) { > + ret =3D rte_cryptodev_start(cdev_id); > + if (ret) { > + evt_err("Failed to start cryptodev %u", > + cdev_id); > + return ret; > + } > + } > + > + rte_event_crypto_adapter_start(t->crypto_adptr.id); > } >=20 > return 0; > @@ -311,11 +361,13 @@ static const struct evt_test_ops perf_queue =3D { > .test_setup =3D perf_test_setup, > .mempool_setup =3D perf_mempool_setup, > .ethdev_setup =3D perf_ethdev_setup, > + .cryptodev_setup =3D perf_cryptodev_setup, > .eventdev_setup =3D perf_queue_eventdev_setup, > .launch_lcores =3D perf_queue_launch_lcores, > .eventdev_destroy =3D perf_eventdev_destroy, > .mempool_destroy =3D perf_mempool_destroy, > .ethdev_destroy =3D perf_ethdev_destroy, > + .cryptodev_destroy =3D perf_cryptodev_destroy, > .test_result =3D perf_test_result, > .test_destroy =3D perf_test_destroy, > }; > diff --git a/doc/guides/tools/testeventdev.rst > b/doc/guides/tools/testeventdev.rst > index 48efb9ea6e..f7d813226d 100644 > --- a/doc/guides/tools/testeventdev.rst > +++ b/doc/guides/tools/testeventdev.rst > @@ -120,6 +120,10 @@ The following are the application command-line > options: >=20 > Use burst mode event timer adapter as producer. >=20 > +* ``--prod_type_cryptodev`` > + > + Use crypto device as producer. > + > * ``--timer_tick_nsec`` >=20 > Used to dictate number of nano seconds between bucket traversal o= f the > @@ -148,6 +152,11 @@ The following are the application command-line > options: > timeout is out of the supported range of event device it will be > adjusted to the highest/lowest supported dequeue timeout supporte= d. >=20 > +* ``--crypto_adptr_mode`` > + > + Set crypto adapter mode. Use 0 for OP_NEW (default) and 1 for > + OP_FORWARD mode. > + > * ``--mbuf_sz`` >=20 > Set packet mbuf size. Can be used to configure Jumbo Frames. Only= @@ - > 420,6 +429,7 @@ Supported application command line options are following:= : > --prod_type_ethdev > --prod_type_timerdev_burst > --prod_type_timerdev > + --prod_type_cryptodev > --prod_enq_burst_sz > --timer_tick_nsec > --max_tmo_nsec > @@ -427,6 +437,7 @@ Supported application command line options are > following:: > --nb_timers > --nb_timer_adptrs > --deq_tmo_nsec > + --crypto_adptr_mode >=20 > Example > ^^^^^^^ > @@ -529,12 +540,14 @@ Supported application command line options are > following:: > --prod_type_ethdev > --prod_type_timerdev_burst > --prod_type_timerdev > + --prod_type_cryptodev > --timer_tick_nsec > --max_tmo_nsec > --expiry_nsec > --nb_timers > --nb_timer_adptrs > --deq_tmo_nsec > + --crypto_adptr_mode >=20 > Example > ^^^^^^^ > -- > 2.25.1