From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 98914A0524;
	Tue, 13 Apr 2021 05:23:30 +0200 (CEST)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 853DE1609E5;
	Tue, 13 Apr 2021 05:23:30 +0200 (CEST)
Received: from mga06.intel.com (mga06.intel.com [134.134.136.31])
 by mails.dpdk.org (Postfix) with ESMTP id 003911609E3
 for <dev@dpdk.org>; Tue, 13 Apr 2021 05:23:27 +0200 (CEST)
IronPort-SDR: VK4a0Rqr2nmuBaDQ1684oB+YfED6s0ntBOoxYtY58vpFiz3ZjBrZf8Od57/4DmJo0TenSu81i8
 utdnrTrhvwlw==
X-IronPort-AV: E=McAfee;i="6200,9189,9952"; a="255653969"
X-IronPort-AV: E=Sophos;i="5.82,218,1613462400"; d="scan'208";a="255653969"
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 12 Apr 2021 20:23:25 -0700
IronPort-SDR: Lw/8Zy9w3ao+L7ebJdg3eE+UpcnjiW9CcPF2QUfUkv+QLKs4QQl4bpHT22LbEXP7LU4+qcg8Q9
 FcaMeRfTDCBA==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.82,218,1613462400"; d="scan'208";a="521437409"
Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14])
 by fmsmga001.fm.intel.com with ESMTP; 12 Apr 2021 20:23:25 -0700
Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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.2106.2; Mon, 12 Apr 2021 20:23:24 -0700
Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by
 ORSMSX610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2106.2; Mon, 12 Apr 2021 20:23:24 -0700
Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by
 orsmsx611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2
 via Frontend Transport; Mon, 12 Apr 2021 20:23:24 -0700
Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.106)
 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.2106.2; Mon, 12 Apr 2021 20:23:24 -0700
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=LEKxMnQQiNpTDjbeT4rQXtf/M3tSOERN8uLRHgO4YmJHWsG/88VHVCwa1kK2feWuNQLUZSKh8HuQkbq7Paau/odMaTqhPq77FiDzNAFH5ZVJS/fPl7OwOwbCEkpCTWP2hQWDMsWf3fX3F9aZU0fNGmMefgqvUaeOg2AJooJHc6eqTjSzUT9/K0cin+p+FuWkWjvPGT0vr5wMSnavdbI5YMhag7kqWf+6akm+mOpiGINPmS2iieZf52EKq7gJfsFLoIa/o5ZjqjTTd9hLZaE9SnG63wmJCphn1k420aZSvahQUN9gnvmGGaqUl1uWfFpivCOkbKM8Jt/W4XpzzZkWnw==
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=+7O9x2Q9WbyUMElErNpkvV0vtfn4alhvZ0H7YJxm2Es=;
 b=Jx7cqnXB015xTt9Dw3jhxWh6LRo9qVhE0+/gMncgGDodZx/xkzgof4vKGdfmS+mkcV/HbFuYME/mdUdzqc2Y6+9d1UUBRRtGNTACte2BXwiQ1WlHQVo7jjWYmZlrNxenSyYwcyMijcfkHtXzmDw/K6vzslGxXXj1R/1+iFgA3Cmk/WBXfHUeVMuvahrVfHJAUrhM1vPwdRzLNzEX1JqPj6Z7jEoTv0svEehm1kJ0MMiwlNqAHasCS5PvchreY++fi1tuQ78jep7020pWexq8HkY263P7Tke568fLzaxZHwpobcXCAk35RBDfudcgM3h3PArqSAPCO5H8hx91+lNMZA==
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=+7O9x2Q9WbyUMElErNpkvV0vtfn4alhvZ0H7YJxm2Es=;
 b=NRMvGXL3YpjMGNPhBaQ7SucVAnF0MmgESgEc08QlBuwNPVHrJs4gzvJDr4u3kmsBLe8eW6g3r8bgLAS+3nUh/zcB78l4jk0A/69QSRjMSOzpKS7Sw0yhZNJencE5h4RguEhjM+Ms3Frg4ZymR1ZqVWMULlTkmXBktNKCWYQceOo=
Received: from DM6PR11MB3548.namprd11.prod.outlook.com (2603:10b6:5:143::18)
 by DM6PR11MB3324.namprd11.prod.outlook.com (2603:10b6:5:59::15) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.22; Tue, 13 Apr
 2021 03:23:21 +0000
Received: from DM6PR11MB3548.namprd11.prod.outlook.com
 ([fe80::b865:77e3:1509:e121]) by DM6PR11MB3548.namprd11.prod.outlook.com
 ([fe80::b865:77e3:1509:e121%3]) with mapi id 15.20.4020.022; Tue, 13 Apr 2021
 03:23:20 +0000
From: "Gujjar, Abhinandan S" <abhinandan.gujjar@intel.com>
To: Shijith Thotton <sthotton@marvell.com>, "dev@dpdk.org" <dev@dpdk.org>
CC: Akhil Goyal <gakhil@marvell.com>, "thomas@monjalon.net"
 <thomas@monjalon.net>, "jerinj@marvell.com" <jerinj@marvell.com>,
 "hemant.agrawal@nxp.com" <hemant.agrawal@nxp.com>, "nipun.gupta@nxp.com"
 <nipun.gupta@nxp.com>, "sachin.saxena@oss.nxp.com"
 <sachin.saxena@oss.nxp.com>, "anoobj@marvell.com" <anoobj@marvell.com>,
 "matan@nvidia.com" <matan@nvidia.com>, "Zhang, Roy Fan"
 <roy.fan.zhang@intel.com>, "g.singh@nxp.com" <g.singh@nxp.com>, "Carrillo,
 Erik G" <erik.g.carrillo@intel.com>, "Jayatheerthan, Jay"
 <jay.jayatheerthan@intel.com>, "pbhagavatula@marvell.com"
 <pbhagavatula@marvell.com>, "Van Haaren, Harry" <harry.van.haaren@intel.com>
Thread-Topic: [PATCH v7 1/3] eventdev: introduce crypto adapter enqueue API
Thread-Index: AQHXL2+yR7YjeMTPq027LtMX10M9m6qxx0Ow
Date: Tue, 13 Apr 2021 03:23:20 +0000
Message-ID: <DM6PR11MB35481FB91A5864AC829B1328E84F9@DM6PR11MB3548.namprd11.prod.outlook.com>
References: <cover.1617972131.git.sthotton@marvell.com>
 <cover.1618213226.git.sthotton@marvell.com>
 <fa974d2e3ba8339083f35d7e04d177346624b8fc.1618213226.git.sthotton@marvell.com>
In-Reply-To: <fa974d2e3ba8339083f35d7e04d177346624b8fc.1618213226.git.sthotton@marvell.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
authentication-results: marvell.com; dkim=none (message not signed)
 header.d=none;marvell.com; dmarc=none action=none header.from=intel.com;
x-originating-ip: [103.5.135.70]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 08b23926-311d-457a-6a96-08d8fe2b7d26
x-ms-traffictypediagnostic: DM6PR11MB3324:
x-ms-exchange-transport-forked: True
x-microsoft-antispam-prvs: <DM6PR11MB332431A9E44CE42576C8B34EE84F9@DM6PR11MB3324.namprd11.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:9508;
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: kGQLiiu0Z+e4YT0ufUPJ2dX6vHOYdBnf+pfzAas+79TwjT/ZT6mn+MNItZmDpTp/rGiZMnvKK3ZpnH+kT0k+DcP70b+h54zK+NFZ6R7c30syIz44nFKqZd23R1ElJz6AP6gApzcX/RJu5HIropbOJbo6PxWt/95dsfLWP6wy24iyboUocNoPm23v3toimwuyT97xjYLa9njieCv1W7O6Iznb5LFcAIhDj+JAQoZpIR/GZgootwzTWmVTHMiazPPMdOCLRhrJLCZMJzdPZOqwC+d41/37uZZDyGDLVLomX/NTu1sT+9L9T6U5WSm25HdHwD/e+DnLFCW3uw+WLOnbV9YSa+jW5ztbb88Tlh9oiczHxmUVIM+cFoWH6WvhLgavONyjjcxeSSRQ++JXQTukEtolz+MTUjfq+n6z0Pp9pPCybUerEVa1l3KX8F8pzuwmB+OQp8IvoaAJAPezsgbvawXtVMDB+oS+gvZNx43ceNGceWXDkJEH6OlpQS+kO+63TEidMxXGaavUdGLJTneMNsk+RS+Mw+9zE87tFNDxUNsU17/wvXxFFM2ef3AdJppqu/V9BWgiCVMpUw9lTtmbjsafPhVvCROiwdjP59FPuyg=
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
 IPV:NLI; SFV:NSPM; H:DM6PR11MB3548.namprd11.prod.outlook.com; PTR:; CAT:NONE;
 SFS:(39860400002)(396003)(136003)(366004)(346002)(376002)(83380400001)(86362001)(76116006)(6506007)(66946007)(66556008)(55236004)(66476007)(7696005)(66446008)(64756008)(33656002)(122000001)(71200400001)(55016002)(7416002)(110136005)(53546011)(9686003)(316002)(26005)(107886003)(186003)(8936002)(30864003)(478600001)(5660300002)(52536014)(4326008)(54906003)(2906002)(38100700002)(8676002);
 DIR:OUT; SFP:1102; 
x-ms-exchange-antispam-messagedata: =?us-ascii?Q?BP0oGN6EY9ZqdnsxO8HrAkUIDYnGdStgh/GapHBvE/6iJPm5irOOWDKAYRvo?=
 =?us-ascii?Q?KUpMSEE7sA5J/FhpXIJ9ZSqzCeov3G41rPdqqPXxfd6LztOA0CoKAui1MTI9?=
 =?us-ascii?Q?TODnLxdf8xNrSMR8aokaAxhTLCjzGUQakFK7jAb7kKHz3pS10pxMjG8Shq2L?=
 =?us-ascii?Q?5P3ThsxXRZL/df1CVdApiHQeaKlwKiSkdcERAfSSzB8R7nhHK92eH72uomAl?=
 =?us-ascii?Q?7nbs3xMk+r6wyt+UdAH/v9jYYNHP1I1wz3Y8fA4DdO+/U9GDToTCNeGlGX0g?=
 =?us-ascii?Q?yfV7CYpFXVCsVTZr2V8+W316OLxAo4veFToLu2ZS3hXwv4jmwb7HJFcDEaNq?=
 =?us-ascii?Q?QNZV8RPjkKzlWdtiKPme/ESk5Znzc10f45EAZO+SgnlDpsssS4qOhpFtqqSh?=
 =?us-ascii?Q?2Go/jBDpPaRLB+E9yJsvpB6DtnkQjwlaeFfvPtkZHWoKvmarY9fxa/1wPySA?=
 =?us-ascii?Q?54boneya28o+bMnJfa1mCrKdgYEz4aZ628QibSHSpd1YA3KXI6U6T0Gc5sZe?=
 =?us-ascii?Q?V8OyTNJa79B5WlXz3iPhdD8tc4dOo6PR+wCzLTMmQohQ7tMeM9Hdmicf43Jr?=
 =?us-ascii?Q?/eJVqOtV440tCv4utVhAOO2Z92v1ondkkFwKJP5Wox1JM/8uybdnvbQQhPq2?=
 =?us-ascii?Q?wPcf4sa4Bsnfl3t5RQBDXXpDF9zSjLLLBwtJ7UxSQd0wKmT9i5FX6ruYi+Sx?=
 =?us-ascii?Q?wZY8o81d79YoCrWLjZHIO+diwjoAlDOczBbzVZC0PHP/2LkCRDK8Kcmg4nNk?=
 =?us-ascii?Q?fpPlPrLfTN9Rci8MmJiSgXWzxq/8E6sYgozdAeRFBLm66PFBLca+cTKSHn4K?=
 =?us-ascii?Q?5mu0hzMFoZx5Phixa+S6cOVHNcNm6N3A8+BzrYF7e7Hbe5PUZuDuAzPDIPOn?=
 =?us-ascii?Q?2Z2r5npys7sPMZXSJtA6mWK+mpJkCjXAgrGkhudcjDAPHq1AtZFsnVTTeNjM?=
 =?us-ascii?Q?zW1P1ixPyOlOzZfphEv3Cx4ZV/i+YL3H4fAjDwxne+Zgn5RqxfBHgA9bRvVW?=
 =?us-ascii?Q?i41ku3lQP9TyAcIKSlptoxiy2uzq8k+Hs/rlwm/39su2bdYf8UJnc8zQOiLG?=
 =?us-ascii?Q?Qv4MRgsi/U6suD1Y/gr0/dkTQKSf9JVc++yr8A1AS+wryk1F8tdhm5+2ImqO?=
 =?us-ascii?Q?HFTJwhSdAxqDnYvnDggKZcvSrHUETtvxTc52FHbKe7P3jtX4KMGX9+hj7KZL?=
 =?us-ascii?Q?x75YXlrYneHXYlBWtUwPVeT6fuSTGH0PXh9TfJclaRJgVQlgpKm0+52PN4QG?=
 =?us-ascii?Q?Vyo5K0wbKox3FmRaAH26A7WDq/x/FOC2j7ZHoC0su9gJ+9yxAGvt8Jb+zpne?=
 =?us-ascii?Q?rr0=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: DM6PR11MB3548.namprd11.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 08b23926-311d-457a-6a96-08d8fe2b7d26
X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Apr 2021 03:23:20.7764 (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: qydVoWvwl5cy0YW1pSKQ/Cf648ybvstjmLue+ykg4KmnWMwBR7FHk4beZwdFAzJLuPBl9BPi6Ct326rcDCJnetxyQ3zybxU0Y8Wl5Ei+FKI=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3324
X-OriginatorOrg: intel.com
Subject: Re: [dpdk-dev] [PATCH v7 1/3] eventdev: introduce crypto adapter
 enqueue API
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>



> -----Original Message-----
> From: Shijith Thotton <sthotton@marvell.com>
> Sent: Monday, April 12, 2021 1:14 PM
> To: dev@dpdk.org
> Cc: Akhil Goyal <gakhil@marvell.com>; thomas@monjalon.net;
> jerinj@marvell.com; Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>;
> hemant.agrawal@nxp.com; nipun.gupta@nxp.com;
> sachin.saxena@oss.nxp.com; anoobj@marvell.com; matan@nvidia.com;
> Zhang, Roy Fan <roy.fan.zhang@intel.com>; g.singh@nxp.com; Carrillo, Erik
> G <erik.g.carrillo@intel.com>; Jayatheerthan, Jay
> <jay.jayatheerthan@intel.com>; pbhagavatula@marvell.com; Van Haaren,
> Harry <harry.van.haaren@intel.com>; Shijith Thotton
> <sthotton@marvell.com>
> Subject: [PATCH v7 1/3] eventdev: introduce crypto adapter enqueue API
>=20
> From: Akhil Goyal <gakhil@marvell.com>
>=20
> In case an event from a previous stage is required to be forwarded to a
> crypto adapter and PMD supports internal event port in crypto adapter,
> exposed via capability
> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD, we do not
> have a way to check in the API rte_event_enqueue_burst(), whether it is f=
or
> crypto adapter or for eth tx adapter.
>=20
> Hence we need a new API similar to rte_event_eth_tx_adapter_enqueue(),
> which can send to a crypto adapter.
>=20
> Note that RTE_EVENT_TYPE_* cannot be used to make that decision, as it is
> meant for event source and not event destination.
> And event port designated for crypto adapter is designed to be used for
> OP_NEW mode.
>=20
> Hence, in order to support an event PMD which has an internal event port =
in
> crypto adapter (RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode),
> exposed via capability
> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD,
> application should use rte_event_crypto_adapter_enqueue() API to
> enqueue events.
>=20
> When internal port is not available(RTE_EVENT_CRYPTO_ADAPTER_OP_NEW
> mode), application can use API rte_event_enqueue_burst() as it was doing
> earlier, i.e. retrieve event port used by crypto adapter and bind its eve=
nt
> queues to that port and enqueue events using the API
> rte_event_enqueue_burst().
>=20
> Signed-off-by: Akhil Goyal <gakhil@marvell.com>
> ---
>  .../prog_guide/event_crypto_adapter.rst       | 69 ++++++++++++-------
>  doc/guides/rel_notes/release_21_05.rst        |  6 ++
>  lib/librte_eventdev/eventdev_trace_points.c   |  3 +
>  .../rte_event_crypto_adapter.h                | 63 +++++++++++++++++
>  lib/librte_eventdev/rte_eventdev.c            | 10 +++
>  lib/librte_eventdev/rte_eventdev.h            |  8 ++-
>  lib/librte_eventdev/rte_eventdev_trace_fp.h   | 10 +++
>  lib/librte_eventdev/version.map               |  1 +
>  8 files changed, 143 insertions(+), 27 deletions(-)
>=20
> diff --git a/doc/guides/prog_guide/event_crypto_adapter.rst
> b/doc/guides/prog_guide/event_crypto_adapter.rst
> index 1e3eb7139..4fb5c688e 100644
> --- a/doc/guides/prog_guide/event_crypto_adapter.rst
> +++ b/doc/guides/prog_guide/event_crypto_adapter.rst
> @@ -55,21 +55,22 @@ which is needed to enqueue an event after the
> crypto operation is completed.
>  RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>=20
> -In the RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode, if HW supports
> -RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD capability
> the application -can directly submit the crypto operations to the cryptod=
ev.
> -If not, application retrieves crypto adapter's event port using
> -rte_event_crypto_adapter_event_port_get() API. Then, links its event -
> queue to this port and starts enqueuing crypto operations as events -to t=
he
> eventdev. The adapter then dequeues the events and submits the -crypto
> operations to the cryptodev. After the crypto completions, the -adapter
> enqueues events to the event device.
> -Application can use this mode, when ingress packet ordering is needed.
> -In this mode, events dequeued from the adapter will be treated as -
> forwarded events. The application needs to specify the cryptodev ID -and
> queue pair ID (request information) needed to enqueue a crypto -operation
> in addition to the event information (response information) -needed to
> enqueue an event after the crypto operation has completed.
> +In the ``RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD`` mode, if the event
> PMD
> +and crypto PMD supports internal event port
> +(``RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD``), the
> +application should use ``rte_event_crypto_adapter_enqueue()`` API to
> +enqueue crypto operations as events to crypto adapter. If not,
> +application retrieves crypto adapter's event port using
> +``rte_event_crypto_adapter_event_port_get()`` API, links its event
> +queue to this port and starts enqueuing crypto operations as events to
> +eventdev using ``rte_event_enqueue_burst()``. The adapter then
> dequeues
> +the events and submits the crypto operations to the cryptodev. After
> +the crypto operation is complete, the adapter enqueues events to the
> +event device. The application can use this mode when ingress packet
> +ordering is needed. In this mode, events dequeued from the adapter will
> +be treated as forwarded events. The application needs to specify the
> +cryptodev ID and queue pair ID (request information) needed to enqueue
> +a crypto operation in addition to the event information (response
> +information) needed to enqueue an event after the crypto operation has
> +completed.
>=20
>  .. _figure_event_crypto_adapter_op_forward:
>=20
> @@ -120,28 +121,44 @@ service function and needs to create an event port
> for it. The callback is  expected to fill the ``struct
> rte_event_crypto_adapter_conf`` structure  passed to it.
>=20
> -For RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode, the event port
> created by adapter -can be retrieved using
> ``rte_event_crypto_adapter_event_port_get()`` API.
> -Application can use this event port to link with event queue on which it=
 -
> enqueues events towards the crypto adapter.
> +In the ``RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD`` mode, if the event
> PMD
> +and crypto PMD supports internal event port
> +(``RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD``),
> events with
> +crypto operations should be enqueued to the crypto adapter using
> +``rte_event_crypto_adapter_enqueue()`` API. If not, the event port
> +created by the adapter can be retrieved using
> +``rte_event_crypto_adapter_event_port_get()``
> +API. An application can use this event port to link with an event
> +queue, on which it enqueues events towards the crypto adapter using
> +``rte_event_enqueue_burst()``.
>=20
>  .. code-block:: c
>=20
> -        uint8_t id, evdev, crypto_ev_port_id, app_qid;
> +        uint8_t id, evdev_id, cdev_id, crypto_ev_port_id, app_qid;
>          struct rte_event ev;
> +        uint32_t cap;
>          int ret;
>=20
> -        ret =3D rte_event_crypto_adapter_event_port_get(id,
> &crypto_ev_port_id);
> -        ret =3D rte_event_queue_setup(evdev, app_qid, NULL);
> -        ret =3D rte_event_port_link(evdev, crypto_ev_port_id, &app_qid, =
NULL,
> 1);
> -
>          // Fill in event info and update event_ptr with rte_crypto_op
>          memset(&ev, 0, sizeof(ev));
> -        ev.queue_id =3D app_qid;
>          .
>          .
>          ev.event_ptr =3D op;
> -        ret =3D rte_event_enqueue_burst(evdev, app_ev_port_id, ev,
> nb_events);
> +
> +        ret =3D rte_event_crypto_adapter_caps_get(evdev_id, cdev_id, &ca=
p);
> +        if (cap &
> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) {
> +                ret =3D rte_event_crypto_adapter_enqueue(evdev_id,
> app_ev_port_id,
> +                                                       ev, nb_events);
> +        } else {
> +                ret =3D rte_event_crypto_adapter_event_port_get(id,
> +                                                        &crypto_ev_port_=
id);
> +                ret =3D rte_event_queue_setup(evdev_id, app_qid, NULL);
> +                ret =3D rte_event_port_link(evdev_id, crypto_ev_port_id,=
 &app_qid,
> +                                          NULL, 1);
> +                ev.queue_id =3D app_qid;
> +                ret =3D rte_event_enqueue_burst(evdev_id, app_ev_port_id=
, ev,
> +                                              nb_events);
> +        }
> +
>=20
>  Querying adapter capabilities
>  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> diff --git a/doc/guides/rel_notes/release_21_05.rst
> b/doc/guides/rel_notes/release_21_05.rst
> index fbb3c5975..5ad107ae3 100644
> --- a/doc/guides/rel_notes/release_21_05.rst
> +++ b/doc/guides/rel_notes/release_21_05.rst
> @@ -169,6 +169,12 @@ New Features
>      the events across multiple stages.
>    * This also reduces the scheduling overhead on a event device.
>=20
> +* **Enhanced crypto adapter forward mode.**
> +
> +  * Added ``rte_event_crypto_adapter_enqueue()`` API to enqueue events
> to crypto
> +    adapter if forward mode is supported by driver.
> +  * Added support for crypto adapter forward mode in octeontx2 event and
> crypto
> +    device driver.
>=20
>  Removed Items
>  -------------
> diff --git a/lib/librte_eventdev/eventdev_trace_points.c
> b/lib/librte_eventdev/eventdev_trace_points.c
> index 1a0ccc448..3867ec800 100644
> --- a/lib/librte_eventdev/eventdev_trace_points.c
> +++ b/lib/librte_eventdev/eventdev_trace_points.c
> @@ -118,3 +118,6 @@
> RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_crypto_adapter_start,
>=20
>  RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_crypto_adapter_stop,
>  	lib.eventdev.crypto.stop)
> +
> +RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_crypto_adapter_enque
> ue,
> +	lib.eventdev.crypto.enq)
> diff --git a/lib/librte_eventdev/rte_event_crypto_adapter.h
> b/lib/librte_eventdev/rte_event_crypto_adapter.h
> index 60630ef66..a4a4129b7 100644
> --- a/lib/librte_eventdev/rte_event_crypto_adapter.h
> +++ b/lib/librte_eventdev/rte_event_crypto_adapter.h
> @@ -171,6 +171,7 @@ extern "C" {
>  #include <stdint.h>
>=20
>  #include "rte_eventdev.h"
> +#include "eventdev_pmd.h"
>=20
>  /**
>   * Crypto event adapter mode
> @@ -522,6 +523,68 @@ rte_event_crypto_adapter_service_id_get(uint8_t
> id, uint32_t *service_id);  int
> rte_event_crypto_adapter_event_port_get(uint8_t id, uint8_t
> *event_port_id);
>=20
> +/**
> + * Enqueue a burst of crypto operations as events object supplied in
This is till not updated. events object -> event objects.

> +*rte_event*
> + * structure on an event crypto adapter designated by its event
> +*dev_id* through
> + * the event port specified by *port_id*. This function is supported if
> +the
> + * eventdev PMD has the
> +#RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD
> + * capability flag set.
> + *
> + * The *nb_events* parameter is the number of event objects to enqueue
> +which are
> + * supplied in the *ev* array of *rte_event* structure.
> + *
> + * The rte_event_crypto_adapter_enqueue() function returns the number
> +of
> + * events objects it actually enqueued. A return value equal to
Same here. events object - > event objects

With this you can add Acked-by: Abhinandan.gujjar@intel.com


> +*nb_events*
> + * means that all event objects have been enqueued.
> + *
> + * @param dev_id
> + *  The identifier of the device.
> + * @param port_id
> + *  The identifier of the event port.
> + * @param ev
> + *  Points to an array of *nb_events* objects of type *rte_event*
> +structure
> + *  which contain the event object enqueue operations to be processed.
> + * @param nb_events
> + *  The number of event objects to enqueue, typically number of
> + *  rte_event_port_attr_get(...RTE_EVENT_PORT_ATTR_ENQ_DEPTH...)
> + *  available for this port.
> + *
> + * @return
> + *   The number of event objects actually enqueued on the event device.
> The
> + *   return value can be less than the value of the *nb_events* paramete=
r
> when
> + *   the event devices queue is full or if invalid parameters are specif=
ied in a
> + *   *rte_event*. If the return value is less than *nb_events*, the rema=
ining
> + *   events at the end of ev[] are not consumed and the caller has to ta=
ke
> care
> + *   of them, and rte_errno is set accordingly. Possible errno values in=
clude:
> + *   - EINVAL   The port ID is invalid, device ID is invalid, an event's=
 queue
> + *              ID is invalid, or an event's sched type doesn't match th=
e
> + *              capabilities of the destination queue.
> + *   - ENOSPC   The event port was backpressured and unable to enqueue
> + *              one or more events. This error code is only applicable t=
o
> + *              closed systems.
> + */
> +static inline uint16_t
> +rte_event_crypto_adapter_enqueue(uint8_t dev_id,
> +				uint8_t port_id,
> +				struct rte_event ev[],
> +				uint16_t nb_events)
> +{
> +	const struct rte_eventdev *dev =3D &rte_eventdevs[dev_id];
> +
> +#ifdef RTE_LIBRTE_EVENTDEV_DEBUG
> +	RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);
> +
> +	if (port_id >=3D dev->data->nb_ports) {
> +		rte_errno =3D EINVAL;
> +		return 0;
> +	}
> +#endif
> +	rte_eventdev_trace_crypto_adapter_enqueue(dev_id, port_id, ev,
> +		nb_events);
> +
> +	return dev->ca_enqueue(dev->data->ports[port_id], ev,
> nb_events); }
> +
>  #ifdef __cplusplus
>  }
>  #endif
> diff --git a/lib/librte_eventdev/rte_eventdev.c
> b/lib/librte_eventdev/rte_eventdev.c
> index c9bb5d227..594dd5e75 100644
> --- a/lib/librte_eventdev/rte_eventdev.c
> +++ b/lib/librte_eventdev/rte_eventdev.c
> @@ -1454,6 +1454,15 @@ rte_event_tx_adapter_enqueue(__rte_unused
> void *port,
>  	return 0;
>  }
>=20
> +static uint16_t
> +rte_event_crypto_adapter_enqueue(__rte_unused void *port,
> +			__rte_unused struct rte_event ev[],
> +			__rte_unused uint16_t nb_events)
> +{
> +	rte_errno =3D ENOTSUP;
> +	return 0;
> +}
> +
>  struct rte_eventdev *
>  rte_event_pmd_allocate(const char *name, int socket_id)  { @@ -1476,6
> +1485,7 @@ rte_event_pmd_allocate(const char *name, int socket_id)
>=20
>  	eventdev->txa_enqueue =3D rte_event_tx_adapter_enqueue;
>  	eventdev->txa_enqueue_same_dest =3D
> rte_event_tx_adapter_enqueue;
> +	eventdev->ca_enqueue =3D rte_event_crypto_adapter_enqueue;
>=20
>  	if (eventdev->data =3D=3D NULL) {
>  		struct rte_eventdev_data *eventdev_data =3D NULL; diff --git
> a/lib/librte_eventdev/rte_eventdev.h
> b/lib/librte_eventdev/rte_eventdev.h
> index 5f1f544cc..477a59461 100644
> --- a/lib/librte_eventdev/rte_eventdev.h
> +++ b/lib/librte_eventdev/rte_eventdev.h
> @@ -1352,6 +1352,10 @@ typedef uint16_t
> (*event_tx_adapter_enqueue_same_dest)(void *port,
>   * burst having same destination Ethernet port & Tx queue.
>   */
>=20
> +typedef uint16_t (*event_crypto_adapter_enqueue)(void *port,
> +				struct rte_event ev[], uint16_t nb_events);
> /**< @internal Enqueue
> +burst of events on crypto adapter */
> +
>  #define RTE_EVENTDEV_NAME_MAX_LEN	(64)
>  /**< @internal Max length of name of event PMD */
>=20
> @@ -1423,6 +1427,8 @@ struct rte_eventdev {
>  	 */
>  	event_tx_adapter_enqueue txa_enqueue;
>  	/**< Pointer to PMD eth Tx adapter enqueue function. */
> +	event_crypto_adapter_enqueue ca_enqueue;
> +	/**< Pointer to PMD crypto adapter enqueue function. */
>  	struct rte_eventdev_data *data;
>  	/**< Pointer to device data */
>  	struct rte_eventdev_ops *dev_ops;
> @@ -1435,7 +1441,7 @@ struct rte_eventdev {
>  	/**< Flag indicating the device is attached */
>=20
>  	uint64_t reserved_64s[4]; /**< Reserved for future fields */
> -	void *reserved_ptrs[4];   /**< Reserved for future fields */
> +	void *reserved_ptrs[3];   /**< Reserved for future fields */
>  } __rte_cache_aligned;
>=20
>  extern struct rte_eventdev *rte_eventdevs; diff --git
> a/lib/librte_eventdev/rte_eventdev_trace_fp.h
> b/lib/librte_eventdev/rte_eventdev_trace_fp.h
> index 349129c0f..5639e0b83 100644
> --- a/lib/librte_eventdev/rte_eventdev_trace_fp.h
> +++ b/lib/librte_eventdev/rte_eventdev_trace_fp.h
> @@ -49,6 +49,16 @@ RTE_TRACE_POINT_FP(
>  	rte_trace_point_emit_u8(flags);
>  )
>=20
> +RTE_TRACE_POINT_FP(
> +	rte_eventdev_trace_crypto_adapter_enqueue,
> +	RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint8_t port_id, void
> *ev_table,
> +		uint16_t nb_events),
> +	rte_trace_point_emit_u8(dev_id);
> +	rte_trace_point_emit_u8(port_id);
> +	rte_trace_point_emit_ptr(ev_table);
> +	rte_trace_point_emit_u16(nb_events);
> +)
> +
>  RTE_TRACE_POINT_FP(
>  	rte_eventdev_trace_timer_arm_burst,
>  	RTE_TRACE_POINT_ARGS(const void *adapter, void **evtims_table,
> diff --git a/lib/librte_eventdev/version.map
> b/lib/librte_eventdev/version.map index 902df0ae3..7e264d3b8 100644
> --- a/lib/librte_eventdev/version.map
> +++ b/lib/librte_eventdev/version.map
> @@ -143,6 +143,7 @@ EXPERIMENTAL {
>  	rte_event_vector_pool_create;
>  	rte_event_eth_rx_adapter_vector_limits_get;
>  	rte_event_eth_rx_adapter_queue_event_vector_config;
> +	__rte_eventdev_trace_crypto_adapter_enqueue;
>  };
>=20
>  INTERNAL {
> --
> 2.25.1