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 A99A1A0093; Mon, 2 May 2022 13:08:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9ADD8410F6; Mon, 2 May 2022 13:08:47 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 7CFB140E28 for ; Mon, 2 May 2022 13:08:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651489725; x=1683025725; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=QPr+iz0BNCNWWutbb3TnRstJXM4pp/3wFXGYIrW3k4g=; b=GwGx0v0kny7pkTgZvCW/BV70ePV+0ZL3bQa6DoFUiifYNRTcjsjAy+wH 3k9t7s1A64X+eDbf9pkucuALlNqazZbCEiZ45kDJvifFrWfS/abNIVIXH /GfMOrnkiS4Fc/KbolwOC7Qofbfy8So0POOobwgpaYWKvsMVVto1CdYWy hQ5qLWez3vjdvXgfK6P6fjsVtrmUWKeL6wItQLdZ8liNPdl/uiQMNG6MD 56oi8uSsW4SidbBio8rvQiimEEZja5tTftfm0cRIYU4FqFu0uoMPkznga JLNLKd5ilC0WzlkhGw5ytFI441NSZDz643tjf4CP8Cg8OJ1EVJxTymdVx w==; X-IronPort-AV: E=McAfee;i="6400,9594,10334"; a="327722819" X-IronPort-AV: E=Sophos;i="5.91,190,1647327600"; d="scan'208";a="327722819" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 May 2022 04:08:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,190,1647327600"; d="scan'208";a="631051630" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga004.fm.intel.com with ESMTP; 02 May 2022 04:08:37 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) 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.27; Mon, 2 May 2022 04:08:37 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Mon, 2 May 2022 04:08:37 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Mon, 2 May 2022 04:08:37 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.170) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Mon, 2 May 2022 04:08:36 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VrDO/pR4i3YNEZiVkmPWeo1sjpWuINUQqHZC287fpoFm/hEn2gOrzJAn+Q7ALaz17wfiV3LZGYMmtlBwV4rfWTlHdya4kbSkkPGINynmACEsJ/r0UQBtolXa5Eerjc24FA/+RYGS/Y6zHI2G+RX8BG3vn/6RDWZCL9iUheYzP6GByBQhdWQeqEzHq2AwTzv2W8ogK3Z509/kcf3+R9c2h3593fG9QBbF//pK5nN968IQ3ZU1VbQ31LRn+gvQKGzI0EFwkq14YEMUQmNUguKqwVoRt8XY6q6IMSh5wGq5xvFEey7i6422TfJjqPPjWkf0MaryILgw0E2PPHT5XPmC3g== 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=aYu1TyaCOf5r7/9taobTz3w2JLAvfn6FHwFT/x2sTFc=; b=UeQEjycoOzbE1ZzDKoH0ikvD6Ua4BZswhy/+v2eQb2QSwnLaZHa8PK6mv1vfVeTMWb/C4En/NW02U5q1MqQPzNNoY08ma6QrF7H6uQ0DiFe8ho4ZdgD4ePxaAFSzjnBvW7m9+jn7irMvEP8RLJME2JH0Xj5Kr1cd2eTVh7WxlKowDs/8eb/cVelTBpimwWejLIkgsoTsBUoJ+bQddx02aYfhyUABcm4X6OlO5nxQqBnj72rtq/7EmJ1u8oRnJeIFpkL0gmrrH/ydHWkzfsCRDNzB+K8lwjeYnEoRMSyN3tIXie98VHur7W0eDapxlgEaWuEKR9QB2aVrvwGaopjfeA== 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 PH0PR11MB5832.namprd11.prod.outlook.com (2603:10b6:510:141::7) by MN2PR11MB3694.namprd11.prod.outlook.com (2603:10b6:208:f7::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.14; Mon, 2 May 2022 11:08:35 +0000 Received: from PH0PR11MB5832.namprd11.prod.outlook.com ([fe80::ad86:86fe:a02b:174f]) by PH0PR11MB5832.namprd11.prod.outlook.com ([fe80::ad86:86fe:a02b:174f%5]) with mapi id 15.20.5186.028; Mon, 2 May 2022 11:08:34 +0000 From: "Gujjar, Abhinandan S" To: Akhil Goyal , "dev@dpdk.org" CC: "anoobj@marvell.com" , "jerinj@marvell.com" , "Jayatheerthan, Jay" , "Vangati, Narender" , "vfialko@marvell.com" , "Zhang, Roy Fan" Subject: RE: [PATCH v4 6/7] test/event: add asymmetric cases for crypto adapter Thread-Topic: [PATCH v4 6/7] test/event: add asymmetric cases for crypto adapter Thread-Index: AQHYXZFCTeYPiWMPuEu1mlqDqJXXha0Lbsag Date: Mon, 2 May 2022 11:08:34 +0000 Message-ID: References: <20220421143720.1583062-1-gakhil@marvell.com> <20220501192457.3670278-1-gakhil@marvell.com> <20220501192457.3670278-7-gakhil@marvell.com> In-Reply-To: <20220501192457.3670278-7-gakhil@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.500.15 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: 12afddd5-2cee-4a70-6e1a-08da2c2c19c2 x-ms-traffictypediagnostic: MN2PR11MB3694:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: dJUGTYp2uEpeVXAgG1fDyM1YOnvJv0sSowioW7JoF7+YS1+6YhUTZ/9F4ssm6PeyZ1Vn47a4ydi7+OZ6fBxpok9s3yCsAXtFS9k1OkJDr0cAmABCI6QC6ac5YtONGOnYRya9ypPy6mR/BnKYMOA6AdFn/PiIFU6klTdq3CxrU3/eQ48VziUt3fygvYFR8+l/EQmx7vD8jCA71TdExT44uBDgiW20iQJNH3CpSAMtt2dcGqEBSwgr3zJJTj6bGU8vQGnd/Z4SvnJJF/nyPXFJtuz8Ic5gWEfPgMqNuDPCPDQW0nNk+ewYVWIGSmoqwGX5X2eAsP4EDnZd6MhFK/AIgdE7whTFtqx4FTav87/0XWxaOUJEEMBqfzjlLhE1Qn3UkAlgpUjTipTPbZb7Zg0GcdWMGGesZHJCXZK/fapH5/PX/Qyld45xzfeVLPIoK2mo+QO5XNkQarm/wqO5Rf/jxbCP79hYjrEayHerIqrxIvqJ3ZdAjWXAC+xVLVuRztHmxqbnODkNSpaXAb1gr4sBqlcMW+OtFqsUH8PoqvxNFFGRUtFpuRoqCmOz74BgD3UwKdfEKuk8Ich306IMr1hGQcliA5X3oMpoFsO3imMSnDSs+/RDGmO/t8GiMyGBkFKNLCK8N6jd98MLYE1UUbov81WtEMOPUo7sXCQIt16htW2IzXKEJ0l8HdR14g2b3E25Tc0/HuMqQIPhdVhpekMs3w== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5832.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(110136005)(86362001)(33656002)(8676002)(66556008)(4326008)(66476007)(66946007)(76116006)(64756008)(508600001)(66446008)(55016003)(71200400001)(54906003)(316002)(38100700002)(38070700005)(2906002)(83380400001)(186003)(8936002)(107886003)(5660300002)(9686003)(6506007)(7696005)(122000001)(26005)(53546011)(82960400001)(52536014)(30864003)(559001)(579004); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?53Hz5+aFehCdwYpKy8SvYEgaM33HCgVCj1RBWJUccp+q1kDZle+p5ILTaZUA?= =?us-ascii?Q?ZcIbQwVu31bKKl5NI4V1omMuFaPdZc+kwsn8juORmdSpPNGBdCOuToXdd1pU?= =?us-ascii?Q?bf3qY1lvwGF1mfsJU+ePhIJt0SNoeQeO5ZiNivWpU2vhoDjc6k16QcRNB4SO?= =?us-ascii?Q?p2yao5kSkcvwYZwoMT0/kr15C0mPHcmd5aJ7521VtoA0DfyIlyem5Akdxik3?= =?us-ascii?Q?UB/lC6q/weHnkGQuGBYfCvD/4NTKI4G7Q7LxUH5l4LguP28oJGVmy8N2yAnf?= =?us-ascii?Q?o3lbLK6D/lIZfjitfTcFG2IBClKCmn6KXKBDhW8e09hohda9EsAbUMr4+D2Q?= =?us-ascii?Q?IAP94kD55973Ij5oP9Cbv1bLRCnAzSeJUH9YveD437TGuEl4WVjIjSScdM0F?= =?us-ascii?Q?WMrH+Wt3EDUv9Nm74/+l0zpKnh0jWTNp9zleCYFP6IMbixUgiewYEatiDPmt?= =?us-ascii?Q?tE20tryZZZZT2/eb5hqPdW2v39bd+xqY777MPgDKRNMwyu3xlSW7fptedmDV?= =?us-ascii?Q?knvImBfZoEDp9ZGxmgLYOt9S9+9xs4i+jpde5RNxlfRZrccjwA5cXLg9z89q?= =?us-ascii?Q?QlaRh/WrJGZabPIFlLvywE7YeQhMAixw5ah3Uw7TapWCMBKFNtTQchB0aULJ?= =?us-ascii?Q?8u+92WfZVKdbXRlDDnNtspdmfDtqSUVFRTWBa+D5NEXiMEw/Y1UwtBlgQVf+?= =?us-ascii?Q?0SXVcfv/0FMDjD8mPyQboc0DJ7GNKOG1c8WsaTvKVjZ6r7MdoLoFKGP/Jbs9?= =?us-ascii?Q?ZXoUMb5PzvMb3vbyojgH8x6O+MouHWe6zMKtQvpHWPaoX7HDKQFmVMV7Qwfd?= =?us-ascii?Q?UuyFMpEniduA622UQ3DaXID23aYEvneIQnaBnAU/GC3pWbwHujT4Wx5Fscom?= =?us-ascii?Q?Q4u4JJINqSBbj4zGP6n+lhpaWll9XThPkqfd4ew9KAQ14krTtr9Jy9neBSDj?= =?us-ascii?Q?j4nIrjptXoYvYaEVeHtyBZ+8KWm+WnCqbbtYEn3vVBRYYipXke2aRZTpsT+l?= =?us-ascii?Q?RVfadyst7dDz4BAXzhfFWLtaqekEvD3tuJkTnAvCvGTqWqu40d1kjNy78447?= =?us-ascii?Q?j3RLOxE37aRulUZOZQFNfqPpizmc8aSbDjftb/a3mFVSVryLZ5CNmMk0+Kw7?= =?us-ascii?Q?dL+/k6Kl0eqE/5yd9PRQC21BwdA6k/gFiOsoi/GUcgGwlPhnANLwJRWtqwZt?= =?us-ascii?Q?lzXIJpAbptqUAagHPJqNg7nrsKW8kcugwHJbS7GuDH5eXxlrDq4s4RhLaCv0?= =?us-ascii?Q?1x+UbkhgTeR8Z/czV97z93VSHsCk0+egubHLDnfhWdauwbUu0mrBjV0BUsxa?= =?us-ascii?Q?7UhRYaEr+51Dji/d+r2PXeDdv0SM43KK1VRlYIhU94u2y5yNsvFc+//GQeNQ?= =?us-ascii?Q?Rl57/R3/qXRuxBMgnF7DImZ/RhSBx9TLNQFqMQsqQZDBk6JcUQqwMqjbQWT1?= =?us-ascii?Q?6Nze+uINb2n70gGBM4HPxzpYvfV7iIaFmKRS0mm0jgh4j07eaPDU5FZVYRIb?= =?us-ascii?Q?5XnnmpXjRnP0UMDnPAfkhbebOA9l+tPLjRVMQ4OP6mnPyAYFUASLTEO3SZPM?= =?us-ascii?Q?BcvWeBHqRyu4EpdKUttyMfCdacVSQs3mx5qjFaYjFmT/BpL/XtzvAZl7WhIz?= =?us-ascii?Q?4FGw1TyC3JA0n8o5SpLzxdCm5NinhysMO2mgMM+jCUQYhCkkwdQUNCkXZ7Uo?= =?us-ascii?Q?o4dtxN7slOjv5err1fMlitnit+EEmiafFtTGLzoZiZ793blSptNt4FdlczFw?= =?us-ascii?Q?aeE5qNv8fVtfXaIjgFMZvg2gWpa5geQ=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: PH0PR11MB5832.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 12afddd5-2cee-4a70-6e1a-08da2c2c19c2 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 May 2022 11:08:34.8545 (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: 4l1hULXwQOv8Av5oT0PD/COAvasK7LVumhT9l/8NyuDxIGyHSp7h75aHQD9WAVj1rIy0xjEW3ek/L8IKpjvIGxj4uZY9GwavXVEjycEBV2E= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3694 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 Acked-by: Abhinandan Gujjar > -----Original Message----- > From: Akhil Goyal > Sent: Monday, May 2, 2022 12:55 AM > To: dev@dpdk.org > Cc: anoobj@marvell.com; jerinj@marvell.com; Gujjar, Abhinandan S > ; Jayatheerthan, Jay > ; Vangati, Narender > ; vfialko@marvell.com; Akhil Goyal > ; Zhang, Roy Fan > Subject: [PATCH v4 6/7] test/event: add asymmetric cases for crypto adapt= er >=20 > Test app is updated to add cases for asymmetric crypto sessions for event > crypto adapter. >=20 > Signed-off-by: Akhil Goyal > Acked-by: Fan Zhang > --- > app/test/test_event_crypto_adapter.c | 499 ++++++++++++++++++++++++++- > 1 file changed, 493 insertions(+), 6 deletions(-) >=20 > diff --git a/app/test/test_event_crypto_adapter.c > b/app/test/test_event_crypto_adapter.c > index 9904206735..2ecc7e2cea 100644 > --- a/app/test/test_event_crypto_adapter.c > +++ b/app/test/test_event_crypto_adapter.c > @@ -6,6 +6,7 @@ > #include "test.h" > #include > #include > +#include > #include > #include > #include > @@ -67,12 +68,97 @@ static const uint8_t text_64B[] =3D { > 0x31, 0xbf, 0xe9, 0xa1, 0x97, 0x5c, 0x2b, 0xd6, > 0x57, 0xa5, 0x9f, 0xab, 0xbd, 0xb0, 0x9b, 0x9c }; > +#define DATA_SIZE 512 > +struct modex_test_data { > + enum rte_crypto_asym_xform_type xform_type; > + struct { > + uint8_t data[DATA_SIZE]; > + uint16_t len; > + } base; > + struct { > + uint8_t data[DATA_SIZE]; > + uint16_t len; > + } exponent; > + struct { > + uint8_t data[DATA_SIZE]; > + uint16_t len; > + } modulus; > + struct { > + uint8_t data[DATA_SIZE]; > + uint16_t len; > + } reminder; > + uint16_t result_len; > +}; > + > +static struct > +modex_test_data modex_test_case =3D { > + .xform_type =3D RTE_CRYPTO_ASYM_XFORM_MODEX, > + .base =3D { > + .data =3D { > + 0xF8, 0xBA, 0x1A, 0x55, 0xD0, 0x2F, 0x85, > + 0xAE, 0x96, 0x7B, 0xB6, 0x2F, 0xB6, 0xCD, > + 0xA8, 0xEB, 0x7E, 0x78, 0xA0, 0x50 > + }, > + .len =3D 20, > + }, > + .exponent =3D { > + .data =3D { > + 0x01, 0x00, 0x01 > + }, > + .len =3D 3, > + }, > + .reminder =3D { > + .data =3D { > + 0x2C, 0x60, 0x75, 0x45, 0x98, 0x9D, 0xE0, 0x72, > + 0xA0, 0x9D, 0x3A, 0x9E, 0x03, 0x38, 0x73, 0x3C, > + 0x31, 0x83, 0x04, 0xFE, 0x75, 0x43, 0xE6, 0x17, > + 0x5C, 0x01, 0x29, 0x51, 0x69, 0x33, 0x62, 0x2D, > + 0x78, 0xBE, 0xAE, 0xC4, 0xBC, 0xDE, 0x7E, 0x2C, > + 0x77, 0x84, 0xF2, 0xC5, 0x14, 0xB5, 0x2F, 0xF7, > + 0xC5, 0x94, 0xEF, 0x86, 0x75, 0x75, 0xB5, 0x11, > + 0xE5, 0x0E, 0x0A, 0x29, 0x76, 0xE2, 0xEA, 0x32, > + 0x0E, 0x43, 0x77, 0x7E, 0x2C, 0x27, 0xAC, 0x3B, > + 0x86, 0xA5, 0xDB, 0xC9, 0x48, 0x40, 0xE8, 0x99, > + 0x9A, 0x0A, 0x3D, 0xD6, 0x74, 0xFA, 0x2E, 0x2E, > + 0x5B, 0xAF, 0x8C, 0x99, 0x44, 0x2A, 0x67, 0x38, > + 0x27, 0x41, 0x59, 0x9D, 0xB8, 0x51, 0xC9, 0xF7, > + 0x43, 0x61, 0x31, 0x6E, 0xF1, 0x25, 0x38, 0x7F, > + 0xAE, 0xC6, 0xD0, 0xBB, 0x29, 0x76, 0x3F, 0x46, > + 0x2E, 0x1B, 0xE4, 0x67, 0x71, 0xE3, 0x87, 0x5A > + }, > + .len =3D 128, > + }, > + .modulus =3D { > + .data =3D { > + 0xb3, 0xa1, 0xaf, 0xb7, 0x13, 0x08, 0x00, 0x0a, > + 0x35, 0xdc, 0x2b, 0x20, 0x8d, 0xa1, 0xb5, 0xce, > + 0x47, 0x8a, 0xc3, 0x80, 0xf4, 0x7d, 0x4a, 0xa2, > + 0x62, 0xfd, 0x61, 0x7f, 0xb5, 0xa8, 0xde, 0x0a, > + 0x17, 0x97, 0xa0, 0xbf, 0xdf, 0x56, 0x5a, 0x3d, > + 0x51, 0x56, 0x4f, 0x70, 0x70, 0x3f, 0x63, 0x6a, > + 0x44, 0x5b, 0xad, 0x84, 0x0d, 0x3f, 0x27, 0x6e, > + 0x3b, 0x34, 0x91, 0x60, 0x14, 0xb9, 0xaa, 0x72, > + 0xfd, 0xa3, 0x64, 0xd2, 0x03, 0xa7, 0x53, 0x87, > + 0x9e, 0x88, 0x0b, 0xc1, 0x14, 0x93, 0x1a, 0x62, > + 0xff, 0xb1, 0x5d, 0x74, 0xcd, 0x59, 0x63, 0x18, > + 0x11, 0x3d, 0x4f, 0xba, 0x75, 0xd4, 0x33, 0x4e, > + 0x23, 0x6b, 0x7b, 0x57, 0x44, 0xe1, 0xd3, 0x03, > + 0x13, 0xa6, 0xf0, 0x8b, 0x60, 0xb0, 0x9e, 0xee, > + 0x75, 0x08, 0x9d, 0x71, 0x63, 0x13, 0xcb, 0xa6, > + 0x81, 0x92, 0x14, 0x03, 0x22, 0x2d, 0xde, 0x55 > + }, > + .len =3D 128, > + }, > + .result_len =3D 128, > +}; >=20 > struct event_crypto_adapter_test_params { > struct rte_mempool *mbuf_pool; > struct rte_mempool *op_mpool; > + struct rte_mempool *asym_op_mpool; > struct rte_mempool *session_mpool; > struct rte_mempool *session_priv_mpool; > + struct rte_mempool *asym_sess_mpool; > struct rte_cryptodev_config *config; > uint8_t crypto_event_port_id; > uint8_t internal_port_op_fwd; > @@ -134,11 +220,24 @@ send_recv_ev(struct rte_event *ev) > rte_pause(); >=20 > op =3D recv_ev.event_ptr; > + if (op->type =3D=3D RTE_CRYPTO_OP_TYPE_SYMMETRIC) { > #if PKT_TRACE > - struct rte_mbuf *m =3D op->sym->m_src; > - rte_pktmbuf_dump(stdout, m, rte_pktmbuf_pkt_len(m)); > + struct rte_mbuf *m =3D op->sym->m_src; > + rte_pktmbuf_dump(stdout, m, rte_pktmbuf_pkt_len(m)); > #endif > - rte_pktmbuf_free(op->sym->m_src); > + rte_pktmbuf_free(op->sym->m_src); > + } else { > + uint8_t *data_expected =3D NULL, *data_received =3D NULL; > + uint32_t data_size; > + > + data_expected =3D modex_test_case.reminder.data; > + data_received =3D op->asym->modex.result.data; > + data_size =3D op->asym->modex.result.length; > + ret =3D memcmp(data_expected, data_received, data_size); > + TEST_ASSERT_EQUAL(ret, 0, > + "Data mismatch for asym crypto adapter\n"); > + rte_free(op->asym->modex.result.data); > + } > rte_crypto_op_free(op); >=20 > return TEST_SUCCESS; > @@ -348,6 +447,170 @@ test_session_with_op_forward_mode(void) > return TEST_SUCCESS; > } >=20 > +static int > +test_asym_op_forward_mode(uint8_t session_less) { > + const struct rte_cryptodev_asymmetric_xform_capability *capability; > + struct rte_cryptodev_asym_capability_idx cap_idx; > + struct rte_crypto_asym_xform xform_tc; > + union rte_event_crypto_metadata m_data; > + struct rte_cryptodev_info dev_info; > + struct rte_crypto_asym_op *asym_op; > + struct rte_crypto_op *op; > + uint8_t input[4096] =3D {0}; > + uint8_t *result =3D NULL; > + struct rte_event ev; > + void *sess =3D NULL; > + uint32_t cap; > + int ret; > + > + memset(&m_data, 0, sizeof(m_data)); > + > + rte_cryptodev_info_get(TEST_CDEV_ID, &dev_info); > + if (session_less && !(dev_info.feature_flags & > + RTE_CRYPTODEV_FF_ASYM_SESSIONLESS)) { > + RTE_LOG(INFO, USER1, > + "Device doesn't support Asym sessionless ops. Test > Skipped\n"); > + return TEST_SKIPPED; > + } > + /* Setup Cipher Parameters */ > + xform_tc.next =3D NULL; > + xform_tc.xform_type =3D RTE_CRYPTO_ASYM_XFORM_MODEX; > + cap_idx.type =3D xform_tc.xform_type; > + capability =3D rte_cryptodev_asym_capability_get(TEST_CDEV_ID, > +&cap_idx); > + > + if (capability =3D=3D NULL) { > + RTE_LOG(INFO, USER1, > + "Device doesn't support MODEX. Test Skipped\n"); > + return TEST_SKIPPED; > + } > + > + op =3D rte_crypto_op_alloc(params.asym_op_mpool, > + RTE_CRYPTO_OP_TYPE_ASYMMETRIC); > + TEST_ASSERT_NOT_NULL(op, > + "Failed to allocate asymmetric crypto operation struct\n"); > + > + asym_op =3D op->asym; > + > + result =3D rte_zmalloc(NULL, modex_test_case.result_len, 0); > + xform_tc.modex.modulus.data =3D modex_test_case.modulus.data; > + xform_tc.modex.modulus.length =3D modex_test_case.modulus.len; > + xform_tc.modex.exponent.data =3D modex_test_case.exponent.data; > + xform_tc.modex.exponent.length =3D modex_test_case.exponent.len; > + memcpy(input, modex_test_case.base.data, > + modex_test_case.base.len); > + asym_op->modex.base.data =3D input; > + asym_op->modex.base.length =3D modex_test_case.base.len; > + asym_op->modex.result.data =3D result; > + asym_op->modex.result.length =3D modex_test_case.result_len; > + if (rte_cryptodev_asym_xform_capability_check_modlen(capability, > + xform_tc.modex.modulus.length)) { > + RTE_LOG(INFO, USER1, > + "line %u FAILED: %s", __LINE__, > + "Invalid MODULUS length specified"); > + return TEST_FAILED; > + } > + > + if (!session_less) { > + /* Create Crypto session*/ > + ret =3D rte_cryptodev_asym_session_create(TEST_CDEV_ID, > + &xform_tc, params.asym_sess_mpool, &sess); > + TEST_ASSERT_SUCCESS(ret, "Failed to init session\n"); > + > + ret =3D 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) { > + /* Fill in private user data information */ > + m_data.request_info.cdev_id =3D request_info.cdev_id; > + m_data.request_info.queue_pair_id =3D > + request_info.queue_pair_id; > + m_data.response_info.event =3D response_info.event; > + > rte_cryptodev_session_event_mdata_set(TEST_CDEV_ID, > + sess, > RTE_CRYPTO_OP_TYPE_ASYMMETRIC, > + RTE_CRYPTO_OP_WITH_SESSION, > + &m_data, sizeof(m_data)); > + } > + > + rte_crypto_op_attach_asym_session(op, sess); > + } else { > + op->sess_type =3D RTE_CRYPTO_OP_SESSIONLESS; > + asym_op->xform =3D &xform_tc; > + op->private_data_offset =3D (sizeof(struct rte_crypto_op) + > + sizeof(struct rte_crypto_asym_op) + > + DEFAULT_NUM_XFORMS * > + sizeof(struct rte_crypto_asym_xform)); > + /* Fill in private data information */ > + m_data.request_info.cdev_id =3D request_info.cdev_id; > + m_data.request_info.queue_pair_id =3D > request_info.queue_pair_id; > + m_data.response_info.event =3D response_info.event; > + rte_memcpy((uint8_t *)op + op->private_data_offset, > + &m_data, sizeof(m_data)); > + } > + /* Fill in event info and update event_ptr with rte_crypto_op */ > + memset(&ev, 0, sizeof(ev)); > + ev.queue_id =3D TEST_CRYPTO_EV_QUEUE_ID; > + ev.sched_type =3D RTE_SCHED_TYPE_ATOMIC; > + ev.flow_id =3D 0xAABB; > + ev.event_ptr =3D op; > + > + ret =3D 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 > +test_asym_sessionless_with_op_forward_mode(void) > +{ > + uint32_t cap; > + int ret; > + > + ret =3D 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) && > + !(cap & > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW)) > + map_adapter_service_core(); > + else { > + if (!(cap & > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD)) > + return TEST_SKIPPED; > + } > + > + > TEST_ASSERT_SUCCESS(rte_event_crypto_adapter_start(TEST_ADAPTE > R_ID), > + "Failed to start event crypto adapter"); > + > + return test_asym_op_forward_mode(1); > +} > + > +static int > +test_asym_session_with_op_forward_mode(void) > +{ > + uint32_t cap; > + int ret; > + > + ret =3D 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) && > + !(cap & > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW)) > + map_adapter_service_core(); > + else { > + if (!(cap & > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD)) > + return TEST_SKIPPED; > + } > + > + > TEST_ASSERT_SUCCESS(rte_event_crypto_adapter_start(TEST_ADAPTE > R_ID > + ), "Failed to start event crypto adapter"); > + > + return test_asym_op_forward_mode(0); > +} > + > static int > send_op_recv_ev(struct rte_crypto_op *op) { @@ -365,11 +628,24 @@ > send_op_recv_ev(struct rte_crypto_op *op) > rte_pause(); >=20 > recv_op =3D ev.event_ptr; > + if (recv_op->type =3D=3D RTE_CRYPTO_OP_TYPE_SYMMETRIC) { > #if PKT_TRACE > - struct rte_mbuf *m =3D recv_op->sym->m_src; > - rte_pktmbuf_dump(stdout, m, rte_pktmbuf_pkt_len(m)); > + struct rte_mbuf *m =3D 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_pktmbuf_free(recv_op->sym->m_src); > + } else { > + uint8_t *data_expected =3D NULL, *data_received =3D NULL; > + uint32_t data_size; > + > + data_expected =3D modex_test_case.reminder.data; > + data_received =3D op->asym->modex.result.data; > + data_size =3D op->asym->modex.result.length; > + ret =3D memcmp(data_expected, data_received, data_size); > + TEST_ASSERT_EQUAL(ret, 0, > + "Data mismatch for asym crypto adapter\n"); > + rte_free(op->asym->modex.result.data); > + } > rte_crypto_op_free(recv_op); >=20 > return TEST_SUCCESS; > @@ -505,16 +781,169 @@ test_session_with_op_new_mode(void) > return TEST_SUCCESS; > } >=20 > +static int > +test_asym_op_new_mode(uint8_t session_less) { > + const struct rte_cryptodev_asymmetric_xform_capability *capability; > + struct rte_cryptodev_asym_capability_idx cap_idx; > + struct rte_crypto_asym_xform xform_tc; > + union rte_event_crypto_metadata m_data; > + struct rte_cryptodev_info dev_info; > + struct rte_crypto_asym_op *asym_op; > + struct rte_crypto_op *op; > + uint8_t input[4096] =3D {0}; > + uint8_t *result =3D NULL; > + void *sess =3D NULL; > + uint32_t cap; > + int ret; > + > + memset(&m_data, 0, sizeof(m_data)); > + > + rte_cryptodev_info_get(TEST_CDEV_ID, &dev_info); > + if (session_less && !(dev_info.feature_flags & > + RTE_CRYPTODEV_FF_ASYM_SESSIONLESS)) { > + RTE_LOG(INFO, USER1, > + "Device doesn't support Asym sessionless ops. Test > Skipped\n"); > + return TEST_SKIPPED; > + } > + /* Setup Cipher Parameters */ > + xform_tc.next =3D NULL; > + xform_tc.xform_type =3D RTE_CRYPTO_ASYM_XFORM_MODEX; > + cap_idx.type =3D xform_tc.xform_type; > + capability =3D rte_cryptodev_asym_capability_get(TEST_CDEV_ID, > +&cap_idx); > + > + if (capability =3D=3D NULL) { > + RTE_LOG(INFO, USER1, > + "Device doesn't support MODEX. Test Skipped\n"); > + return TEST_SKIPPED; > + } > + > + op =3D rte_crypto_op_alloc(params.asym_op_mpool, > + RTE_CRYPTO_OP_TYPE_ASYMMETRIC); > + TEST_ASSERT_NOT_NULL(op, "Failed to allocate asym crypto_op!\n"); > + > + asym_op =3D op->asym; > + > + result =3D rte_zmalloc(NULL, modex_test_case.result_len, 0); > + xform_tc.modex.modulus.data =3D modex_test_case.modulus.data; > + xform_tc.modex.modulus.length =3D modex_test_case.modulus.len; > + xform_tc.modex.exponent.data =3D modex_test_case.exponent.data; > + xform_tc.modex.exponent.length =3D modex_test_case.exponent.len; > + memcpy(input, modex_test_case.base.data, > + modex_test_case.base.len); > + asym_op->modex.base.data =3D input; > + asym_op->modex.base.length =3D modex_test_case.base.len; > + asym_op->modex.result.data =3D result; > + asym_op->modex.result.length =3D modex_test_case.result_len; > + if (rte_cryptodev_asym_xform_capability_check_modlen(capability, > + xform_tc.modex.modulus.length)) { > + RTE_LOG(INFO, USER1, > + "line %u FAILED: %s", __LINE__, > + "Invalid MODULUS length specified"); > + return TEST_FAILED; > + } > + > + if (!session_less) { > + ret =3D rte_cryptodev_asym_session_create(TEST_CDEV_ID, > + &xform_tc, params.asym_sess_mpool, &sess); > + TEST_ASSERT_NOT_NULL(sess, "Session creation failed\n"); > + TEST_ASSERT_SUCCESS(ret, "Failed to init session\n"); > + > + ret =3D 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) { > + /* Fill in private user data information */ > + m_data.response_info.event =3D response_info.event; > + > rte_cryptodev_session_event_mdata_set(TEST_CDEV_ID, > + sess, > RTE_CRYPTO_OP_TYPE_ASYMMETRIC, > + RTE_CRYPTO_OP_WITH_SESSION, > + &m_data, sizeof(m_data)); > + } > + > + rte_crypto_op_attach_asym_session(op, sess); > + } else { > + op->sess_type =3D RTE_CRYPTO_OP_SESSIONLESS; > + asym_op->xform =3D &xform_tc; > + op->private_data_offset =3D (sizeof(struct rte_crypto_op) + > + sizeof(struct rte_crypto_asym_op) + > + DEFAULT_NUM_XFORMS * > + sizeof(struct rte_crypto_asym_xform)); > + /* Fill in private data information */ > + m_data.response_info.event =3D response_info.event; > + rte_memcpy((uint8_t *)op + op->private_data_offset, > + &m_data, sizeof(m_data)); > + } > + > + ret =3D 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_asym_sessionless_with_op_new_mode(void) > +{ > + uint32_t cap; > + int ret; > + > + ret =3D 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) && > + !(cap & > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW)) > + map_adapter_service_core(); > + else { > + if (!(cap & > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW)) > + return TEST_SKIPPED; > + } > + > + /* start the event crypto adapter */ > + > TEST_ASSERT_SUCCESS(rte_event_crypto_adapter_start(TEST_ADAPTE > R_ID), > + "Failed to start event crypto adapter"); > + > + return test_asym_op_new_mode(1); > +} > + > +static int > +test_asym_session_with_op_new_mode(void) > +{ > + uint32_t cap; > + int ret; > + > + ret =3D 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) && > + !(cap & > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW)) > + map_adapter_service_core(); > + else { > + if (!(cap & > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW)) > + return TEST_SKIPPED; > + } > + > + > TEST_ASSERT_SUCCESS(rte_event_crypto_adapter_start(TEST_ADAPTE > R_ID), > + "Failed to start event crypto adapter"); > + > + return test_asym_op_new_mode(0); > +} > + > static int > configure_cryptodev(void) > { > + const struct rte_cryptodev_capabilities *capability; > struct rte_cryptodev_qp_conf qp_conf; > struct rte_cryptodev_config conf; > struct rte_cryptodev_info info; > unsigned int session_size; > + unsigned int i =3D 0; > uint8_t nb_devs; > int ret; >=20 > + > params.mbuf_pool =3D rte_pktmbuf_pool_create( > "CRYPTO_ADAPTER_MBUFPOOL", > NUM_MBUFS, MBUF_CACHE_SIZE, 0, MBUF_SIZE, @@ > -582,6 +1011,33 @@ configure_cryptodev(void) > "session mempool allocation failed\n"); >=20 > rte_cryptodev_info_get(TEST_CDEV_ID, &info); > + > + while ((capability =3D &info.capabilities[i++])->op !=3D > + RTE_CRYPTO_OP_TYPE_UNDEFINED) { > + if (capability->op =3D=3D RTE_CRYPTO_OP_TYPE_ASYMMETRIC) { > + params.asym_op_mpool =3D rte_crypto_op_pool_create( > + "EVENT_CRYPTO_ASYM_OP_POOL", > + RTE_CRYPTO_OP_TYPE_ASYMMETRIC, > + NUM_MBUFS, MBUF_CACHE_SIZE, > + (DEFAULT_NUM_XFORMS * > + sizeof(struct rte_crypto_asym_xform)) + > + sizeof(union rte_event_crypto_metadata), > + rte_socket_id()); > + TEST_ASSERT_NOT_NULL(params.asym_op_mpool, > + "Can't create > CRYPTO_ASYM_OP_POOL\n"); > + > + params.asym_sess_mpool =3D > + rte_cryptodev_asym_session_pool_create( > + "CRYPTO_AD_ASYM_SESS_MP", > + MAX_NB_SESSIONS, 0, > + sizeof(union > rte_event_crypto_metadata), > + SOCKET_ID_ANY); > + TEST_ASSERT_NOT_NULL(params.asym_sess_mpool, > + "asym session mempool allocation failed\n"); > + break; > + } > + } > + > conf.nb_queue_pairs =3D info.max_nb_queue_pairs; > conf.socket_id =3D SOCKET_ID_ANY; > conf.ff_disable =3D RTE_CRYPTODEV_FF_SECURITY; @@ -960,6 +1416,21 > @@ crypto_teardown(void) > params.session_priv_mpool =3D NULL; > } >=20 > + /* Free asym session mempool */ > + if (params.asym_sess_mpool !=3D NULL) { > + RTE_LOG(DEBUG, USER1, "CRYPTO_AD_ASYM_SESS_MP count > %u\n", > + rte_mempool_avail_count(params.asym_sess_mpool)); > + rte_mempool_free(params.asym_sess_mpool); > + params.asym_sess_mpool =3D NULL; > + } > + /* Free asym ops mempool */ > + if (params.asym_op_mpool !=3D NULL) { > + RTE_LOG(DEBUG, USER1, "EVENT_CRYPTO_ASYM_OP_POOL > count %u\n", > + rte_mempool_avail_count(params.asym_op_mpool)); > + rte_mempool_free(params.asym_op_mpool); > + params.asym_op_mpool =3D NULL; > + } > + > /* Free ops mempool */ > if (params.op_mpool !=3D NULL) { > RTE_LOG(DEBUG, USER1, "EVENT_CRYPTO_SYM_OP_POOL > count %u\n", @@ -1016,6 +1487,22 @@ static struct unit_test_suite > functional_testsuite =3D { > test_crypto_adapter_stop, > test_sessionless_with_op_new_mode), >=20 > + TEST_CASE_ST(test_crypto_adapter_conf_op_forward_mode, > + test_crypto_adapter_stop, > + test_asym_session_with_op_forward_mode), > + > + TEST_CASE_ST(test_crypto_adapter_conf_op_forward_mode, > + test_crypto_adapter_stop, > + > test_asym_sessionless_with_op_forward_mode), > + > + TEST_CASE_ST(test_crypto_adapter_conf_op_new_mode, > + test_crypto_adapter_stop, > + test_asym_session_with_op_new_mode), > + > + TEST_CASE_ST(test_crypto_adapter_conf_op_new_mode, > + test_crypto_adapter_stop, > + test_asym_sessionless_with_op_new_mode), > + > TEST_CASES_END() /**< NULL terminate unit test array */ > } > }; > -- > 2.25.1