From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0088.outbound.protection.outlook.com [104.47.40.88]) by dpdk.org (Postfix) with ESMTP id B3781A49 for ; Sun, 29 Apr 2018 18:08:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=lKfm78NY4/stB3OeXSWGNG36NgQnoZVoE0v/15ah8us=; b=fDpmT/S8167lPBN6mwVWS+X7mZe5OFWsKX67nN7qcDBX6TybzCmgR3gdNfO2b9zTtdcj/5DZLnhUIhNkVkZLxM5NnvFcMfOSIuQcyuGiISaGmEPHwjUSk7HIQFlkQxnMi75MaP6NB+qfyU15TF29IJuBPxt7vXefZUTMJ17LI+0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin (116.68.105.116) by BN3PR07MB2514.namprd07.prod.outlook.com (2a01:111:e400:7bbf::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.715.18; Sun, 29 Apr 2018 16:08:53 +0000 Date: Sun, 29 Apr 2018 21:38:37 +0530 From: Jerin Jacob To: Abhinandan Gujjar Cc: hemant.agrawal@nxp.com, akhil.goyal@nxp.com, dev@dpdk.org, narender.vangati@intel.com, nikhil.rao@intel.com, gage.eads@intel.com Message-ID: <20180429160835.GA11546@jerin> References: <1524573807-168522-1-git-send-email-abhinandan.gujjar@intel.com> <1524573807-168522-2-git-send-email-abhinandan.gujjar@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1524573807-168522-2-git-send-email-abhinandan.gujjar@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [116.68.105.116] X-ClientProxiedBy: BM1PR01CA0086.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1::26) To BN3PR07MB2514.namprd07.prod.outlook.com (2a01:111:e400:7bbf::11) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:BN3PR07MB2514; X-Microsoft-Exchange-Diagnostics: 1; BN3PR07MB2514; 3:4yBQKf8WKxV71NVijFqOXwgIpBSwnFKY65JLxmGAvjYn4TM3IzJCfKxgcRpO8Zc0+Fpxyd+eaCO6MkQp0NS2YzhuRkzmTE0YzVJ0mAP97ckTmi/zMzdiXDRvEgHMccQyXvFZ52CHMQmryQ76bp21ARrQLrXADbw1zy5qPBcvF+cv2GGkWz1uB8gyEZxcMIks7ucmRqrZoGxbe3KjVzOSF3s03uCyM5oy2GNq91j3qmxSp0HxwSTiNtyQnkR7dbd7; 25:zcc/CzHWoB7gufIotABZKwEhQaOCg3wIEqWhC8L7KIBLYdCU/EHAtAQfBr5Ars3oGDa2/uvHqeaZtEa7KTILzz/ylKkc2MWsRX64WmVB09btqPUbrIMQ1Fsbyqsggd/oS10RBtZNo46mTgKnRxGwkgs69lUuNfmC6RghJPMl6iSCQBq43qYMK52P05I92OjDRlMQVHToEgywotLZ2paRt3hX5oW4VnpK4J4oUTpvzQ164/sHpzL+fBlZ1GB8aJ0RuqgaZaMxalkFyA5Zc2dYhjfo2QfJPeK0KyHRxVHPw4MmB7LtBeF7nZOIMI8rPAE3JBULg9jfl3luAJu0xrwgHg==; 31:+VG/EBAcLRnXQKJhqbefPkCmapD9XwHLogHM+bw/E2FSJrgB/1AO3vGT0cfCuD2inzH779NalWaUW4Xc19k/q8vmJtSgo3jpFr0lSqEZR5+fdD60iiqIXC1N7/eaBgUst7Crmw+2EnKf3IZ5LAohIW3GRwmw2hCVL87hWwwyVKiVDtEGhaDSZpzHxvIUkqrcOO/uYDg4y2qe8RzYzmeg7qa2IWhcTVdmQ2iWsHQcxYM= X-MS-TrafficTypeDiagnostic: BN3PR07MB2514: X-Microsoft-Exchange-Diagnostics: 1; BN3PR07MB2514; 20:D0AvGLswqVFT5puNbhn18C8kX+kXtG76Q3Bi4KbElCyyz6McR+6JmsQEGUbGa+R9BkghbKLOBtzhB15cFawMV9Ya3qLQv3Qm9Ef4zaJfS9gOCBrnpXZyVL4dyFjeIWs+1KO/61hxGBG58q2BnQNVRaALS2y6syCOjCdo/v9ZfztEziCWXGGhP36ZZz62yCSRM142RE6CQHKHtvdlqVg9EsqBGn88fSlMv/ckIF8xHVGhDoa41Gv3i1kqRSWneXjJc0Bdsvh4kaB+ZH+luzt0tyOQtaB78t22FXlVcIYvw1ky8x/yTLxWCLxLk/KqFcUGb8+TLbTQkfqJakBr1mrsr+D0KtcTDeGz6T0VFumKK7YdptMFFYo+Y1MpEm3t//LV3zjM5SRaXWdxhz0mIDuBNHDOLBAUD99HHqkr6D1tOK2RQjOZdBrxU9qTopW0M6RHMpnIhpR7Ss/8vSL65OZi1fRSymtDHgts3hzMEFDmaXn+KUNvZbB1c5CX0qIZ/+Wo3zv7F8P9T0Wyc9AJOiBg6WNFdWw111P5Cilcex/6M2v9FFEgzI7or1XSlZJiKuxh47AY8Yhe0iiwL6EIqluRTbuZKegE4EP7myW3a0McFWM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(278428928389397)(192374486261705)(185117386973197)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(93006095)(3231254)(944501410)(52105095)(3002001)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011); SRVR:BN3PR07MB2514; BCL:0; PCL:0; RULEID:; SRVR:BN3PR07MB2514; X-Microsoft-Exchange-Diagnostics: 1; BN3PR07MB2514; 4:seaM1yam/rSPjurNKMXiq484RZkIWd+GnR4y2OEGV6kYQ3bzk3JwfTcOUoTa5Se+GNpD4mzi6zuGBC4k91qeHk3hFk5qEhdmDrkMuEyNmlDsNMZsjWZgATozpz6wgJWNriJufGYh6yEIGIefh2/A6C5GTX+J9NRvMUI7a2FkEuJwdSeDBYfd0+3Sb0fJ+Tf3jdTQD0T+uXIp09Gtjv6lRWrEn481QoO7awgWryngCsoekUucQxAPV4bWC8R3NDI6FV0Yh75ppmg7ZY3vS7DTDtBU+S8lOxs1Byuh9tFb+YMrxzNZFeWTOmGq+Xj8jnE6Dut0Y6sz1jJEed1Z4Yb41Wz4U3RrqLSQD9yWCes0pelennQ3b/brVhSAmcNzh/xDVWNghHcTYmVtkSFMee1fbdWE0MCQfC7bssSGPVLMRI8= X-Forefront-PRVS: 0657D528EC X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(346002)(376002)(39850400004)(366004)(39380400002)(13464003)(199004)(189003)(44832011)(97736004)(229853002)(53936002)(6116002)(23726003)(3846002)(2906002)(50466002)(33656002)(52116002)(33896004)(33716001)(8656006)(956004)(446003)(478600001)(55016002)(9686003)(6496006)(11346002)(68736007)(72206003)(76176011)(6246003)(42882007)(6666003)(305945005)(5660300001)(186003)(106356001)(26005)(105586002)(16586007)(81166006)(16526019)(486006)(476003)(66066001)(1076002)(59450400001)(4326008)(55236004)(316002)(81156014)(25786009)(47776003)(8936002)(58126008)(6916009)(386003)(7736002)(8676002)(18370500001)(21314002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR07MB2514; H:jerin; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR07MB2514; 23:UpjGIvTOXnfTUibV9hgfRqIQfRVdNC5F/nmZm4jx/?= =?us-ascii?Q?/nsTIDWnBE2kgbqZPKm4gAKG+uMhN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LamFuxg+FfldmmqRF3LBL//037ycr4rfzGCdl0GXc/Q53sFek4OAEqLiwVPsuPWWrtRpamabPD+qEzV1V6RffL080GPWoS5gtJsljXay/dEg2b7RI+ws8dAJStG8405hxC7C9CzOeIiQPTz/Th6Jf1/HVhpLjnp5axfWXKHKdwyizZUU1wJaeQ/0L2b0Zks8UfqI26GRGaGSyoD10i0gu6EOKKnjncJmIOJQOYSiWdaAL/GVu7AoEAsRDsq/5dmzMBOuGetw28WgnqqQ==; 5:/hlyOAk5MiHKZeHvUJRoL5wQIVH2Eh8vkavwou0o9Mxs4F275DZHLUzadv4HEUUzQOepyxhHbln+aEAzsZ5a4GQXFUNDcwqtRSPbKADfylWICFjpkeX7x2rTmip2g/n8BH6VnOQF+GneJg5oxHtIBdirhetmG3/1U1dqj95ezg4=; 24:HI59hsKlT9py+86h/TaSEYa6h7QUvJMfXS5+KOmxj0XndNgdp6PcJ1S+w+h5EGFa6dHZKZWosXwhzo5y5Mfeiu/e8yI4Tw7r3TAQlyJfqKA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR07MB2514; 7:/auPHJANKPf2ce6U3/pn6aZEQEzZVmx6+r1NCkCeOp4qg41xPO8gXpWlyyhDkY8Xm31XqdFtB0dX0Fjp9qrBcrTK3CNvVLyj7UxwI2Q4z5LZ8OEnwBVKUnljGJntgPovOGlimfxkg7dsIY6GMYine/ccAQP5RcCD24VOZMvE5J7/RVKXjy+bqInR4qad94ZPorZ57h8ybLJvRyThGDgCfWirVjf5IAbwPWL86kJEE69hky6SKaX1UibMtVjteXdm X-MS-Office365-Filtering-Correlation-Id: e83b3cbb-28dd-4f02-033c-08d5adeb825a X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2018 16:08:53.1930 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e83b3cbb-28dd-4f02-033c-08d5adeb825a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR07MB2514 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: Sun, 29 Apr 2018 16:08:59 -0000 -----Original Message----- > Date: Tue, 24 Apr 2018 18:13:22 +0530 > From: Abhinandan Gujjar > To: jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, > akhil.goyal@nxp.com, dev@dpdk.org > CC: narender.vangati@intel.com, abhinandan.gujjar@intel.com, > nikhil.rao@intel.com, gage.eads@intel.com > Subject: [v2,1/6] eventdev: introduce event crypto adapter > X-Mailer: git-send-email 1.9.1 > > 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_ 1) Please rebase to next-eventdev tree, If everything goes well, we will try to add it in RC2. 2) Please update MAINTAINERS section in this patch set with just one rte_event_crypto_adapter.h file and as when you add new files update the new files in the MAINTAINERS file > + > +/** > + * @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. We need to tell why these modes are required or use of it/when to use what like, OPS_NEW does not maintain ingress order. example, use of DEQ_ONLY with FWD or ENQ_DEQ mode to use ingress order maintenance. > + * > + * > + * Working model of DEQ_ONLY mode: > + * =============================== This diagram is not rendering correctly in doxygen html file. check lib/librte_eventdev/rte_eventdev.h as reference. invoke "make doc-api-html" to see the html output. > + * > + * +--------------+ +--------------+ > + * Events | | | Crypto stage | > + * <------>| Event device |-------->| + enqueue to | > + * | | | cryptodev | > + * +--------------+ +--------------+ > + * event ^ | > + * enqueue| | crypto > + * | v enqueue > + * +--------------+ +--------------+ > + * | | | | > + * |Crypto adapter|<--------| Cryptodev | > + * | | | | > + * +--------------+ +--------------+ > + * I think, we need to add sequence of numbers scheme to define the data flow for this diagram as it is complex. something like, ------[1]----> and describe the action means. > + * 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 | > + * | | | | > + * +--------------+ +--------------+ I think, instead of "crypto stage", it is better to call it as "atomic stage" something like that where the source queue's(ORDERED mode) ingress order will be updated in that stage and then enqueue to cryptodev happens for ingress order maintenance. > + * event ^ | > + * enqueue| | event > + * | v dequeue > + * +---------------------------------------+ > + * | | > + * | Crypto adapter | > + * | | > + * +---------------------------------------+ > + * ^ > + * | crypto > + * | enq/deq > + * v > + * +-------------+ > + * | | > + * | Cryptodev | > + * | | > + * +-------------+ Same as above comments for the diagram(i.e adding sequence number) > + * > + * In the ENQ_DEQ mode, application sends crypto operations as events to > + * the adapter which dequeues events and perform cryptodev operations. ^^^^^^^ Not to the adapter, right?. applications sends to the eventdev through ports available through rte_event_crypto_adapter_event_port_get() eventdev port. Right? Please reword if it makes sense. > + * 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() s/application/application > + * or rte_event_crypto_adapter_create_ext(). > + * > + * Cryptodev queue pair addition/deletion is done using the > + * rte_event_crypto_adapter_queue_pair_xxx() APIs. I think, we can mention the connection of RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND capability here. > + * > + * 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. > + * > + * 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. I think, we can mention the connection of RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA capability here. > + > + * 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, Why to mark it as explicit '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. I think, you can mention the connection with below capabilities here. RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD and @see of those here. > + */ > + 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. IMO, You can add note when this mode will be used by application if device is not capable of RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD and application need ingress order maintenance or something like that. > + */ > +}; > + > +/** > + * @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 May be we could add more comments on application usage on updating struct rte_event based field updating for 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; How about rsvd ? No strong opinion though. I think, you can add, Valid when it adapter is in ENQ_DEQ mode > + /**< 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; I think, you can add, Provided by application for ENQ_DEQ mode > + struct rte_event response_info; I think, you can add, Provided by application for ENQ_DEQ and DEQ_ONLY mode. > +/** > + * @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; MO, As Akhil said, we can pass struct rte_event directly. > +}; > + * @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 > + * 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); - Detecting what to pass (RTE_EVENT_CRYPTO_ADAPTER_DEQ_ONLY or RTE_EVENT_CRYPTO_ADAPTER_ENQ_DEQ) in application need a lot checks based on capabilities, instead, How about passing whats been desired by the application by adding a new enum(RTE_EVENT_CRYPTO_ADAPTER_MODE_OP_NEW or RTE_EVENT_CRYPTO_ADAPTER_MODE_OP_FWD). and internally based on mode selected and the device capability, the common code can choose RTE_EVENT_CRYPTO_ADAPTER_DEQ_ONLY in NEW or FWD mode vs RTE_EVENT_CRYPTO_ADAPTER_ENQ_DEQ. - We could add common code based API to return the exiting configured mode. enum rte_event_crypto_adapter_mode mode __rte_experimental rte_event_crypto_adapter_mode_get(uint8_t id, uint8_t dev_id); > + > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change without prior notice > + * > + * Free an event crypto adapter > + * > + * @param id > + * Adapter identifier. > + * > + * @return > + * - 0: Success > + * - <0: Error code on failure, If the adapter still has queue pairs > + * added to it, the function returns -EBUSY. > + */ > +int __rte_experimental > +rte_event_crypto_adapter_free(uint8_t id); > + > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change without prior notice > + * > + * Add a queue pair to an event crypto adapter. > + * > + * @param id > + * Adapter identifier. > + * > + * @param cdev_id > + * Cryptodev identifier. > + * > + * @param queue_pair_id > + * Cryptodev queue pair identifier. If queue_pair_id is set -1, > + * adapter adds all the pre configured queue pairs to the instance. > + * > + * @param conf > + * Additional configuration structure of type > + * *rte_event_crypto_queue_pair_conf* @see RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND