From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0045.outbound.protection.outlook.com [104.47.41.45]) by dpdk.org (Postfix) with ESMTP id 23DF5A49 for ; Sun, 29 Apr 2018 18:14:40 +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=jpi5mb0omzhbwjqLkF1PaDW8A7luxcucKnUhR0kQRa8=; b=YCyt6+5naWuun8b2occ30bAagdLoxfTkypJ4DIfppJaOwTM+rl1SKGmg2tXxTPpxe3q0l29ycuf8N0Aoj+rtsWGgraqhMw4j8sj6zxs0CfcnzBVMQ6S85XPPQF/2g1KKe0+B4BrJSDjrw00csQJIInlyRm9qBEu2NFT/2EMXG3s= Received: from jerin (116.68.105.116) by SN2PR07MB2525.namprd07.prod.outlook.com (2603:10b6:804:6::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.715.20; Sun, 29 Apr 2018 16:14:34 +0000 Date: Sun, 29 Apr 2018 21:44:18 +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: <20180429161417.GB11546@jerin> References: <1524573807-168522-1-git-send-email-abhinandan.gujjar@intel.com> <1524573807-168522-3-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-3-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: MAXPR0101CA0068.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:e::30) To SN2PR07MB2525.namprd07.prod.outlook.com (2603:10b6:804:6::25) 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:SN2PR07MB2525; X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB2525; 3:Wbd3wAlBjlA1BLKVThTbvdwGBXZLnFF9NN1o4Ue9OS+96TpbAwPH3ARVT7CCCLmDekWelsFWcFaB2EHVr1d+GdBsuipJFMjjauUZkoQBCe/8fu6wIU7JLyFWjo/Ybi9u73loKZbdsmTIhC+ADBLlbkdjhPV83s9K1uptR1+CnaLtkWH+9svbnDGhwiLHWBypbz90/kOOEk9pVyKVw37APuHikvH5DBklnzN6SQl8wSAmo5BgNqe4DBjf16xuPaUD; 25:rDyG4etfOP7bVzEle2tGZFyNoelnJEosqXbZY7/eIbsW2WpyA11L1sOlj2OIFlGtUKisvOsNuVV2cG1LQEfKqVJ0lzWgtXnyyYZKGZV6j8SSNoU41OY4NlgPSGejJEohY1iTwazQ97DRh/FjW+S+QTPfvdzVlH7De8HAdyhHFdUt3MlUVXAqnR/DKX2Ya30+qzCT+niDn+b0bfyTN2sbLm28R4XDI2iLK+UpofKgUL2CwK0ICKHmV85IlcmAJPmg2WTe670uHTzeYksuFFC42Tmte6m//yvO7VUq13lTl9tEVbcCKem2iWBR6x4UdBMeDIXgJ1RRoS3FyxdvoL++4w==; 31:h2qMf7oPGJEb96GllBfaYI10mfXicksuyHCROFtoyDJuz1DbgXhYA1mLAwM/Tp2Vj6zQrdoBUz0pE3gUM9F6ifsPVw7hVOx/Ag7yXWZjzdNy9jWqif5FA8cADW0KEhgSn2RWbfMPaFMV8ySYnBwr7pIkZbUZzYwJRJu24OZx13aZC77zKE4P7eVSSasD0CyXWaetHWIna5Ck7xaFM36WSGo1xtVfCEFaaxLT5TM/QwI= X-MS-TrafficTypeDiagnostic: SN2PR07MB2525: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB2525; 20:W8N2cIfp5jKmPdOnDGRzc6SNMym4HxuOX0pv4F2u3WT0A1CdSjN2DAGCA21xA0FUvXCn++6HxbfkjJT5a45DoHd9SRBDbGAU8Y2Ar0pOuU1g5sL6akYwciAI008iZsNH9AFAGdw6DftI5zUXIFduymzZFeQszKUyyY0Qe80smaSZGxFFQaF/WOADFkRaTYnjm0PupBZQ2oJu767zF0eE8tijTYiSGsQjuEy646IWFgJ/Z2PgaSoZ3m8JKKzO9J47yAIkrkpTo//a+I7rDvDgOxvyQncSggXhhHKX4cKpIwW6EF7rx3EdE0FaChxhg5Dt5NHcZMpmq5OXRz0r1cGvt7Gv4+sl6HkxDOgIa7hKufGo0VXBpxL0yniQ+tkc2sPJKtFf3xhKn3BvNh7oKBoaqjkLOYJx8GGpX8YcAQf4cpePq+KjDKSNxjQejQcqU/eGmnhXhqW2wkz+WUQE3/+4QxDCgqioEgEbOKlv7FxVNTcUF6jto8NMVzgSN5nD771WQIicH/AUqO1fKRVFetyPJ+PaHhJwnko0Bw5QrfvqQiWWxi2Y6lYtZm7uFmX6P0z/xnNCoFxCSgbpR6ePrccIGZai/5G2alXiS60bg0rie9w= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(3231254)(944501410)(52105095)(10201501046)(3002001)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(6072148)(201708071742011); SRVR:SN2PR07MB2525; BCL:0; PCL:0; RULEID:; SRVR:SN2PR07MB2525; X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB2525; 4:jKrjSxi0NkayvEpJd8LTt8eTRkcJf++qDfPilTkkP7ItyONiW7s057OuwDtf6+GBE4gExsKYpHDEB7BYHCLUduSSsqLk56bxN/ZV2wVixrscG6s1wZ09eEFlvNc0azvcpeEPvuOoEDtystK7EwPpAbdIJ0nvYLGVkZwgjJVvriSv0kKEyUk/3oKCJVDcKzIjORM8FUsICL9tVJqP0MCooVC7YO8WbNRsWxvrruzd8m/decXWkYy8CkspBH0TPnbtnIq6kakpFmGSP9FNAhNRkLP7ruIgfD1Vp+qKhlph+mUGXSrWyvcWrweBYfXqUbdzhU0xLPeT3oa8bE3AJROt+TuqIgVXU3rlyGcqtjH1Fjk= X-Forefront-PRVS: 0657D528EC X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(39850400004)(346002)(366004)(39380400002)(396003)(13464003)(199004)(189003)(1076002)(23726003)(476003)(956004)(486006)(6116002)(3846002)(229853002)(25786009)(26005)(72206003)(50466002)(478600001)(11346002)(446003)(44832011)(55236004)(316002)(8936002)(33896004)(6916009)(59450400001)(386003)(16586007)(58126008)(2906002)(16526019)(186003)(6666003)(4326008)(105586002)(8656006)(575784001)(6496006)(33716001)(6246003)(106356001)(33656002)(81166006)(52116002)(9686003)(53936002)(7736002)(81156014)(97736004)(55016002)(76176011)(47776003)(68736007)(305945005)(42882007)(8676002)(5660300001)(66066001)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR07MB2525; 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; SN2PR07MB2525; 23:9CkjyPrUcDErR8z511+4oF0D56l0JE7qYthM9r17n?= =?us-ascii?Q?O/pqCne2wQ2fPkYdJaNfkaGBZ5PvV5ipbjVMboJR8n0mY7kVVdEWRK1kzbim?= =?us-ascii?Q?gBEYxe0Si8QUkQybjHwS/VB1nEXAFt9pGLsdbhjKmbr4btZV8MUyaVPg7wA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639d2DgyYM07Wsm7sJo0IgAFIM9rR6q/Km6GOJCHzFptwka9TV/aJ9iEQcyybXWrJgSZik7O7yteA6wXQwAvZMhtpbf1zL5uDpJ4jeU+lXOtb3kxT7QWkSiqPseE8ixzjTrApez1Hx2gdEb/YOVdUPDglWpObm2PKls4ir0EE+I6A==; 5:3ldlbXE7yQPVBECxdQwl8LJSkn3g5W85ajksWf0eYF0qhvKeInOIH2eyLgZTft7GlRgzLE+97vXtq8bntIJV60lkQ10J1q/qoJM17nsF/xXcisAPPiRz/a0LcKEuI9EGZcerxJ8pASeNI7RSISj+GIMTe8iROz6zzoH2vxTcbrE=; 24:V2RVdwQS7cC1itxVtQvyfV/uLmYVhdBCNt57o3oHC6yqI9DX5PCIdnlt+KqcKlOsEPABf3GKEqH90LiLqU3t6LjSAs6RVL7QuBETkQCYV8o= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB2525; 7:YNmX7FmZXqIGCjFJRHdcSbTKsKF6nasp+dslwtCSbr0XtScNybEk7WTFhc/iOTOwJW2GIyzFTskuJB7l0yHCGV6iG/G12HRdJvhBFXCM7eZjOOeBAiYAmruvG1Y3LKKKYxGUoIQqIR5yY2C7xB4llP4VbmhvgnSfkHIlEeMaby/MSBpybAUKHwmclv19AjtUEPz/IKGmXCd9gEceTsyzwfgOLmaTmocPiT8OraJceUWDE+nnvI1WuJneI11QwgNR X-MS-Office365-Filtering-Correlation-Id: c6c31808-d7c0-426f-09da-08d5adec4e04 X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2018 16:14:34.8380 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c6c31808-d7c0-426f-09da-08d5adec4e04 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR07MB2525 Subject: Re: [dpdk-dev] [v2, 2/6] eventdev: add APIs and PMD callbacks for 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:14:40 -0000 -----Original Message----- > Date: Tue, 24 Apr 2018 18:13:23 +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,2/6] eventdev: add APIs and PMD callbacks for crypto adapter > X-Mailer: git-send-email 1.9.1 > > Signed-off-by: Abhinandan Gujjar > --- > drivers/event/sw/sw_evdev.c | 13 +++ > lib/librte_eventdev/rte_eventdev.c | 25 +++++ > lib/librte_eventdev/rte_eventdev.h | 52 +++++++++ > lib/librte_eventdev/rte_eventdev_pmd.h | 189 +++++++++++++++++++++++++++++++++ > 4 files changed, 279 insertions(+) > > diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c > index dcb6551..10f0e1a 100644 > --- a/drivers/event/sw/sw_evdev.c > +++ b/drivers/event/sw/sw_evdev.c > @@ -480,6 +480,17 @@ > return 0; > } > > +static int > +sw_crypto_adapter_caps_get(const struct rte_eventdev *dev, > + const struct rte_cryptodev *cdev, > + uint32_t *caps) > +{ > + RTE_SET_USED(dev); > + RTE_SET_USED(cdev); > + *caps = RTE_EVENT_CRYPTO_ADAPTER_SW_CAP; > + return 0; > +} > + > static void > sw_info_get(struct rte_eventdev *dev, struct rte_event_dev_info *info) > { > @@ -809,6 +820,8 @@ static int32_t sw_sched_service_func(void *args) > > .timer_adapter_caps_get = sw_timer_adapter_caps_get, > > + .crypto_adapter_caps_get = sw_crypto_adapter_caps_get, > + > .xstats_get = sw_xstats_get, > .xstats_get_names = sw_xstats_get_names, > .xstats_get_by_name = sw_xstats_get_by_name, > diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c > index 3f016f4..7ca9fd1 100644 > --- a/lib/librte_eventdev/rte_eventdev.c > +++ b/lib/librte_eventdev/rte_eventdev.c > @@ -29,6 +29,8 @@ > #include > #include > #include > +#include > +#include > > #include "rte_eventdev.h" > #include "rte_eventdev_pmd.h" > @@ -145,6 +147,29 @@ > : 0; > } > > +int __rte_experimental > +rte_event_crypto_adapter_caps_get(uint8_t dev_id, uint8_t cdev_id, > + uint32_t *caps) > +{ > + struct rte_eventdev *dev; > + struct rte_cryptodev *cdev; > + > + RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL); > + if (!rte_cryptodev_pmd_is_valid_dev(cdev_id)) > + return -EINVAL; > + > + dev = &rte_eventdevs[dev_id]; > + cdev = rte_cryptodev_pmd_get_dev(cdev_id); > + > + if (caps == NULL) > + return -EINVAL; > + *caps = 0; > + > + return dev->dev_ops->crypto_adapter_caps_get ? > + (*dev->dev_ops->crypto_adapter_caps_get) > + (dev, cdev, caps) : -ENOTSUP; > +} > + > static inline int > rte_event_dev_queue_config(struct rte_eventdev *dev, uint8_t nb_queues) > { > diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h > index 8297f24..9822747 100644 > --- a/lib/librte_eventdev/rte_eventdev.h > +++ b/lib/librte_eventdev/rte_eventdev.h > @@ -8,6 +8,8 @@ > #ifndef _RTE_EVENTDEV_H_ > #define _RTE_EVENTDEV_H_ > > +#include > + > /** > * @file > * > @@ -1135,6 +1137,56 @@ struct rte_event { > int __rte_experimental > rte_event_timer_adapter_caps_get(uint8_t dev_id, uint32_t *caps); > > +/* Crypto adapter capability bitmap flag */ > +#define RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW 0x1 > +/**< Flag indicates HW is capable of generating events. events in RTE_EVENT_OP_NEW enqueue operation > + * Cryptodev will send packets to the event device as new events > + * using an internal event port. > + */ > + > +#define RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD 0x2 > +/**< Flag indicates HW is capable of generating events. events in RTE_EVENT_OP_FWD enqueue operation > + * Cryptodev will send packets to the event device as forwarded event > + * using an internal event port. > + */ > + > +#define RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND 0x4 > +/**< Flag indicates HW is capable of mapping crypto queue pair to > + * event queue. > + */ > + > +#define RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA 0x8 > +/**< Flag indicates HW/SW suports a mechanism to store and retrieve > + * the private data information along with the crypto session. > + */ > + > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change without prior notice > + * > + * Retrieve the event device's crypto adapter capabilities for the > + * specified cryptodev device > + * > + * @param dev_id > + * The identifier of the device. > + * > + * @param cdev_id > + * The identifier of the cryptodev device. > + * > + * @param[out] caps > + * A pointer to memory filled with event adapter capabilities. > + * It is expected to be pre-allocated & initialized by caller. > + * > + * @return > + * - 0: Success, driver provides event adapter capabilities for the > + * cryptodev device. > + * - <0: Error code returned by the driver function. > + * > + */ > +int __rte_experimental > +rte_event_crypto_adapter_caps_get(uint8_t dev_id, uint8_t cdev_id, > + uint32_t *caps); > + > struct rte_eventdev_ops; > struct rte_eventdev; > > diff --git a/lib/librte_eventdev/rte_eventdev_pmd.h b/lib/librte_eventdev/rte_eventdev_pmd.h > index 2dcb528..739b984 100644 > --- a/lib/librte_eventdev/rte_eventdev_pmd.h > +++ b/lib/librte_eventdev/rte_eventdev_pmd.h > @@ -70,6 +70,9 @@ > ((RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID) | \ > (RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ)) > > +#define RTE_EVENT_CRYPTO_ADAPTER_SW_CAP \ > + RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA > + > /**< Ethernet Rx adapter cap to return If the packet transfers from > * the ethdev to eventdev use a SW service function > */ > @@ -617,6 +620,177 @@ typedef int (*eventdev_eth_rx_adapter_stats_reset) > */ > typedef int (*eventdev_selftest)(void); > > + > +struct rte_cryptodev; > +struct rte_event_crypto_queue_pair_conf *conf; Can we get rid of this conf global variable? > + > +/** > + * This API may change without prior notice > + * > + * Retrieve the event device's crypto adapter capabilities for the > + * specified cryptodev > + * > + * @param dev > + * Event device pointer > + * > + * @param cdev > + * cryptodev pointer > + * > + * @param[out] caps > + * A pointer to memory filled with event adapter capabilities. > + * It is expected to be pre-allocated & initialized by caller. > + * > + * @return > + * - 0: Success, driver provides event adapter capabilities for the > + * cryptodev. > + * - <0: Error code returned by the driver function. > + * > + */ > +typedef int (*eventdev_crypto_adapter_caps_get_t) > + (const struct rte_eventdev *dev, > + const struct rte_cryptodev *cdev, > + uint32_t *caps); > + > +/** > + * This API may change without prior notice > + * > + * Add crypto queue pair to event device. This callback is invoked if > + * the caps returned from rte_event_crypto_adapter_caps_get(, cdev_id) > + * has RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_* set. > + * > + * @param dev > + * Event device pointer > + * > + * @param cdev > + * cryptodev pointer > + * > + * @param queue_pair_id > + * cryptodev queue pair identifier. > + * > + * @param conf > + * Additional configuration structure of type > + * *rte_event_crypto_queue_pair_conf*. > + * This structure will have a valid value for only those HW PMDs supporting > + * @see RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND capability. > + * > + * @return > + * - 0: Success, cryptodev queue pair added successfully. > + * - <0: Error code returned by the driver function. > + * > + */ > +typedef int (*eventdev_crypto_adapter_queue_pair_add_t) > + (const struct rte_eventdev *dev, > + const struct rte_cryptodev *cdev, > + int32_t queue_pair_id, > + const struct rte_event_crypto_queue_pair_conf *conf); > + > + > +/** > + * This API may change without prior notice > + * > + * Delete crypto queue pair to event device. This callback is invoked if > + * the caps returned from rte_event_crypto_adapter_caps_get(, cdev_id) > + * has RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_* set. > + * > + * @param dev > + * Event device pointer > + * > + * @param cdev > + * cryptodev pointer > + * > + * @param queue_pair_id > + * cryptodev queue pair identifier. > + * > + * @return > + * - 0: Success, cryptodev queue pair deleted successfully. > + * - <0: Error code returned by the driver function. > + * > + */ > +typedef int (*eventdev_crypto_adapter_queue_pair_del_t) > + (const struct rte_eventdev *dev, > + const struct rte_cryptodev *cdev, > + int32_t queue_pair_id); > + > +/** > + * Start crypto adapter. This callback is invoked if > + * the caps returned from rte_event_crypto_adapter_caps_get(.., cdev_id) > + * has RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_* set and queue pairs > + * from cdev_id have been added to the event device. > + * > + * @param dev > + * Event device pointer > + * > + * @param cdev > + * Crypto device pointer > + * > + * @return > + * - 0: Success, crypto adapter started successfully. > + * - <0: Error code returned by the driver function. > + */ > +typedef int (*eventdev_crypto_adapter_start_t) > + (const struct rte_eventdev *dev, > + const struct rte_cryptodev *cdev); > + > +/** > + * Stop crypto adapter. This callback is invoked if > + * the caps returned from rte_event_crypto_adapter_caps_get(.., cdev_id) > + * has RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_* set and queue pairs > + * from cdev_id have been added to the event device. > + * > + * @param dev > + * Event device pointer > + * > + * @param cdev > + * Crypto device pointer > + * > + * @return > + * - 0: Success, crypto adapter stopped successfully. > + * - <0: Error code returned by the driver function. > + */ > +typedef int (*eventdev_crypto_adapter_stop_t) > + (const struct rte_eventdev *dev, > + const struct rte_cryptodev *cdev); > + > +struct rte_event_crypto_adapter_stats; > + > +/** > + * Retrieve crypto adapter statistics. > + * > + * @param dev > + * Event device pointer > + * > + * @param cdev > + * Crypto device pointer > + * > + * @param[out] stats > + * Pointer to stats structure > + * > + * @return > + * Return 0 on success. > + */ > + > +typedef int (*eventdev_crypto_adapter_stats_get) > + (const struct rte_eventdev *dev, > + const struct rte_cryptodev *cdev, > + struct rte_event_crypto_adapter_stats *stats); > + > +/** > + * Reset crypto adapter statistics. > + * > + * @param dev > + * Event device pointer > + * > + * @param cdev > + * Crypto device pointer > + * > + * @return > + * Return 0 on success. > + */ > + > +typedef int (*eventdev_crypto_adapter_stats_reset) > + (const struct rte_eventdev *dev, > + const struct rte_cryptodev *cdev); > + > /** Event device operations function pointer table */ > struct rte_eventdev_ops { > eventdev_info_get_t dev_infos_get; /**< Get device info. */ > @@ -675,6 +849,21 @@ struct rte_eventdev_ops { > eventdev_timer_adapter_caps_get_t timer_adapter_caps_get; > /**< Get timer adapter capabilities */ > > + eventdev_crypto_adapter_caps_get_t crypto_adapter_caps_get; > + /**< Get crypto adapter capabilities */ > + eventdev_crypto_adapter_queue_pair_add_t crypto_adapter_queue_pair_add; > + /**< Add queue pair to crypto adapter */ > + eventdev_crypto_adapter_queue_pair_del_t crypto_adapter_queue_pair_del; > + /**< Delete queue pair from crypto adapter */ > + eventdev_crypto_adapter_start_t crypto_adapter_start; > + /**< Start crypto adapter */ > + eventdev_crypto_adapter_stop_t crypto_adapter_stop; > + /**< Stop crypto adapter */ > + eventdev_crypto_adapter_stats_get crypto_adapter_stats_get; > + /**< Get crypto stats */ > + eventdev_crypto_adapter_stats_reset crypto_adapter_stats_reset; > + /**< Reset crypto stats */ > + > eventdev_selftest dev_selftest; > /**< Start eventdev Selftest */ > > -- > 1.9.1 >