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 7C565A0352; Tue, 8 Feb 2022 18:01:01 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 450F74114B; Tue, 8 Feb 2022 18:01:01 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 5E67E410FD for ; Tue, 8 Feb 2022 18:01:00 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 218GUYuq000850; Tue, 8 Feb 2022 09:00:59 -0800 Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam07lp2044.outbound.protection.outlook.com [104.47.51.44]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3e3mhsj8bd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Feb 2022 09:00:58 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LNoS0jkWemaPzExUoRBvGkAUJn7Q5VO/Z3WvG4O3Eyd2cxtLpe5qERsD1IXw3YgQLMXjkQcrUgYHm9cB5t74FutxOxnR1AVxxHJL7Fi1fiLYVFJ3X9qyQG03P85IpzAbmHbf2oql/OZLvvCfZ2LLBTaMtnXoBF7/hV3FKPtX0ZYqcGWJtmucgyeEYazfaj6/NWyHG/Ew9D5+IfapniditO81hgjnkojhI7qVLIvB4C+QUt2DhbOL8knaXho0UJa8QX2BIXpsre2TMBqzBq/zi+6owrOxA00c56BuF6Hm/N62IFYnU6m8EV0C+GsRBpohuvbEMtxdNq+UENDDlQgtDQ== 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=6p0Ult4LMHYwU3SJBMjFvLZLkwkZqHYldwWgmlGxUYQ=; b=CtMR61iBr8oo+fybSn0IKesymf6DFkB1vsmA0al8dXO9gLS9wy44uiWH7BDN9KrkTQIAye67IvQBUAUROgdJfuXx08LU10WMBycn5PAP0+hQ6ybdtWuTpYE5UiNrQ3teYInKkg8n5mbiHpBNxULoHuib3T4VPYaskGREPPhbRXxEnUET6PCiNP2d2q2R2xk+2M8BiUJZ40SPUR7Lrhm3cI04GDYtxXzJ9COqiKTHpdwpG3T4WMzrcVtG/BucFFn0T8mo04xwmCysARpHdPt4itCe5F8yic2rvRBN3bKmXZr+W1/Cupk3DS9Zg554AL3mWAqg+yJl7+1p9lU8NzZErg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6p0Ult4LMHYwU3SJBMjFvLZLkwkZqHYldwWgmlGxUYQ=; b=RGTVlVK3/RnYsYox4YrUFWfXULn/M0qktenIGh4sDaIpnscIxGcf6x8ndmZwk+Kd0cUT+tJI0mcLR5jjqodseEZW5Gr4g/E3Q9tpTWqqbMqtGVhTo8gR5hOZer7JUOibWXvZErC6vHEHPKl1SuBWK9Zjt/vYcCo3274i4oKOvJM= Received: from CO6PR18MB4418.namprd18.prod.outlook.com (2603:10b6:303:13a::23) by DM6PR18MB3505.namprd18.prod.outlook.com (2603:10b6:5:28e::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.19; Tue, 8 Feb 2022 17:00:29 +0000 Received: from CO6PR18MB4418.namprd18.prod.outlook.com ([fe80::799a:ea62:66be:f7dd]) by CO6PR18MB4418.namprd18.prod.outlook.com ([fe80::799a:ea62:66be:f7dd%9]) with mapi id 15.20.4951.019; Tue, 8 Feb 2022 17:00:29 +0000 From: Shijith Thotton To: "Gujjar, Abhinandan S" , "dev@dpdk.org" , Jerin Jacob Kollanukkaran CC: Anoob Joseph , Pavan Nikhilesh Bhagavatula , Akhil Goyal Subject: RE: [PATCH v3] app/eventdev: add crypto producer mode Thread-Topic: [PATCH v3] app/eventdev: add crypto producer mode Thread-Index: AQHYAVbFsPI6a+Drj0664dAbMPqvMKxxD7yAgALPoACAFjPDUA== Date: Tue, 8 Feb 2022 17:00:29 +0000 Message-ID: References: <5b7dadb222f6eb018c74983750052543eb5f0d8e.1640076426.git.sthotton@marvell.com> <736dc424a780b9547033f76f8911342ff06d3f87.1641292088.git.sthotton@marvell.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 625d4de7-7174-486c-6d88-08d9eb2482bb x-ms-traffictypediagnostic: DM6PR18MB3505:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2582; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: PBixPlSGaaLvHeBjbIgifsErwfW3yU/G3tJOFAwWY1Rjjtj+w5dp2zECe7/huWUaSquJqV5O66fEDHK69kLGYAUM2g2KGztZFMI/CVhIgZre0UtkyoutNBPmNFbnUJrzgqdPW6g0AaYHgy/aLcgZ46gPaWASll093fS5sH2y1weDGXIbdFLpCl3vv6hwDdXY2Ve29x6L5i6VGmrO4SqOd5WhJYi/pj+EvbBy7bmJ2KesGKNBUXH9ZdfDQSG1rlqlyhMnVQUxG5N8wZadvsb4W2/1YT9mx9noO3trfVEsPErIsI5ZBaSdqa19ZVlswI3wjfFYudM6pp+Fef9z0FCOD7/w/pY7Ms4Bzxf7IHgTrXvBJaHbgyYW4qNrKKJgbAGhc9whoi7RRQ/CKRFHm4JIZNzIrc5dKOy3U+xCXOGAziRpDKcOaFATf820chiMODe2b6z/+lhe40tdov5R59O1SZz3dskeoz/qmsO1mBFsaPiYJB/4Vzkug641l0gz+5swdcqNYL2Nq4xKcrZyERrDcQYINZpysAJbyhSCsmu1/bkw0WjJfcVQSi83MCkfVPqdgOchZXbbGRdspwqUOe0FSAaEcXEyYlRpUDf/oYd2RR4Ye2TFJn8NGy5ktMA5W3wGF0vBGui00Vdm3aIbfbvAvS/NLcd8ouIhpw4Jzc1ZqjSB5KvS3CcFNkBYqPWUbUAJQq8BdAxACI36r/NKV9B9txVu4hf65tKiB0dMD/lHtoqdyHmcAK7ISb3NBodJglOGfDot280yJbebxqKy6yj46g== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR18MB4418.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(86362001)(316002)(8676002)(110136005)(8936002)(2906002)(33656002)(54906003)(6636002)(966005)(508600001)(38070700005)(71200400001)(55236004)(52536014)(26005)(186003)(66946007)(66556008)(5660300002)(66446008)(66476007)(107886003)(64756008)(4326008)(83380400001)(55016003)(122000001)(9686003)(38100700002)(76116006)(30864003)(6506007)(7696005); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?87Hz1B+7BHsACZRGc3ha78E2/QRhgCtQ7W43yX2xbjtlmE2Tr6x1yXBpTQ5j?= =?us-ascii?Q?bv67oAie6C7StSwSLuiu1+eTxjLVr+RasEWAcG8hELWKo1oGqGPN3mSoDJZx?= =?us-ascii?Q?Cx0k1blAC9zEAoKDqukoAhxTQ9gMUSBvIAXhZ8LxP/IXfd7UyFe6b2lkjgYg?= =?us-ascii?Q?jQt9Xs4SAacPkTwOQiPO1C+WHjBhkKPr06k2g3iICNF4F6a7p9bMMx/WzW0E?= =?us-ascii?Q?4XrCsPcwh2JYWq1egbeo8GlZML3qlRgIpCck5rZlYltP9UMMvaIEA7Sv0UUK?= =?us-ascii?Q?YGCSC8n+joBnpGcgp/Y54OX1Texb/ykWP4S5zwuxzZsCssa86PkmoP0363d5?= =?us-ascii?Q?yrcYzXuGBD0n7pXoxUnALDyXllOyzHYzLpbdOZlpmxZ8ZHsZ+pzJgimd+cCy?= =?us-ascii?Q?iC9tYeVr5CF7f7SasKygQFlZeSzHOvhJq4CuBGZv1oIWPDD0nX29WkdDa1uK?= =?us-ascii?Q?NGhQQrxkmhQfqfx10AE5HZl/kxM76auUjs4TiWCx08c/+gD9YnklskhKobK1?= =?us-ascii?Q?qFwCyH/KT7Z0+EC+B0bZJD8wCSxx+VLp9/pYMrk9a6CICA78zkOXuVQgnzlP?= =?us-ascii?Q?XJo+Tzv0csBnK/UX6crU07fpPRNt/bTtRo4Mp10noowTNz97e3H4vHfWdzkY?= =?us-ascii?Q?FevB8OQTdF6HVwE6A19FIBaoAZ81ejoe/cKZfC2UPlVufTbiGCFlakzkE5Cq?= =?us-ascii?Q?g9ka87IgsYFBf8fibyOKHBYz1aE6WdSO/cBbJ50AuBTl2CQckge20M57+Qik?= =?us-ascii?Q?zu/g1GUutbU2Tbxmm+W3yi8gEKGZbaDKkIDMEimgwx9Ojnq+aBiWhFi1JxK/?= =?us-ascii?Q?JJSQKOaZ7chIvHPBH94aIzZ7Syzipl5roEbsE4B6aG82s1YKXSEs6GyjeNwx?= =?us-ascii?Q?i0CqtgZepvVd85tmJYwIDCs7YmEyDbdFWPZUkGpGxdLEfot0XRo3ErRm2UEd?= =?us-ascii?Q?YGEfPMGm4P1KXpN1015oCV3g3tXfxKHYJPbblOf1TsdJQfEyuHwjq2k2qCNw?= =?us-ascii?Q?yijPzVqEEfCoP6eB8I2PjG02flF2toj9zrRmdcXb4EOh/Z566VJB7sxQgSCU?= =?us-ascii?Q?XcXfo8tKOlbgTmQzYENIbk+YSxMKg5zevclsftBI/SO37SiIhik7y+OD5/8v?= =?us-ascii?Q?bqtpRuFVMZUDJBtEOh84qtKYG4eCCzXVqNdCfhD7lxbXOLUnkaoNt7Cjwh/R?= =?us-ascii?Q?E9S94UqNeyXyTIC78lfUe1oT2UkCHuY64oH4G4VpkKYy79W1jIPraDt5B292?= =?us-ascii?Q?kvj0gmY+nKtdZZSeOmqIDn7ut2if929iK34UGZAiwkiwPoAwZdCRcYN+nvJr?= =?us-ascii?Q?ZX5M2hDotFbJrroH+oPIwJXzeiwrE1XHAsOVoK/wqlroF/VrDJPJ53tQ5X1v?= =?us-ascii?Q?30jbSbI0vFVpWHru3XYcpLAzN63VWLKX5xykxmEr8kvkx1nyBzBV4JNUvgnb?= =?us-ascii?Q?oJQbzUT7y8gL8ORRknwfCgD87wQbV1WkN3Mt9klHdQtPGJU+Ool3XM5MSYV3?= =?us-ascii?Q?uDcpniHJah8iDtuNzvvUzjQzoCtyQAXjfMIjNgcrYYHHcm8amMNNqQe8uWyZ?= =?us-ascii?Q?wJn6Bq2q42X2nclbVQweiDb1CQ+OUPwxU5tHcDToM+/+e4a3zKDxZvfIG1AN?= =?us-ascii?Q?fw=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO6PR18MB4418.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 625d4de7-7174-486c-6d88-08d9eb2482bb X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Feb 2022 17:00:29.3069 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 8Hu5J4aYWzyw0V7HoMhtXxMvcSKLMgwpSehEvYrvq73U6o9myhVvm2v4rcR1UYE9S0zWUF9jz64UhkYVwIem/Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR18MB3505 X-Proofpoint-ORIG-GUID: k8FMSfBfsT3DLFBpbbYy5486C1Ue6Lm7 X-Proofpoint-GUID: k8FMSfBfsT3DLFBpbbYy5486C1Ue6Lm7 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-02-08_05,2022-02-07_02,2021-12-02_01 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 Abhinandan, >> > Subject: [PATCH v3] app/eventdev: add crypto producer mode >> > >> > In crypto producer mode, producer core enqueues cryptodev with >> > software generated crypto ops and worker core dequeues crypto >> > completion events from the eventdev. Event crypto metadata used for >> > above processing is pre- populated in each crypto session. >> > >> > Parameter --prod_type_cryptodev can be used to enable crypto producer >> > mode. Parameter --crypto_adptr_mode can be set to select the crypto >> > adapter mode, 0 for OP_NEW and 1 for OP_FORWARD. >> > >> > This mode can be used to measure the performance of crypto adapter. >> > >> > 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 >> > >> > Signed-off-by: Shijith Thotton >> > --- >> > v3: >> > * Reduce dereference inside loop. >> > >> > v2: >> > * Fix RHEL compilation warning. >> > >> > 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 | 410 >> > ++++++++++++++++++++++++++- 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, 596 insertions(+), 7 deletions(-) >> > >> > 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 @@ >> > >> > #include >> > #include >> > +#include >> > #include >> > #include >> > >> > + 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, >NULL check for op is missing =20 Not added as it is fast path to avoid performance drop. >> > + >> > 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, crypto_sess[flow_counter++ % nb_flows]); >> > + while (rte_cryptodev_enqueue_burst(cdev_id, 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) { >> > + struct rte_cryptodev_sym_session **crypto_sess =3D p->crypto_sess; >> > + 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; >So, this is an new event and adapter treats it as OP_FWD? >> > + 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, 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 the adapter OP_FWD is supported by rte_event_enqueue_burst(), then even >that path has to be tested. Please add it. =20 Added in patch to avoid software adapter. >> > + 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 +419,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; >> > } >> > >> > @@ -405,8 +528,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 +540,8 @@ perf_launch_lcores(struct evt_test *test, struct >> > evt_options *opt, >> > >> > 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 +663,96 @@ >> > perf_event_timer_adapter_setup(struct test_perf >> > *t) >> > return 0; >> > } >> > >> > +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; >It is good that you are covering even this case. Should not you fill event= with valid >values? =20 Done >> > + 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); >> > + } >New line =20 Done >> > + if (ret) >> > + return ret; >> > + } >> > + >> > + return 0; >> > +} >> > + >> > +static struct rte_cryptodev_sym_session * >> > +cryptodev_sym_sess_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 +814,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_sym_sess_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; >> > + } >New line =20 Done =20 Please ack v4 if there are no more comments. I tried adding support for software adapter implementation, but is getting = a crash in sw_event PMD after some packets. I have posted the respective chan= ges here: https://patchwork.dpdk.org/project/dpdk/patch/0677cbafa5145f1b9f64dd0= 07594e033f2d9ab8a.1644337310.git.sthotton@marvell.com/ Please take it forward. Command used to test is: dpdk-test-eventdev -l 0-8 -s 0xf0 --vdev=3Devent_sw0 --vdev=3D"crypto_null= " -- \ --prod_type_cryptodev --crypto_adptr_mode 1 --test=3Dperf_queue --stl= ist=3Da \ --wlcores 1 --plcores 2