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 3B7EEA034F; Mon, 11 Oct 2021 16:54:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2B1AF410D7; Mon, 11 Oct 2021 16:54:34 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 2282240E50 for ; Mon, 11 Oct 2021 16:54:31 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10134"; a="224303873" X-IronPort-AV: E=Sophos;i="5.85,364,1624345200"; d="scan'208";a="224303873" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2021 07:54:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,364,1624345200"; d="scan'208";a="591356662" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga004.jf.intel.com with ESMTP; 11 Oct 2021 07:54:28 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 11 Oct 2021 07:54:28 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Mon, 11 Oct 2021 07:54:28 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.46) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Mon, 11 Oct 2021 07:54:27 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EjH9gk6IZNW28LJoxHMBybyahXDKI3tIueM6UsN9K1kA5IkBDcLKxOc0/sblsFZtnSoZ2LOPUEjB3kVYp6+bTPvqU7nqCiX73882zmi3vrZsH4YeiqmzbZ8wHnk+1a9mI5LHjf4MylHgtqeglnEfp0BM0y9X6n+xlr2zyPYblK/TdYm1M/bkB5CIpknnsUqmn6zvWYOhi4Wy+DXCy38TEFJCYiDmqErtLSlZOI2SvIQTYssh6WoJ94KqRVOlNC2EQ2FNfZDxU3mP7zjNBlOeeg5dpl15FW022cLWknZZyYeQHELF/uS/pkaMSPH6PXwrL0jy9rtKlzsYLII9c3+Irg== 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=SlAbrQ2G+MpQ36oQwQCtl8PkFHqkWtX8rcW3LPPKLLc=; b=R5PmLIiofJkxRfuYjGa1999uEbgmD9oa/6CPVsvhlAduQQnC2VEn2i+9rnXKFUvtlBVyCxxbloA/Qyu6hLikOK6MWZqw0D1UZUgABUzqScgVAEwxsp0E7m3kP6ecPpzK6udx4ujHKS72pCkxMY7FmKEynUWVdB32V21i31bEO5HwT/JJxXxq52Jkmvuu2ubGA5fXNuheLhbZRljPEVbT0IhrRJdV6RBkpGo2mvARMaYcxui+tVv/XKr81Ty75PfG1oZUn9Ao4AlBznsk6Es3WD2RSE/ca1lsGKOlPiM7AjM4BDWYTbktccVRr5iAbX+vGNH/4tn095o8kzpjsVUQEw== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SlAbrQ2G+MpQ36oQwQCtl8PkFHqkWtX8rcW3LPPKLLc=; b=UQh7Yf/AhEMKMFCYL/lTTjkOedeBIFDCqjqEBQB/Rq1t+7upm9zJFnHXjOcZRbPKxzsdmMhGUT/KpqBcFrJY1fh7sUsKlhX4tXaT2tSA0cYohyQdYisfWvxblbf8580qAATky3vbpj3rBlrG9IOUUofIzcSvC31ahmosIAQNMuM= Received: from MW5PR11MB5809.namprd11.prod.outlook.com (2603:10b6:303:197::6) by MW4PR11MB5824.namprd11.prod.outlook.com (2603:10b6:303:187::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.20; Mon, 11 Oct 2021 14:54:26 +0000 Received: from MW5PR11MB5809.namprd11.prod.outlook.com ([fe80::2c31:1470:3036:959b]) by MW5PR11MB5809.namprd11.prod.outlook.com ([fe80::2c31:1470:3036:959b%6]) with mapi id 15.20.4587.026; Mon, 11 Oct 2021 14:54:26 +0000 From: "Zhang, Roy Fan" To: Akhil Goyal , "dev@dpdk.org" CC: "thomas@monjalon.net" , "david.marchand@redhat.com" , "hemant.agrawal@nxp.com" , "anoobj@marvell.com" , "De Lara Guarch, Pablo" , "Trahe, Fiona" , "Doherty, Declan" , "matan@nvidia.com" , "g.singh@nxp.com" , "jianjay.zhou@huawei.com" , "asomalap@amd.com" , "ruifeng.wang@arm.com" , "Ananyev, Konstantin" , "Nicolau, Radu" , "ajit.khaparde@broadcom.com" , "rnagadheeraj@marvell.com" , "adwivedi@marvell.com" , "Power, Ciara" Thread-Topic: [PATCH v2 4/5] cryptodev: update fast path APIs to use new flat array Thread-Index: AQHXvp2rlH50pl9LCEm8X/z40lr4w6vN4bQg Date: Mon, 11 Oct 2021 14:54:26 +0000 Message-ID: References: <20210829125139.2173235-1-gakhil@marvell.com> <20211011124309.4066491-1-gakhil@marvell.com> <20211011124309.4066491-5-gakhil@marvell.com> In-Reply-To: <20211011124309.4066491-5-gakhil@marvell.com> Accept-Language: zh-Hans-HK, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.200.16 dlp-reaction: no-action dlp-product: dlpe-windows authentication-results: marvell.com; dkim=none (message not signed) header.d=none;marvell.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: dbfde0a6-5f3b-48a3-84b1-08d98cc70540 x-ms-traffictypediagnostic: MW4PR11MB5824: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ojIvZqD5r8kXgC60xiJ2hxlO7XRXffDdASiUIxa51GdrbS4xDGPfenErQr8zlVTv6bW3n1jEKkoOk1jOqCyF/S+/h9l3ucf05Oqc2VmD5AkldBG5dlFl1tgthIb7KTIoXLreBJzSX8UOrIuJ8VrbMLLyIjYcz32umJq0W3b2tfzXgnT7kZ8qtmJgW4t+g2J5BlNHASZaHu2fZCh61io70tXyGsHYRM4rt4f2sifUHEcVERKwn9cJEM+UKVUAt2rB7d92L5vmOE0DSmxrkKJ3CFJ5VKxW1mIr9aRBIYNib5/p+bNHUHJpyEjzZnQ7vWiBwQiWfCXonQT2QgGfwfMOawX2x12209GzsC0Qng4iUMyJDe2xxwFaF4tVqS1hMh5Po+uriHHPVm8cYQWSXccHpAkGIZJWgscgGdAhkCTwPPwoPY28sCd3iPA1u9o7VhC7ewcP4ZdLZ1F/A8TQuYljK6tsHkKssFZWsMV1uyNbHsmRnHZqHHXG47OjKspDomaigKQ4dtgTxVWFHPDsBjrdOfSrf0lFuEJYOFWEZzvXd0ej29YEJ3TyEuk0oZtHTN4703ULOCSUdVOVyAFghqFIKxOOrUeKaPz89UKr7pvX9g1lWFTjXIZc4DzqzMX+PIb2DidkI6U2uZxDsjVi2csMs5AN0eTmdwvy4m9NVO6cZT+Knli2u9wIisEfwYR9OYqKRdGkOQnGrwjEWrkH9qy2PA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW5PR11MB5809.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(83380400001)(5660300002)(8936002)(71200400001)(38070700005)(55016002)(26005)(9686003)(52536014)(33656002)(54906003)(8676002)(86362001)(4326008)(508600001)(110136005)(66556008)(66446008)(64756008)(76116006)(38100700002)(316002)(107886003)(2906002)(7416002)(186003)(15650500001)(122000001)(66946007)(66476007)(7696005)(6506007)(53546011); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?Windows-1252?Q?9MxrznuLSyLjG4+Abi8/AIYVKcAkYqb3uSrORIiTlSU5UYo1H4Nu3w8i?= =?Windows-1252?Q?KAwjUjaEMkoiH78n7X7wEpwHuuDGwkPu7RA7G2S8aKkVDi5c0EqOJz58?= =?Windows-1252?Q?qYT6SI29ybVVjEIlCCdvr8NklHCoJe8NxBOADw7DAyQ7Z57HrX5NuT+X?= =?Windows-1252?Q?HWVgHs87JydKKG4wnYKBwhaYDvDMk9VFV+/BzilcNNgzmShg8tMVJ+Ne?= =?Windows-1252?Q?WOXYW2Ha4fD8ZFcCJxDoSW5oW2+97stZAIn0yZK77qylfsrGgGEN8lSo?= =?Windows-1252?Q?/lbQ+ZqcFHiTys0ufGffVN9Ce5dOYszKds6sD2dpLdFGhM8IcXGLwaY4?= =?Windows-1252?Q?9rUp7LF1cPD+MzcvbaafdgyRnhBPMoGosptmcajnZjQ3MAri+aAbdLDC?= =?Windows-1252?Q?hJfGbfDHelf6fAmTRYdQINp+VDcqv9IHG8lCfNti+YtfxZKlGZqIvfvq?= =?Windows-1252?Q?ZwERtTCP/Me2inOIFgE5FXbc+wCjlzJQyBkAtO9VEzBq3qXT9Jy5vC4g?= =?Windows-1252?Q?LPJEVFf+PffFko411v0Un8axr4Y7r9bbJFKu0uPA2MNyFoYmkdlDd2M4?= =?Windows-1252?Q?/qtsxXkoTK8TM+6lGXno+SKFk1HwIXE9xGgrdN7une2BmYDDwjZ4CBvk?= =?Windows-1252?Q?x21e5qMO5VlaNQohdrKg+vPKS2ar8sL79aTbKr998+fneBDRi1F3bHXx?= =?Windows-1252?Q?Qd4UdF7+patRdum2DXc9nfgRDDTIV0IDTgRJZ9MLt22R1qt5NAv9O4MB?= =?Windows-1252?Q?UbK6JEYbp1FVQ+UZz1ttcA34gSL4ytfzmMrxHfbsqBp6tP1Fhpg75rTl?= =?Windows-1252?Q?KhMgrsY9CWQfZUnQ0P2OQz9pcwInHgj8Oggs5fThgu3t3US4iXURpBJr?= =?Windows-1252?Q?l7VvJAZ86aPY2ztnJx8Bs1OlF6cGagi5TOTdBWua1sQdiJRS/QyjnyND?= =?Windows-1252?Q?j57Wl9/IGuxUmQtE91sfWfNlR/poJxPsuPZD5L03zkxlmWUzt6AbFm68?= =?Windows-1252?Q?RArB+O5u5KqQxtFxGJIJuX3z/8bLR9r4s/yHLWFtMsgmZIBmB05sW2lP?= =?Windows-1252?Q?v1nQkRWFTt0W+edP5HciPDGBgR3F3atpdBfqQAkKIF4MeUpnGs2eQhxW?= =?Windows-1252?Q?/nbvzvRV2+9tgl/B9lfvo8Jli2K9IJrdgwXgrf0UvSkIE31O5q3OsvMm?= =?Windows-1252?Q?9tsp7OQwALzZRjJ2sx0sa1hGAGk1BrmcSpRfd6kQa66jOB4adDEbv7fA?= =?Windows-1252?Q?SIAdsWm7mcXUG/VZXrCtym2xE9JEWXNGm/QZeujmWAF2mOZZO0c9SqdN?= =?Windows-1252?Q?6jo5zdBSFt2sKRgysiKZ7pn4iqgR1nLuBvyzLK/MEvhWi+mvS5zQBXDo?= =?Windows-1252?Q?l0Qo8XwLD4AWcEjtNx/qDm0+aZO8NAWus82z2aMnO42qfwyOU8xhRL+p?= Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW5PR11MB5809.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: dbfde0a6-5f3b-48a3-84b1-08d98cc70540 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Oct 2021 14:54:26.2039 (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: wo7qt05yhfe7n93FD9H8cMAb1jtFXXqQbdYnbohNAzIlElicFeOFISEH/kGG3FJ2P6LYI/iOt78YPMaYg2RGDg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR11MB5824 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2 4/5] cryptodev: update fast path APIs to use new flat array 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 Akhil, > -----Original Message----- > From: Akhil Goyal > Sent: Monday, October 11, 2021 1:43 PM > To: dev@dpdk.org > Cc: thomas@monjalon.net; david.marchand@redhat.com; > hemant.agrawal@nxp.com; anoobj@marvell.com; De Lara Guarch, Pablo > ; Trahe, Fiona ; > Doherty, Declan ; matan@nvidia.com; > g.singh@nxp.com; Zhang, Roy Fan ; > jianjay.zhou@huawei.com; asomalap@amd.com; ruifeng.wang@arm.com; > Ananyev, Konstantin ; Nicolau, Radu > ; ajit.khaparde@broadcom.com; > rnagadheeraj@marvell.com; adwivedi@marvell.com; Power, Ciara > ; Akhil Goyal > Subject: [PATCH v2 4/5] cryptodev: update fast path APIs to use new flat > array >=20 > Rework fast-path cryptodev functions to use rte_crypto_fp_ops[]. > While it is an API/ABI breakage, this change is intended to be > transparent for both users (no changes in user app is required) and > PMD developers (no changes in PMD is required). >=20 > Signed-off-by: Akhil Goyal > --- > lib/cryptodev/rte_cryptodev.h | 27 +++++++++++++++++---------- > 1 file changed, 17 insertions(+), 10 deletions(-) >=20 > diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.= h > index ce0dca72be..739ad529e5 100644 > --- a/lib/cryptodev/rte_cryptodev.h > +++ b/lib/cryptodev/rte_cryptodev.h > @@ -1832,13 +1832,18 @@ static inline uint16_t > rte_cryptodev_dequeue_burst(uint8_t dev_id, uint16_t qp_id, > struct rte_crypto_op **ops, uint16_t nb_ops) > { > - struct rte_cryptodev *dev =3D &rte_cryptodevs[dev_id]; > + struct rte_crypto_fp_ops *fp_ops; We may need to use const for fp_ops since we only call the function pointer= s in it. =20 > + void *qp; >=20 > rte_cryptodev_trace_dequeue_burst(dev_id, qp_id, (void **)ops, > nb_ops); > - nb_ops =3D (*dev->dequeue_burst) > - (dev->data->queue_pairs[qp_id], ops, nb_ops); > + > + fp_ops =3D &rte_crypto_fp_ops[dev_id]; > + qp =3D fp_ops->qp.data[qp_id]; > + > + nb_ops =3D fp_ops->dequeue_burst(qp, ops, nb_ops); > + > #ifdef RTE_CRYPTO_CALLBACKS > - if (unlikely(dev->deq_cbs !=3D NULL)) { > + if (unlikely(fp_ops->qp.deq_cb !=3D NULL)) { > struct rte_cryptodev_cb_rcu *list; > struct rte_cryptodev_cb *cb; >=20 > @@ -1848,7 +1853,7 @@ rte_cryptodev_dequeue_burst(uint8_t dev_id, > uint16_t qp_id, > * cb and cb->fn/cb->next, __ATOMIC_ACQUIRE memory > order is > * not required. > */ > - list =3D &dev->deq_cbs[qp_id]; > + list =3D (struct rte_cryptodev_cb_rcu *)&fp_ops- > >qp.deq_cb[qp_id]; > rte_rcu_qsbr_thread_online(list->qsbr, 0); > cb =3D __atomic_load_n(&list->next, __ATOMIC_RELAXED); >=20 > @@ -1899,10 +1904,13 @@ static inline uint16_t > rte_cryptodev_enqueue_burst(uint8_t dev_id, uint16_t qp_id, > struct rte_crypto_op **ops, uint16_t nb_ops) > { > - struct rte_cryptodev *dev =3D &rte_cryptodevs[dev_id]; > + struct rte_crypto_fp_ops *fp_ops; Same as above > + void *qp; >=20 > + fp_ops =3D &rte_crypto_fp_ops[dev_id]; > + qp =3D fp_ops->qp.data[qp_id]; > #ifdef RTE_CRYPTO_CALLBACKS > - if (unlikely(dev->enq_cbs !=3D NULL)) { > + if (unlikely(fp_ops->qp.enq_cb !=3D NULL)) { > struct rte_cryptodev_cb_rcu *list; > struct rte_cryptodev_cb *cb; >=20 > @@ -1912,7 +1920,7 @@ rte_cryptodev_enqueue_burst(uint8_t dev_id, > uint16_t qp_id, > * cb and cb->fn/cb->next, __ATOMIC_ACQUIRE memory > order is > * not required. > */ > - list =3D &dev->enq_cbs[qp_id]; > + list =3D (struct rte_cryptodev_cb_rcu *)&fp_ops- > >qp.enq_cb[qp_id]; > rte_rcu_qsbr_thread_online(list->qsbr, 0); > cb =3D __atomic_load_n(&list->next, __ATOMIC_RELAXED); >=20 > @@ -1927,8 +1935,7 @@ rte_cryptodev_enqueue_burst(uint8_t dev_id, > uint16_t qp_id, > #endif >=20 > rte_cryptodev_trace_enqueue_burst(dev_id, qp_id, (void **)ops, > nb_ops); > - return (*dev->enqueue_burst)( > - dev->data->queue_pairs[qp_id], ops, nb_ops); > + return fp_ops->enqueue_burst(qp, ops, nb_ops); > } >=20 >=20 > -- > 2.25.1 Other than the minor comments above Acked-by: Fan Zhang