From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0076.outbound.protection.outlook.com [104.47.0.76]) by dpdk.org (Postfix) with ESMTP id 8B8D15F17 for ; Thu, 26 Apr 2018 09:17:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=UMh8Wa+ilHurnWLIe2iDiCIP7dppJJ+HMyniZeL2RNM=; b=FRdG2sBA0LiWI30e/NpbyUxeXw3RaQDCc3aUc8ElzotleP7Mj+qO33jbKPl77TcYkwMkEGvquiStA76UpOlumyWiJAVGrVOb/Q0RVERfVBXfrrGTX4kDC0uvrCYV/5w1SmwiZmehUWkOwdtnN6+aW6BMy0Gdu+iDWiF4R3Vk4oI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=akhil.goyal@nxp.com; Received: from [10.232.134.49] (14.142.187.166) by VI1PR04MB1391.eurprd04.prod.outlook.com (2a01:111:e400:5348::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.13; Thu, 26 Apr 2018 07:16:58 +0000 To: "Gujjar, Abhinandan S" , Akhil Goyal , "jerin.jacob@caviumnetworks.com" , "hemant.agrawal@nxp.com" , "dev@dpdk.org" References: <1524573807-168522-1-git-send-email-abhinandan.gujjar@intel.com> <1524573807-168522-2-git-send-email-abhinandan.gujjar@intel.com> <58e0ed01-ac5c-1da3-0f0e-b3a90cfb7b0c@nxp.com> <5612CB344B05EE4F95FC5B729939F780706FF9E6@PGSMSX102.gar.corp.intel.com> Cc: "Vangati, Narender" , "Rao, Nikhil" , "Eads, Gage" From: Akhil Goyal Organization: NXP Message-ID: <6febc20d-7bcd-88f8-aba7-b06dc737ea4f@nxp.com> Date: Thu, 26 Apr 2018 12:46:39 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <5612CB344B05EE4F95FC5B729939F780706FF9E6@PGSMSX102.gar.corp.intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: MA1PR01CA0111.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::27) To VI1PR04MB1391.eurprd04.prod.outlook.com (2a01:111:e400:5348::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:VI1PR04MB1391; X-Microsoft-Exchange-Diagnostics: 1; VI1PR04MB1391; 3:tFPaB8luuX2rb2MDarqXy6TBEeRgGM9p/JlnIpWY7YPxNnFCrXg7g4cEgYRzQ6YbT6zQGTgEaqFvPFwhGo8Lqk1x/e4ZAd36BDIpRDKYIpt7p+lTdZVMFUEVuSZ6HFvZw/4+EDanel/Mxt8f/OyndRilS5UmQw04BckPRan2vuVQ8iKLkIj7dU0HrbpJzGBSDwCpH3z1khhPv0xu4pRTsdw35btbM1mz5kaplNDF4SWNyw2nXMwwFJ3UxiPbBRUP; 25:QrBvPepVy/9zPfDxFYewNjt4crhXAzIubsrAvMI6IHJwK7j52VaEMJP24YbIP2cFaHsGllZP3/DlvikLyemGUASj6iLeGg0dtHzWSaTHj5w3xGI+ASDHtnvAujzl9X2mpTEJ6Gw0v+FO8WsCPgH2PGcyBEFP1LKcftQ5l7AMs5NfvHW063DTdFiBbGUwRNdw2koXOr92sns4mLjw6D3tyg5Fzt9Oa3rwRUW/szxdhAEQjppZ39FccewPebLm8enJ54RRqDM4uMjBXotlmMPj5dblw9Y4G2QB9OqEmcQ1gM1yZgya4998eWIR/oRrzkoufBhT6a84uR5Vx07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iLIOpsrtmTBxUdzFZnUYNjrogP6xWayt2MxrSREVVgBvILrCEgED6ISokskGFzumvPJb/YdK8O93BgbTOAHGxClT/RnnW4xPjZLuD52lKR7pxBa14xmlBt5yUaLwGYQ25Vm6 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192374486261705)(185117386973197)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231232)(944501410)(52105095)(3002001)(10201501046)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(6072148)(201708071742011); SRVR:VI1PR04MB1391; BCL:0; PCL:0; RULEID:; SRVR:VI1PR04MB1391; X-Forefront-PRVS: 0654257CF5 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6049001)(39380400002)(39860400002)(346002)(396003)(366004)(376002)(199004)(189003)(13464003)(31696002)(2906002)(229853002)(97736004)(31686004)(81166006)(8676002)(81156014)(8936002)(6486002)(2501003)(65806001)(106356001)(65956001)(66066001)(47776003)(36756003)(105586002)(6666003)(6246003)(4326008)(478600001)(25786009)(53936002)(36916002)(3260700006)(2201001)(52116002)(16526019)(186003)(316002)(65826007)(16576012)(58126008)(5660300001)(110136005)(93886005)(230700001)(26005)(77096007)(67846002)(54906003)(23746002)(76176011)(86362001)(64126003)(3846002)(6116002)(59450400001)(44832011)(305945005)(7736002)(486006)(476003)(2616005)(446003)(386003)(68736007)(55236004)(53546011)(11346002)(956004)(5009440100003)(50466002)(110426005)(21314002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB1391; H:[10.232.134.49]; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; VI1PR04MB1391; 23:r7+tGD1AxaVOkcP+vgk5b0vGz8y6jAmpnT2VG?= =?Windows-1252?Q?rwCEAqXsXiznbDKVJCZG7KrAu8dAJUZtP2UvHWytMn4+aTHl3Ov7ejBx?= =?Windows-1252?Q?L6cAooryraiiC80lvm+Bm8yFw5qCENi2u9euyD0ALyqtvq8glDNisIQ2?= =?Windows-1252?Q?0z0mT21R84E4JVwShW6Y4txmlJtXXHMWx7zs2qUWpv9nYmoPYUJhmNon?= =?Windows-1252?Q?lKh3HWdYs+/jJkkGO4FCnNDgHTptybl07SyHVUAQB0iLsqJoQTpUCd0S?= =?Windows-1252?Q?yMzTKko31sM3Iyd4Z3GdTg2Cg56G+50iphAn1zX3eyRXGlOsg1UAsQ3h?= =?Windows-1252?Q?SXka2ZYb+hBPR3z+OK0cJ4dxUJsHqNcpPBHg1dcke37n7mpho5bT+DOJ?= =?Windows-1252?Q?9+pyfykJx91uPmk7EmIHDesiVhV5vyPjYunTa63gKSj4lcNx/Ce7H5h7?= =?Windows-1252?Q?uNB1BDx2ZAvgoPwkWz9df2Ch3wA+RYfjNRlEIhKjJ21O3bEn05pH2k+7?= =?Windows-1252?Q?g1sABJa+89uJyXHVX1yxjvSuKuw7XrjME37RkB/oTcG2QR6My4ifvNXz?= =?Windows-1252?Q?qDht4IQpl6keLXRR/Py1cZny804biWPPJokTqShw3z+pXQshqe0Aj25H?= =?Windows-1252?Q?AZpZof99IPIM0kLmfLjeng63qfkGIuQTCc6joIToD3XDxv1ZHy2JGnOq?= =?Windows-1252?Q?Qu1W6s21vbiORE/MGd8cRnoesct2wMZYaWwt0+mRhfG8qgJn9twRF9+z?= =?Windows-1252?Q?53tqbkitVNgM+f24Yrw00aOa2/pIzajMQTWcoLXnpfBn2C5Rr34Hz/gU?= =?Windows-1252?Q?e2WP3oX70h5eB8kf1K+pRj9aT9GDEhb05+F0DN8owk7prM3ygPR+IVF4?= =?Windows-1252?Q?m1WRiy0xO0IHZx42bPHQTyYEqI1KsKnFU31sqP38xWy36bIuUguNlGO3?= =?Windows-1252?Q?G1e+cWTwNZouOKJC8VzpvftwAoi4zoFxwSk1EFflbNzz1f2tyIM3qFAB?= =?Windows-1252?Q?AIhTs2RjIENSIR8hxRn+qKc8QPKhb7ku4uz68vmBXWqXx8ZML5NayL8p?= =?Windows-1252?Q?RZAZyVW7b8save5b5qv5pWDYPyrq/ac8M7k47uPnNcbQz2Aqk92u9n6E?= =?Windows-1252?Q?pZDaew8qTbCFlMavvmymRBkU/n11L2shcj6Hl8d5PTCPB60teDN/WBLm?= =?Windows-1252?Q?oFGCi94fHCiAEnM9DPZnsIz8K3JlB5wHD1BBlc4wUR0Vr0n9c+RErTRu?= =?Windows-1252?Q?7hM+EGd6d28MzpdYuWoQJxnV9vqem6QwFAeYEvUfNZ/+C8UpAeqej0Cv?= =?Windows-1252?Q?1WI7gLtSs9aVIz2EKTW8AjyCh2M8m3MGU8voUdCx67o+uIGPrJyEsEC+?= =?Windows-1252?Q?Fi0CKx7nhV5bs2lC4eUYKUiTYXKLbVGBdHMvDMxsbI8l6NGJN7G558z+?= =?Windows-1252?Q?jlzM5yy+V0u5EzbYHMF6xHNBNDVug2judBVw6rRbrrBAQcJclNZFkH+9?= =?Windows-1252?Q?kunNrXDGLxBnwlXKvGcKTUN1/TFs7BD6oG71btjknfsJcQhNpNmANOxB?= =?Windows-1252?Q?OylakVnnV1EcuLd1xGoR3Co8r9nug1W7R64pk7pweiUBZicbW5rM1ZBs?= =?Windows-1252?Q?2aUMb/xFSeeAwK4WwufnYb5wQofdpCbus4EqPoxMm3Ft+HJnAAkIE6hN?= =?Windows-1252?Q?ukDuXGecGKsK3WTmei4+QNdTP5gzrBuYbnFLB7h7SQKQZrDAcAdoSA+T?= =?Windows-1252?Q?+T467lYBWw0BDjZ4XwAiJBWpWVFhb7Y/s8gYnNpFr5O9ewWxTWVEIzOY?= =?Windows-1252?Q?AhmlABoEpYtMDLlnmWk0HwHig=3D=3D?= X-Microsoft-Antispam-Message-Info: MBuhlk9ZyeZw2Ks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ReK8KHlcDLdJjCcIs0o+ItMeFRaROUkWoy4q8R9Sn3pgCHTTSapWdYgiM02sY7imPYvsbCSSKX0CGLIZd7MOZh9TTmqFKMlRiDmUxOsy6Zh6/o7lsH2CBv6LpJmLJ0GPd9HR/mssM9fpV06fxAjCBj4vKEpJQ57Q0IStM4MV36dgRLtfWyCi3qqUc2tXJzzuLudYR1bElqJ8B/7wm5kiJuyhVZmT0kEKw/7UXPKCIqd+bZx X-MS-Office365-Filtering-Correlation-Id: a6ce8b7b-d4df-4cb5-feee-08d5ab45b42f X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2018 07:16:58.5211 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a6ce8b7b-d4df-4cb5-feee-08d5ab45b42f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB1391 Subject: Re: [dpdk-dev] [v2,1/6] eventdev: introduce event crypto adapter X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 07:17:06 -0000 Hi Abhinandan, On 4/26/2018 11:37 AM, Gujjar, Abhinandan S wrote: > Hi Akhil, > >> -----Original Message----- >> From: Akhil Goyal [mailto:akhil.goyal@nxp.com] >> Sent: Wednesday, April 25, 2018 6:12 PM >> To: Gujjar, Abhinandan S ; >> jerin.jacob@caviumnetworks.com; hemant.agrawal@nxp.com; >> akhil.goyal@nxp.com; dev@dpdk.org >> Cc: Vangati, Narender ; Rao, Nikhil >> ; Eads, Gage >> Subject: Re: [dpdk-dev] [v2,1/6] eventdev: introduce event crypto adapter >> >> Hi Abhinandan, >> On 4/24/2018 6:13 PM, Abhinandan Gujjar wrote: >>> Signed-off-by: Abhinandan Gujjar >>> Signed-off-by: Nikhil Rao >>> Signed-off-by: Gage Eads >>> --- >>> lib/librte_eventdev/rte_event_crypto_adapter.h | 532 >>> +++++++++++++++++++++++++ >>> 1 file changed, 532 insertions(+) >>> create mode 100644 lib/librte_eventdev/rte_event_crypto_adapter.h >>> >>> diff --git a/lib/librte_eventdev/rte_event_crypto_adapter.h >>> b/lib/librte_eventdev/rte_event_crypto_adapter.h >>> new file mode 100644 >>> index 0000000..aa4f32c >>> --- /dev/null >>> +++ b/lib/librte_eventdev/rte_event_crypto_adapter.h >>> @@ -0,0 +1,532 @@ >>> +/* SPDX-License-Identifier: BSD-3-Clause >>> + * Copyright(c) 2017-2018 Intel Corporation */ >>> + >>> +#ifndef _RTE_EVENT_CRYPTO_ADAPTER_ >>> +#define _RTE_EVENT_CRYPTO_ADAPTER_ >>> + >>> +/** >>> + * @file >>> + * >>> + * RTE Event crypto adapter >>> + * >>> + * Eventdev library provides couple of adapters to bridge between >>> +various >>> + * components for providing new event source. The event crypto >>> +adapter is >>> + * one of those adapter which is intended to bridge between event >>> +devices >>> + * and crypto devices. >>> + * >>> + * The crypto adapter adds support to enqueue/dequeue crypto >>> +operations to/ >>> + * from event device. The packet flow between crypto device and the >>> +event >>> + * device can be accomplished using both SW and HW based transfer >> mechanisms. >>> + * The adapter uses an EAL service core function for SW based packet >>> +transfer >>> + * and uses the eventdev PMD functions to configure HW based packet >>> +transfer >>> + * between the crypto device and the event device. >>> + * >>> + * The application can choose to submit a crypto operation directly >>> +to >>> + * crypto device or send it to the crypto adapter via eventdev, the >>> +crypto >>> + * adapter then submits the crypto operation to the crypto device. >>> + * The first mode is known as the dequeue only (DEQ_ONLY) mode and >>> +the >>> + * second as the enqueue - dequeue (ENQ_DEQ) mode. The choice of mode >>> +can >>> + * be specified while creating the adapter. >>> + * >>> + * >>> + * Working model of DEQ_ONLY mode: >>> + * =============================== >>> + * >>> + * +--------------+ +--------------+ >>> + * Events | | | Crypto stage | >>> + * <------>| Event device |-------->| + enqueue to | >>> + * | | | cryptodev | >>> + * +--------------+ +--------------+ >>> + * event ^ | >>> + * enqueue| | crypto >>> + * | v enqueue >>> + * +--------------+ +--------------+ >>> + * | | | | >>> + * |Crypto adapter|<--------| Cryptodev | >>> + * | | | | >>> + * +--------------+ +--------------+ >>> + * >> The diagram looks a bit cryptic. Enqueue to cryptodev will be done from >> application and not from event device. The arrow from event device to crypto >> stage is not clear. And application dequeues events from event device. So that >> should not be bidirectional arrow. > > You are right, it is done from application. But the application will be in the crypto stage of > pipeline. Since crypto is an intermediate stage, events are first dequeued from eventdev to > find out it's a crypto stage. Then application, in the crypto stage, enqueue "rte_crypto_ops" > to cryptodev and finally adapter enqueue crypto completions as events to eventdev. > From this point, eventdev will pass events to the next stage (may be Tx). > That's the reason behind bidirectional arrow to event device. > You are talking about a particular application, but the comments should be generic. In DEQ ONLY mode, enqueue to cryptodev is responsibility of application and should not be from event dev. Actually the application will dequeue from event dev and decide that this event comes from NIC (say), and it needs to be processed by cryptodev next. So in this case the application decides what will happen to the packet and not the event dev, so it cannot be bi-directional arrow. >> >>> + * In the DEQ_ONLY mode, application submits crypto operations >>> + directly to >>> + * crypto device. The adapter then dequeues crypto completions from >>> + crypto >>> + * device and enqueue events to the event device. >>> + * In this mode, application needs to specify event information >>> + (response >>> + * information) which is needed to enqueue an event after the crypto >>> + operation >>> + * is completed. >>> + * >>> + * >>> + * Working model of ENQ_DEQ mode: >>> + * ============================== >>> + * >>> + * +--------------+ +--------------+ >>> + * Events | | | | >>> + * <------>| Event device |-------->| Crypto stage | >>> + * | | | | >>> + * +--------------+ +--------------+ >>> + * event ^ | >>> + * enqueue| | event >>> + * | v dequeue >>> + * +---------------------------------------+ >>> + * | | >>> + * | Crypto adapter | >>> + * | | >>> + * +---------------------------------------+ >>> + * ^ >>> + * | crypto >>> + * | enq/deq >>> + * v >>> + * +-------------+ >>> + * | | >>> + * | Cryptodev | >>> + * | | >>> + * +-------------+ >>> + * >>> + * In the ENQ_DEQ mode, application sends crypto operations as events >>> + to >>> + * the adapter which dequeues events and perform cryptodev operations. >>> + * The adapter dequeues crypto completions from cryptodev and enqueue >>> + * events to the event device. >>> + * In this mode, 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. >>> + * >>> + * >>> + * The event crypto adapter provides common APIs to configure the >>> + packet flow >>> + * from the crypto device to event devices for both SW and HW based >> transfers. >>> + * The crypto event adapter's functions are: >>> + * - rte_event_crypto_adapter_create_ext() >>> + * - rte_event_crypto_adapter_create() >>> + * - rte_event_crypto_adapter_free() >>> + * - rte_event_crypto_adapter_queue_pair_add() >>> + * - rte_event_crypto_adapter_queue_pair_del() >>> + * - rte_event_crypto_adapter_start() >>> + * - rte_event_crypto_adapter_stop() >>> + * - rte_event_crypto_adapter_stats_get() >>> + * - rte_event_crypto_adapter_stats_reset() >>> + >>> + * The applicaton creates an instance using >>> + rte_event_crypto_adapter_create() >> application spell check. >> >>> + * or rte_event_crypto_adapter_create_ext(). >>> + * >>> + * Cryptodev queue pair addition/deletion is done using the >>> + * rte_event_crypto_adapter_queue_pair_xxx() APIs. >>> + * >>> + * The SW adapter or HW PMD uses rte_crypto_op::sess_type to decide >>> + whether >>> + * request/response(private) data is located in the crypto/security >>> + session >>> + * or at an offset in the rte_crypto_op. >>> + * The rte_crypto_op::private_data_offset provides an offset to >>> + locate the >>> + * request/response information in the rte_crypto_op. >> Above line is repeated below. This one can be removed. > Ok. I will combine them. >> >>> + * >>> + * For session-based operations, the set and get API provides a >>> + mechanism for >>> + * an application to store and retrieve the data information stored >>> + * along with the crypto session. >>> + >>> + * For session-less mode, the adapter gets the private data >>> + information placed >>> + * along with the ``struct rte_crypto_op``. >>> + * The ``rte_crypto_op::private_data_offset`` indicates the start of >>> + private >>> + * data information. The offset is counted from the start of the >>> + rte_crypto_op >>> + * including initialization vector (IV). >>> + */ >>> + >>> +#ifdef __cplusplus >>> +extern "C" { >>> +#endif >>> + >>> +#include >>> + >>> +#include "rte_eventdev.h" >>> + >>> +/** >>> + * @warning >>> + * @b EXPERIMENTAL: this enum may change without prior notice >>> + * >>> + * Crypto event adapter mode >>> + */ >>> +enum rte_event_crypto_adapter_mode { >>> + RTE_EVENT_CRYPTO_ADAPTER_DEQ_ONLY = 1, >>> + /**< Start only dequeue part of crypto adapter. >>> + * Application submits crypto requests to the cryptodev. >>> + * Adapter only dequeues the crypto completions from cryptodev >>> + * and enqueue events to the eventdev. >>> + */ >>> + RTE_EVENT_CRYPTO_ADAPTER_ENQ_DEQ, >>> + /**< Start both enqueue & dequeue part of crypto adapter. >>> + * Application submits crypto requests as events to the crypto >>> + * adapter. Adapter submits crypto requests to the cryptodev >>> + * and crypto completions are enqueued back to the eventdev. >>> + */ >>> +}; >>> + >>> +/** >>> + * @warning >>> + * @b EXPERIMENTAL: this structure may change without prior notice >>> + * >>> + * Crypto event request structure will be filled by application to >>> + * provide event request information to the adapter. >>> + */ >>> +struct rte_event_crypto_request { >>> + uint8_t resv[8]; >>> + /**< Overlaps with first 8 bytes of struct rte_event >>> + * that encode the response event information >>> + */ >> I think in case of ENQ_DEQ mode, both request and response info is required. I >> think it would be better to have a single structure as >> >> struct rte_event_crypto_metadata { >> struct rte_event ev; >> uint16_t cdev_id; >> uint16_t queue_pair_id; >> uint32_t resv1; >> }; >> The last 3 fields need not be filled by application for DEQ_ONLY mode. >> Application will not get confused with request/response structures when we >> have response info already present in request structure. >> Or if you still insist to have separate structure for request and response then it >> would be better to have it as struct instead of union for metadata and remove >> the resv[8]. >> IMO, first one is better. > > rte_event structure itself has enough memory to hold *both request and response information*. > struct rte_event { > /** WORD0 */ > union { > uint64_t event; > . > } > /** WORD1 */ > union { > uint64_t u64; > . > } > } > > For response only *WORD0* is used. Whereas *WORD1* is used for request! > > As proposed, > +struct rte_event_crypto_request { > + uint8_t resv[8]; > + /**< Overlaps with first 8 bytes of struct rte_event > + * that encode the response event information > + */ > + uint16_t cdev_id; > + /**< cryptodev ID to be used */ > + uint16_t queue_pair_id; > + /**< cryptodev queue pair ID to be used */ > + uint32_t resv1; > + /**< Reserved bits */ > +}; > > First 8 bytes are *WORD0* and rest of the information fits into *WORD1*. > +union rte_event_crypto_metadata { > + struct rte_event_crypto_request request_info; > + struct rte_event response_info; > +}; > Request and response together into a union will allocate memory required for (WORD0+WORD1). > I hope, this clarifies all your doubt. > Ok I missed the WORD1 in my previous comment. But my intention was to have a common structure of metadata. As in case of ENQ-DEQ mode, both request and response will be filled. So having a structure with a union of request and response will be misleading. >> >>> + uint16_t cdev_id; >>> + /**< cryptodev ID to be used */ >>> + uint16_t queue_pair_id; >>> + /**< cryptodev queue pair ID to be used */ >>> + uint32_t resv1; >>> + /**< Reserved bits */ >>> +}; >>> + >>> +/** >>> + * @warning >>> + * @b EXPERIMENTAL: this structure may change without prior notice >>> + * >>> + * Crypto event metadata structure will be filled by application >>> + * to provide crypto request and event response information. >>> + * >>> + * If crypto events are enqueued using a HW mechanism, the cryptodev >>> + * PMD will use the event response information to set up the event >>> + * that is enqueued back to eventdev after completion of the crypto >>> + * operation. If the transfer is done by SW, event response >>> +information >>> + * will be used by the adapter. >>> + */ >>> +union rte_event_crypto_metadata { >>> + struct rte_event_crypto_request request_info; >>> + struct rte_event response_info; >>> +}; >>> + >>> +/** >>> + * @warning >>> + * @b EXPERIMENTAL: this structure may change without prior notice >>> + * >>> + * Adapter configuration structure that the adapter configuration >>> +callback >>> + * function is expected to fill out >>> + * @see rte_event_crypto_adapter_conf_cb */ struct >>> +rte_event_crypto_adapter_conf { >>> + uint8_t event_port_id; >>> + /**< Event port identifier, the adapter enqueues events to this >>> + * port and also dequeues crypto request events in ENQ_DEQ mode. >>> + */ >>> + uint32_t max_nb; >>> + /**< The adapter can return early if it has processed at least >>> + * max_nb crypto ops. This isn't treated as a requirement; batching >>> + * may cause the adapter to process more than max_nb crypto ops. >>> + */ >>> +}; >>> + >>> +/** >>> + * @warning >>> + * @b EXPERIMENTAL: this API may change without prior notice >>> + * >>> + * Function type used for adapter configuration callback. The >>> +callback is >>> + * used to fill in members of the struct >>> +rte_event_crypto_adapter_conf, this >>> + * callback is invoked when creating a SW service for packet transfer >>> +from >>> + * cryptodev queue pair to the event device. The SW service is >>> +created within >>> + * the rte_event_crypto_adapter_queue_pair_add() function if SW based >>> +packet >>> + * transfers from cryptodev queue pair to the event device are required. >>> + * >>> + * @param id >>> + * Adapter identifier. >>> + * >>> + * @param dev_id >>> + * Event device identifier. >>> + * >>> + * @param conf >>> + * Structure that needs to be populated by this callback. >>> + * >>> + * @param arg >>> + * Argument to the callback. This is the same as the conf_arg passed >>> +to the >>> + * rte_event_crypto_adapter_create_ext(). >>> + */ >>> +typedef int (*rte_event_crypto_adapter_conf_cb) (uint8_t id, uint8_t dev_id, >>> + struct rte_event_crypto_adapter_conf *conf, >>> + void *arg); >>> + >>> +/** >>> + * @warning >>> + * @b EXPERIMENTAL: this structure may change without prior notice >>> + * >>> + * Queue pair configuration structure containing event information. >>> + * @see >> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND >>> + */ >>> +struct rte_event_crypto_queue_pair_conf { >>> + struct rte_event ev; >>> +}; >> We may not need this wrapper structure. We can directly use rte_event. > This was done keep in mind to accommodate need for any future requirement > of having a new field added to the structure along with the rte_event. > Do you see anything in the future for configuration. If not, we can remove it for now and should add in future when it is required. >>> + >>> +/** >>> + * @warning >>> + * @b EXPERIMENTAL: this structure may change without prior notice >>> + * >>> + * A structure used to retrieve statistics for an event crypto >>> +adapter >>> + * instance. >>> + */ >>> + >>> +struct rte_event_crypto_adapter_stats { >>> + uint64_t event_poll_count; >>> + /**< Event port poll count */ >>> + uint64_t event_dequeue_count; >> better to use uniform naming. event_deq_count > ok >>> + /**< Event dequeue count */ >>> + uint64_t crypto_enq_count; >>> + /**< Cryptodev enqueue count */ >>> + uint64_t crypto_enq_fail; >>> + /**< Cryptodev enqueue failed count */ >>> + uint64_t crypto_deq_count; >>> + /**< Cryptodev dequeue count */ >>> + uint64_t event_enqueue_count; >> event_enq_count > ok >>> + /**< Event enqueue count */ >>> + uint64_t event_enq_retry_count; >>> + /**< Event enqueue retry count */ >>> + uint64_t event_enq_fail_count; >>> + /**< Event enqueue fail count */ >>> +}; >>> + >>> +/** >>> + * @warning >>> + * @b EXPERIMENTAL: this API may change without prior notice >>> + * >>> + * Create a new event crypto adapter with the specified identifier. >>> + * >>> + * @param id >>> + * Adapter identifier. >>> + * >>> + * @param dev_id >>> + * Event device identifier. >>> + * >>> + * @param conf_cb >>> + * Callback function that fills in members of a >>> + * struct rte_event_crypto_adapter_conf struct passed into >>> + * it. >>> + * >>> + * @param mode >>> + * Flag to indicate to start dequeue only or both enqueue & dequeue. >>> + * >>> + * @param conf_arg >>> + * Argument that is passed to the conf_cb function. >>> + * >>> + * @return >>> + * - 0: Success >>> + * - <0: Error code on failure >>> + */ >>> +int __rte_experimental >>> +rte_event_crypto_adapter_create_ext(uint8_t id, uint8_t dev_id, >>> + rte_event_crypto_adapter_conf_cb conf_cb, >>> + enum rte_event_crypto_adapter_mode mode, >>> + void *conf_arg); >>> + >>> +/** >>> + * @warning >>> + * @b EXPERIMENTAL: this API may change without prior notice >>> + * >>> + * Create a new event crypto adapter with the specified identifier. >>> + * This function uses an internal configuration function that creates >>> +an event >>> + * port. This default function reconfigures the event device with an >>> + * additional event port and setups up the event port using the >>> +port_config >> set up >>> + * parameter passed into this function. In case the application needs >>> +more >>> + * control in configuration of the service, it should use the >>> + * rte_event_crypto_adapter_create_ext() version. >>> + * >>> + * @param id >>> + * Adapter identifier. >>> + * >>> + * @param dev_id >>> + * Event device identifier. >>> + * >>> + * @param port_config >>> + * Argument of type *rte_event_port_conf* that is passed to the >>> +conf_cb >>> + * function. >>> + * >>> + * @param mode >>> + * Flag to indicate to start dequeue only or both enqueue & dequeue. >>> + * >>> + * @return >>> + * - 0: Success >>> + * - <0: Error code on failure >>> + */ >>> +int __rte_experimental >>> +rte_event_crypto_adapter_create(uint8_t id, uint8_t dev_id, >>> + struct rte_event_port_conf *port_config, >>> + enum rte_event_crypto_adapter_mode mode); >>> + >> [..snip..] >> >>> + >>> +/** >>> + * @warning >>> + * @b EXPERIMENTAL: this API may change without prior notice >>> + * >>> + * Retrieve the event port of an adapter. >>> + * >>> + * @param id >>> + * Adapter identifier. >>> + * >>> + * @param [out] event_port_id >>> + * Event port identifier used to link to the queue used in ENQ_DEQ mode. >>> + * >>> + * @return >>> + * - 0: Success >>> + * - <0: Error code on failure. >>> + */ >>> +int __rte_experimental >>> +rte_event_crypto_adapter_event_port_get(uint8_t id, uint8_t >>> +*event_port_id); >> IIUC, crypto adapter can give packets to multiple event ports. > There could be multiple event ports from cryptodev to eventdev in the HW > which you are referring, by looking at DEQ mode. This API is used only for > ENQ-DEQ mode. The SW adapter is using only one event port to do the job. A comment shall be added in the description if that is the case. >> >> Also, I don't see similar API in eth_rx_adapter. > As eth_rx_adapter does not dequeue any events from application, > this API is not present there. Regards, Akhil