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 04F8EA0C46; Tue, 31 Aug 2021 08:14:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A3D7F40687; Tue, 31 Aug 2021 08:14:41 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 06BB040141 for ; Tue, 31 Aug 2021 08:14:39 +0200 (CEST) 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 SMTP id 17V4YFvZ030371; Mon, 30 Aug 2021 23:14:32 -0700 Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2107.outbound.protection.outlook.com [104.47.58.107]) by mx0a-0016f401.pphosted.com with ESMTP id 3asdgxgabj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 Aug 2021 23:14:32 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PyfF/vFcPTMRij33OY3sXYhqHWDdWgV1fLEmzGGOwDGmFDtpCRDQI/7VsQ1wi8dadXVEBUOUSdITmiUvT/JdFCQH4jF8PlblSgFOU4V4u2BAX3x6+JNPj9VhNutVThuBMQHRR3kIevOaI+O7uW3TvydHEA+5mZKLsaXZb/Ovwa5QqT7RI6sYmyL2q55mGwitwW/YjXpxIZFCCOhhUWxa0kU6vCJtZh6TiWMIG8HvATG4WunKW53yYAGSW+TohAvnHihFWVbc0dUe2QPZKtxqhs4G5lrFAoeg8uG2+kuZDdos1O7BtP9dX6+Up9xQJF8cER0ICMAh1C8DFNTZ3BCwrA== 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-SenderADCheck; bh=hKMgG2OdScEn86QDbcXKAwc9MkLx/eges4fVoQfMQ0E=; b=jfjwlGxhSfy+55jNcTUR/xDlbbTC1ZA4C6SZlHH7jdAYFv0J64dvqcZaO8qEurQ0o9qz15czdeLSrbcYnx5vGrcnR1qU6iDlNxcZwg257aZ/CoTIAqgRxF4OTP8CuyIiaVs9ISggfbUi8uwRwj9YUeo9UPNTupUWffzxSFudofLuSP92IRjt+m/0FXVqZYJ3sB/xUBF1yWNnPUNl3yGjs/bHGaPHiQaFT1ZaB0c7+DKj8LqU5+q/6+WdMo2Gnz3BWc+GZXbTlK03f7o5Xn8f8SkZKJ2JK0qYpvpZ52/SdXFwOBMQi9jabjbc9mFQ/ceAFWzTgg5xA5GesNl3bb7Gyw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; 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=hKMgG2OdScEn86QDbcXKAwc9MkLx/eges4fVoQfMQ0E=; b=IgNaDYzWdNL7Ki2GNrHDtiwUGAYrQPNJJDLqvcqzUwNv6QloIM/bMccil2fHEuFOLUv8bnHsaP6f+yRxveUBnda7F7hYs3yVETWvrezmDPotTMSnCdlcaB804G6LNTlF5yQfy8pRflNH0X/bhda9D5sxU9/gXpUmjiBqCN6ayaI= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by CO1PR18MB4777.namprd18.prod.outlook.com (2603:10b6:303:ec::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.24; Tue, 31 Aug 2021 06:14:29 +0000 Received: from CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::411f:5b87:321e:de29]) by CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::411f:5b87:321e:de29%5]) with mapi id 15.20.4457.024; Tue, 31 Aug 2021 06:14:29 +0000 From: Akhil Goyal To: "Zhang, Roy Fan" , "dev@dpdk.org" CC: Anoob Joseph , "Nicolau, Radu" , "Doherty, Declan" , "hemant.agrawal@nxp.com" , "matan@nvidia.com" , "Ananyev, Konstantin" , "thomas@monjalon.net" , "asomalap@amd.com" , "ruifeng.wang@arm.com" , "ajit.khaparde@broadcom.com" , "De Lara Guarch, Pablo" , "Trahe, Fiona" , Ankur Dwivedi , Michael Shamis , Nagadheeraj Rottela , "jianjay.zhou@huawei.com" , Jerin Jacob Kollanukkaran Thread-Topic: [PATCH 3/8] cryptodev: add helper functions for new datapath interface Thread-Index: AQHXnNSv7YsSH1VC0UeRVc0/fBh+h6uMe7IAgACn8fA= Date: Tue, 31 Aug 2021 06:14:29 +0000 Message-ID: References: <20210829125139.2173235-1-gakhil@marvell.com> <20210829125139.2173235-4-gakhil@marvell.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=marvell.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: df2240e3-b2a5-4fec-d9ff-08d96c46979a x-ms-traffictypediagnostic: CO1PR18MB4777: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: NjfMaK7/MjQT0Vihn+8sGqwXn2NVOjeBEStrptiO0CfZpTu2WsSRrbrqKHNKPP0ShyZu7RgIg/bKO7ZIyExBwowlezv3+fWVlMY5vjU3dZ21+c9SEM+RgvONLMXZdZvKpFS7ZV6sASkk40ivkLC6emF9hviV57BW68++gRyxKtn9WslnFU/0DgTBCWB6A09dhLRfB9WwsTnz0jQfps7v55pgjijv4BuJqxQvFVLTFCvAj0zhgIJqmbvyayqzMXI41NJbp3bd4ebR1kNC2+MwRdQUXMGz9HrhdNdNP0xv7U/ISkHa6zoDiWZMgupxGRuy34ei4ddjoLt04Zqd7wOTw+1la0wKtefhWbAnFxvXN5bXwccqe3D+NQpFQ90ltKNRthqMHvI+rx7YbzmR6/pHUBI8Ib48YwbIe+ey8gfYPfy7ge2ZHlS246dyRAa6wF0SkFqLzGSlbGSWloZWtz6y3PTm2baa6IeQ+f9KJzlt/5dG7PREdwbpHksJW8Dl2yz7TblBLtcxuYM9D7tDQ3cSGWRPlIlhQpbvZys5smD2YsyNU1+J2IDQDy8U+0Yudsq6QlvyicabaDdY6b9nNqhkbXc52SzZqCk23KVji6JxK1MOZ75ExljxSWVPreCgCBLEWVLVGx3nYe4Rnz+5BG52S90Y/phHC4mewdElD8rOxjlq/3D/Tt2pa5uuugL84/s5iFYOrZXPUqhcRPyXLJavlg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR18MB4484.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(396003)(136003)(366004)(39860400002)(376002)(7416002)(7696005)(107886003)(33656002)(122000001)(38100700002)(4326008)(66476007)(71200400001)(5660300002)(83380400001)(478600001)(186003)(52536014)(8936002)(64756008)(8676002)(86362001)(66446008)(9686003)(316002)(6506007)(76116006)(2906002)(38070700005)(66946007)(110136005)(55016002)(66556008)(54906003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?pXpckyPKxkx4n8Z17M+v5Hk111XtW0iO0QDd5WCx3pM0ObSVuK9xwoLc4IsL?= =?us-ascii?Q?e69vItF19mbhcJnxw35JK4vU9s3Pf6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q?Edt1TugcQMrjTLCgzeeJUsDBAF88uj/lc85IUOoqO//8fbnRtJ/d/oVp1Uko?= =?us-ascii?Q?vCdpFXc0cdcIYniJJm9b+Hbh5wLUXbvcCtbop4yrC22umMBTMMHEZntBFbQQ?= =?us-ascii?Q?RGlwTYUrk3nlXsSEHBJ2S108RJ0TZR6LphGlUPTon8qxB3PfbFgj5/+QdyXx?= =?us-ascii?Q?lHnHTGcEmYUP8unGG0W02XNx8PMkvEvyOZaIAX2HAyNbsSrnPfCltBWq/8pO?= =?us-ascii?Q?obx7l/RyYdTGyLN8oY13BrzaF8XSjKkHC3efA87C2ujyZpM52Si4zlxZKZB8?= =?us-ascii?Q?eOsKyYOQgwTR1Tld0tSEzuLZvf6XR5zjZsWsMj8jKVD/alMWBAE8cfFFFwuC?= =?us-ascii?Q?iVfNJQA97BOZh5gkxvDyJLQxrE++tkQY/dJz0kyCVew5/0Sp7h26+X7OFZek?= =?us-ascii?Q?2u9A1Q/dwZy8GC5yDcMP9Bypx7DI?= 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: CO6PR18MB4484.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: df2240e3-b2a5-4fec-d9ff-08d96c46979a X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Aug 2021 06:14:29.5320 (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: KF9Pgjd4+ws8Uq6jom8khUoVggw+PPd1WiJOaEM7yXjzfmJ2pyRClHVMmCZ0W3dzPPv3c8s0omrlNojt+k7Eag== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR18MB4777 X-Proofpoint-ORIG-GUID: iOiY8OQYoxrGqpl7gcbmBxID-YRBWGt9 X-Proofpoint-GUID: iOiY8OQYoxrGqpl7gcbmBxID-YRBWGt9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475 definitions=2021-08-31_03,2021-08-30_01,2020-04-07_01 Subject: Re: [dpdk-dev] [PATCH 3/8] cryptodev: add helper functions for new datapath interface X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Fan, > Hi Akhil, >=20 > > +__rte_internal > > +static inline void * > > +_rte_cryptodev_dequeue_prolog(uint8_t dev_id, uint8_t qp_id) > > +{ > > + struct rte_cryptodev *dev =3D &rte_cryptodevs[dev_id]; > > + > > + return dev->data->queue_pairs[qp_id]; > > +} >=20 > [Fan: the function name looks unclear to me - maybe > rte_cryptodev_dequeue_prepare? The naming convention is same as Konstantin did for ethdev and Subsequently by Pavan in eventdev. I think it is better to align all With similar naming. > Also the function didn't do any check as the description suggested - the > qp is later checked in _RTE_CRYPTO_DEQ_DEF, maybe remove the > description?] >=20 Ok will update the description in next version > > +_rte_cryptodev_dequeue_epilog(uint16_t dev_id, uint16_t qp_id, > > + struct rte_crypto_op **ops, uint16_t nb_ops) > > +{ > > +#ifdef RTE_CRYPTO_CALLBACKS > > + struct rte_cryptodev *dev =3D &rte_cryptodevs[dev_id]; > > + > > + if (unlikely(dev->deq_cbs !=3D NULL)) { > > + struct rte_cryptodev_cb_rcu *list; > > + struct rte_cryptodev_cb *cb; > > + > > + /* __ATOMIC_RELEASE memory order was used when the > > + * call back was inserted into the list. > > + * Since there is a clear dependency between loading > > + * cb and cb->fn/cb->next, __ATOMIC_ACQUIRE memory > > order is > > + * not required. > > + */ > > + list =3D &dev->deq_cbs[qp_id]; > > + rte_rcu_qsbr_thread_online(list->qsbr, 0); > > + cb =3D __atomic_load_n(&list->next, __ATOMIC_RELAXED); > > + > > + while (cb !=3D NULL) { > > + nb_ops =3D cb->fn(dev_id, qp_id, ops, nb_ops, > > + cb->arg); > > + cb =3D cb->next; > > + }; > > + > > + rte_rcu_qsbr_thread_offline(list->qsbr, 0); > > + } > > +#endif > > + > > + return nb_ops; > > +} >=20 > [Fan: same naming issue - maybe rte_cryptodev_dequeue_post, so > as the enqueue part] Same comment as above. Aligned with ethdev and eventdev changes. >=20 > > +#define _RTE_CRYPTO_DEQ_FUNC(fn) _rte_crypto_deq_##fn > > + > > +/** > > + * @internal > > + * Helper macro to create new API wrappers for existing PMD dequeue > > functions. > > + */ > > +#define _RTE_CRYPTO_DEQ_PROTO(fn) \ > > + uint16_t _RTE_CRYPTO_DEQ_FUNC(fn)(uint8_t dev_id, uint8_t > > qp_id, \ > > + struct rte_crypto_op **ops, uint16_t nb_ops) > > + > > +/** > > + * @internal > > + * Helper macro to create new API wrappers for existing PMD dequeue > > functions. > > + */ > > +#define _RTE_CRYPTO_DEQ_DEF(fn) \ > > +_RTE_CRYPTO_DEQ_PROTO(fn) \ > > +{ \ > > + void *qp =3D _rte_cryptodev_dequeue_prolog(dev_id, qp_id); \ > > + if (qp =3D=3D NULL) \ > [Fan: suggest to add "unlikely" above] Ok