cryptodev: introduce API and framework for crypto devices
[dpdk.git] / lib / librte_cryptodev / rte_cryptodev.h
1 /*-
2  *
3  *   Copyright(c) 2015 Intel Corporation. All rights reserved.
4  *
5  *   Redistribution and use in source and binary forms, with or without
6  *   modification, are permitted provided that the following conditions
7  *   are met:
8  *
9  *     * Redistributions of source code must retain the above copyright
10  *       notice, this list of conditions and the following disclaimer.
11  *     * Redistributions in binary form must reproduce the above copyright
12  *       notice, this list of conditions and the following disclaimer in
13  *       the documentation and/or other materials provided with the
14  *       distribution.
15  *     * Neither the name of Intel Corporation nor the names of its
16  *       contributors may be used to endorse or promote products derived
17  *       from this software without specific prior written permission.
18  *
19  *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21  *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22  *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23  *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24  *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25  *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26  *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27  *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28  *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30  */
31
32 #ifndef _RTE_CRYPTODEV_H_
33 #define _RTE_CRYPTODEV_H_
34
35 /**
36  * @file rte_cryptodev.h
37  *
38  * RTE Cryptographic Device APIs
39  *
40  * Defines RTE Crypto Device APIs for the provisioning of cipher and
41  * authentication operations.
42  */
43
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47
48 #include "stddef.h"
49
50 #include "rte_crypto.h"
51 #include "rte_dev.h"
52
53 #define CRYPTODEV_NAME_NULL_PMD         ("cryptodev_null_pmd")
54 /**< Null crypto PMD device name */
55 #define CRYPTODEV_NAME_AESNI_MB_PMD     ("cryptodev_aesni_mb_pmd")
56 /**< AES-NI Multi buffer PMD device name */
57 #define CRYPTODEV_NAME_QAT_PMD          ("cryptodev_qat_pmd")
58 /**< Intel QAT PMD device name */
59
60 /** Crypto device type */
61 enum rte_cryptodev_type {
62         RTE_CRYPTODEV_NULL_PMD = 1,     /**< Null crypto PMD */
63         RTE_CRYPTODEV_AESNI_MB_PMD,     /**< AES-NI multi buffer PMD */
64         RTE_CRYPTODEV_QAT_PMD,          /**< QAT PMD */
65 };
66
67 /* Logging Macros */
68
69 #define CDEV_LOG_ERR(fmt, args...)                                      \
70                 RTE_LOG(ERR, CRYPTODEV, "%s() line %u: " fmt "\n",      \
71                                 __func__, __LINE__, ## args)
72
73 #define CDEV_PMD_LOG_ERR(dev, fmt, args...)                             \
74                 RTE_LOG(ERR, CRYPTODEV, "[%s] %s() line %u: " fmt "\n", \
75                                 dev, __func__, __LINE__, ## args)
76
77 #ifdef RTE_LIBRTE_CRYPTODEV_DEBUG
78 #define CDEV_LOG_DEBUG(fmt, args...)                                    \
79                 RTE_LOG(DEBUG, CRYPTODEV, "%s() line %u: " fmt "\n",    \
80                                 __func__, __LINE__, ## args)            \
81
82 #define CDEV_PMD_TRACE(fmt, args...)                                    \
83                 RTE_LOG(DEBUG, CRYPTODEV, "[%s] %s: " fmt "\n",         \
84                                 dev, __func__, ## args)
85
86 #else
87 #define CDEV_LOG_DEBUG(fmt, args...)
88 #define CDEV_PMD_TRACE(fmt, args...)
89 #endif
90
91 /**  Crypto device information */
92 struct rte_cryptodev_info {
93         const char *driver_name;                /**< Driver name. */
94         enum rte_cryptodev_type dev_type;       /**< Device type */
95         struct rte_pci_device *pci_dev;         /**< PCI information. */
96
97         unsigned max_nb_queue_pairs;
98         /**< Maximum number of queues pairs supported by device. */
99         unsigned max_nb_sessions;
100         /**< Maximum number of sessions supported by device. */
101 };
102
103 #define RTE_CRYPTODEV_DETACHED  (0)
104 #define RTE_CRYPTODEV_ATTACHED  (1)
105
106 /** Definitions of Crypto device event types */
107 enum rte_cryptodev_event_type {
108         RTE_CRYPTODEV_EVENT_UNKNOWN,    /**< unknown event type */
109         RTE_CRYPTODEV_EVENT_ERROR,      /**< error interrupt event */
110         RTE_CRYPTODEV_EVENT_MAX         /**< max value of this enum */
111 };
112
113 /** Crypto device queue pair configuration structure. */
114 struct rte_cryptodev_qp_conf {
115         uint32_t nb_descriptors; /**< Number of descriptors per queue pair */
116 };
117
118 /**
119  * Typedef for application callback function to be registered by application
120  * software for notification of device events
121  *
122  * @param       dev_id  Crypto device identifier
123  * @param       event   Crypto device event to register for notification of.
124  * @param       cb_arg  User specified parameter to be passed as to passed to
125  *                      users callback function.
126  */
127 typedef void (*rte_cryptodev_cb_fn)(uint8_t dev_id,
128                 enum rte_cryptodev_event_type event, void *cb_arg);
129
130 #ifdef RTE_CRYPTODEV_PERF
131 /**
132  * Crypto Device performance counter statistics structure. This structure is
133  * used for RDTSC counters for measuring crypto operations.
134  */
135 struct rte_cryptodev_perf_stats {
136         uint64_t t_accumlated;  /**< Accumulated time processing operation */
137         uint64_t t_min;         /**< Max time */
138         uint64_t t_max;         /**< Min time */
139 };
140 #endif
141
142 /** Crypto Device statistics */
143 struct rte_cryptodev_stats {
144         uint64_t enqueued_count;
145         /**< Count of all operations enqueued */
146         uint64_t dequeued_count;
147         /**< Count of all operations dequeued */
148
149         uint64_t enqueue_err_count;
150         /**< Total error count on operations enqueued */
151         uint64_t dequeue_err_count;
152         /**< Total error count on operations dequeued */
153
154 #ifdef RTE_CRYPTODEV_DETAILED_STATS
155         struct {
156                 uint64_t encrypt_ops;   /**< Count of encrypt operations */
157                 uint64_t encrypt_bytes; /**< Number of bytes encrypted */
158
159                 uint64_t decrypt_ops;   /**< Count of decrypt operations */
160                 uint64_t decrypt_bytes; /**< Number of bytes decrypted */
161         } cipher; /**< Cipher operations stats */
162
163         struct {
164                 uint64_t generate_ops;  /**< Count of generate operations */
165                 uint64_t bytes_hashed;  /**< Number of bytes hashed */
166
167                 uint64_t verify_ops;    /**< Count of verify operations */
168                 uint64_t bytes_verified;/**< Number of bytes verified */
169         } hash;  /**< Hash operations stats */
170 #endif
171
172 #ifdef RTE_CRYPTODEV_PERF
173         struct rte_cryptodev_perf_stats op_perf; /**< Operations stats */
174 #endif
175 } __rte_cache_aligned;
176
177 /**
178  * Create a virtual crypto device
179  *
180  * @param       name    Cryptodev PMD name of device to be created.
181  * @param       args    Options arguments for device.
182  *
183  * @return
184  * - On successful creation of the cryptodev the device index is returned,
185  *   which will be between 0 and rte_cryptodev_count().
186  * - In the case of a failure, returns -1.
187  */
188 extern int
189 rte_cryptodev_create_vdev(const char *name, const char *args);
190
191 /**
192  * Get the device identifier for the named crypto device.
193  *
194  * @param       name    device name to select the device structure.
195  *
196  * @return
197  *   - Returns crypto device identifier on success.
198  *   - Return -1 on failure to find named crypto device.
199  */
200 extern int
201 rte_cryptodev_get_dev_id(const char *name);
202
203 /**
204  * Get the total number of crypto devices that have been successfully
205  * initialised.
206  *
207  * @return
208  *   - The total number of usable crypto devices.
209  */
210 extern uint8_t
211 rte_cryptodev_count(void);
212
213 extern uint8_t
214 rte_cryptodev_count_devtype(enum rte_cryptodev_type type);
215 /*
216  * Return the NUMA socket to which a device is connected
217  *
218  * @param dev_id
219  *   The identifier of the device
220  * @return
221  *   The NUMA socket id to which the device is connected or
222  *   a default of zero if the socket could not be determined.
223  *   -1 if returned is the dev_id value is out of range.
224  */
225 extern int
226 rte_cryptodev_socket_id(uint8_t dev_id);
227
228 /** Crypto device configuration structure */
229 struct rte_cryptodev_config {
230         int socket_id;                  /**< Socket to allocate resources on */
231         uint16_t nb_queue_pairs;
232         /**< Number of queue pairs to configure on device */
233
234         struct {
235                 uint32_t nb_objs;       /**< Number of objects in mempool */
236                 uint32_t cache_size;    /**< l-core object cache size */
237         } session_mp;           /**< Session mempool configuration */
238 };
239
240 /**
241  * Configure a device.
242  *
243  * This function must be invoked first before any other function in the
244  * API. This function can also be re-invoked when a device is in the
245  * stopped state.
246  *
247  * @param       dev_id          The identifier of the device to configure.
248  * @param       config          The crypto device configuration structure.
249  *
250  * @return
251  *   - 0: Success, device configured.
252  *   - <0: Error code returned by the driver configuration function.
253  */
254 extern int
255 rte_cryptodev_configure(uint8_t dev_id, struct rte_cryptodev_config *config);
256
257 /**
258  * Start an device.
259  *
260  * The device start step is the last one and consists of setting the configured
261  * offload features and in starting the transmit and the receive units of the
262  * device.
263  * On success, all basic functions exported by the API (link status,
264  * receive/transmit, and so on) can be invoked.
265  *
266  * @param dev_id
267  *   The identifier of the device.
268  * @return
269  *   - 0: Success, device started.
270  *   - <0: Error code of the driver device start function.
271  */
272 extern int
273 rte_cryptodev_start(uint8_t dev_id);
274
275 /**
276  * Stop an device. The device can be restarted with a call to
277  * rte_cryptodev_start()
278  *
279  * @param       dev_id          The identifier of the device.
280  */
281 extern void
282 rte_cryptodev_stop(uint8_t dev_id);
283
284 /**
285  * Close an device. The device cannot be restarted!
286  *
287  * @param       dev_id          The identifier of the device.
288  *
289  * @return
290  *  - 0 on successfully closing device
291  *  - <0 on failure to close device
292  */
293 extern int
294 rte_cryptodev_close(uint8_t dev_id);
295
296 /**
297  * Allocate and set up a receive queue pair for a device.
298  *
299  *
300  * @param       dev_id          The identifier of the device.
301  * @param       queue_pair_id   The index of the queue pairs to set up. The
302  *                              value must be in the range [0, nb_queue_pair
303  *                              - 1] previously supplied to
304  *                              rte_cryptodev_configure().
305  * @param       qp_conf         The pointer to the configuration data to be
306  *                              used for the queue pair. NULL value is
307  *                              allowed, in which case default configuration
308  *                              will be used.
309  * @param       socket_id       The *socket_id* argument is the socket
310  *                              identifier in case of NUMA. The value can be
311  *                              *SOCKET_ID_ANY* if there is no NUMA constraint
312  *                              for the DMA memory allocated for the receive
313  *                              queue pair.
314  *
315  * @return
316  *   - 0: Success, queue pair correctly set up.
317  *   - <0: Queue pair configuration failed
318  */
319 extern int
320 rte_cryptodev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id,
321                 const struct rte_cryptodev_qp_conf *qp_conf, int socket_id);
322
323 /**
324  * Start a specified queue pair of a device. It is used
325  * when deferred_start flag of the specified queue is true.
326  *
327  * @param       dev_id          The identifier of the device
328  * @param       queue_pair_id   The index of the queue pair to start. The value
329  *                              must be in the range [0, nb_queue_pair - 1]
330  *                              previously supplied to
331  *                              rte_crypto_dev_configure().
332  * @return
333  *   - 0: Success, the transmit queue is correctly set up.
334  *   - -EINVAL: The dev_id or the queue_id out of range.
335  *   - -ENOTSUP: The function not supported in PMD driver.
336  */
337 extern int
338 rte_cryptodev_queue_pair_start(uint8_t dev_id, uint16_t queue_pair_id);
339
340 /**
341  * Stop specified queue pair of a device
342  *
343  * @param       dev_id          The identifier of the device
344  * @param       queue_pair_id   The index of the queue pair to stop. The value
345  *                              must be in the range [0, nb_queue_pair - 1]
346  *                              previously supplied to
347  *                              rte_cryptodev_configure().
348  * @return
349  *   - 0: Success, the transmit queue is correctly set up.
350  *   - -EINVAL: The dev_id or the queue_id out of range.
351  *   - -ENOTSUP: The function not supported in PMD driver.
352  */
353 extern int
354 rte_cryptodev_queue_pair_stop(uint8_t dev_id, uint16_t queue_pair_id);
355
356 /**
357  * Get the number of queue pairs on a specific crypto device
358  *
359  * @param       dev_id          Crypto device identifier.
360  * @return
361  *   - The number of configured queue pairs.
362  */
363 extern uint16_t
364 rte_cryptodev_queue_pair_count(uint8_t dev_id);
365
366
367 /**
368  * Retrieve the general I/O statistics of a device.
369  *
370  * @param       dev_id          The identifier of the device.
371  * @param       stats           A pointer to a structure of type
372  *                              *rte_cryptodev_stats* to be filled with the
373  *                              values of device counters.
374  * @return
375  *   - Zero if successful.
376  *   - Non-zero otherwise.
377  */
378 extern int
379 rte_cryptodev_stats_get(uint8_t dev_id, struct rte_cryptodev_stats *stats);
380
381 /**
382  * Reset the general I/O statistics of a device.
383  *
384  * @param       dev_id          The identifier of the device.
385  */
386 extern void
387 rte_cryptodev_stats_reset(uint8_t dev_id);
388
389 /**
390  * Retrieve the contextual information of a device.
391  *
392  * @param       dev_id          The identifier of the device.
393  * @param       dev_info        A pointer to a structure of type
394  *                              *rte_cryptodev_info* to be filled with the
395  *                              contextual information of the device.
396  */
397 extern void
398 rte_cryptodev_info_get(uint8_t dev_id, struct rte_cryptodev_info *dev_info);
399
400
401 /**
402  * Register a callback function for specific device id.
403  *
404  * @param       dev_id          Device id.
405  * @param       event           Event interested.
406  * @param       cb_fn           User supplied callback function to be called.
407  * @param       cb_arg          Pointer to the parameters for the registered
408  *                              callback.
409  *
410  * @return
411  *  - On success, zero.
412  *  - On failure, a negative value.
413  */
414 extern int
415 rte_cryptodev_callback_register(uint8_t dev_id,
416                 enum rte_cryptodev_event_type event,
417                 rte_cryptodev_cb_fn cb_fn, void *cb_arg);
418
419 /**
420  * Unregister a callback function for specific device id.
421  *
422  * @param       dev_id          The device identifier.
423  * @param       event           Event interested.
424  * @param       cb_fn           User supplied callback function to be called.
425  * @param       cb_arg          Pointer to the parameters for the registered
426  *                              callback.
427  *
428  * @return
429  *  - On success, zero.
430  *  - On failure, a negative value.
431  */
432 extern int
433 rte_cryptodev_callback_unregister(uint8_t dev_id,
434                 enum rte_cryptodev_event_type event,
435                 rte_cryptodev_cb_fn cb_fn, void *cb_arg);
436
437
438 typedef uint16_t (*dequeue_pkt_burst_t)(void *qp, struct rte_mbuf **pkts,
439                 uint16_t nb_pkts);
440 /**< Dequeue processed packets from queue pair of a device. */
441
442 typedef uint16_t (*enqueue_pkt_burst_t)(void *qp, struct rte_mbuf **pkts,
443                 uint16_t nb_pkts);
444 /**< Enqueue packets for processing on queue pair of a device. */
445
446
447 struct rte_cryptodev_callback;
448
449 /** Structure to keep track of registered callbacks */
450 TAILQ_HEAD(rte_cryptodev_cb_list, rte_cryptodev_callback);
451
452 /** The data structure associated with each crypto device. */
453 struct rte_cryptodev {
454         dequeue_pkt_burst_t dequeue_burst;
455         /**< Pointer to PMD receive function. */
456         enqueue_pkt_burst_t enqueue_burst;
457         /**< Pointer to PMD transmit function. */
458
459         const struct rte_cryptodev_driver *driver;
460         /**< Driver for this device */
461         struct rte_cryptodev_data *data;
462         /**< Pointer to device data */
463         struct rte_cryptodev_ops *dev_ops;
464         /**< Functions exported by PMD */
465         struct rte_pci_device *pci_dev;
466         /**< PCI info. supplied by probing */
467
468         enum rte_cryptodev_type dev_type;
469         /**< Crypto device type */
470         enum pmd_type pmd_type;
471         /**< PMD type - PDEV / VDEV */
472
473         struct rte_cryptodev_cb_list link_intr_cbs;
474         /**< User application callback for interrupts if present */
475
476         uint8_t attached : 1;
477         /**< Flag indicating the device is attached */
478 } __rte_cache_aligned;
479
480
481 #define RTE_CRYPTODEV_NAME_MAX_LEN      (64)
482 /**< Max length of name of crypto PMD */
483
484 /**
485  *
486  * The data part, with no function pointers, associated with each device.
487  *
488  * This structure is safe to place in shared memory to be common among
489  * different processes in a multi-process configuration.
490  */
491 struct rte_cryptodev_data {
492         uint8_t dev_id;
493         /**< Device ID for this instance */
494         uint8_t socket_id;
495         /**< Socket ID where memory is allocated */
496         char name[RTE_CRYPTODEV_NAME_MAX_LEN];
497         /**< Unique identifier name */
498
499         uint8_t dev_started : 1;
500         /**< Device state: STARTED(1)/STOPPED(0) */
501
502         struct rte_mempool *session_pool;
503         /**< Session memory pool */
504         void **queue_pairs;
505         /**< Array of pointers to queue pairs. */
506         uint16_t nb_queue_pairs;
507         /**< Number of device queue pairs. */
508
509         void *dev_private;
510         /**< PMD-specific private data */
511 } __rte_cache_aligned;
512
513 extern struct rte_cryptodev *rte_cryptodevs;
514 /**
515  *
516  * Dequeue a burst of processed packets from a queue of the crypto device.
517  * The dequeued packets are stored in *rte_mbuf* structures whose pointers are
518  * supplied in the *pkts* array.
519  *
520  * The rte_crypto_dequeue_burst() function returns the number of packets
521  * actually dequeued, which is the number of *rte_mbuf* data structures
522  * effectively supplied into the *pkts* array.
523  *
524  * A return value equal to *nb_pkts* indicates that the queue contained
525  * at least *rx_pkts* packets, and this is likely to signify that other
526  * received packets remain in the input queue. Applications implementing
527  * a "retrieve as much received packets as possible" policy can check this
528  * specific case and keep invoking the rte_crypto_dequeue_burst() function
529  * until a value less than *nb_pkts* is returned.
530  *
531  * The rte_crypto_dequeue_burst() function does not provide any error
532  * notification to avoid the corresponding overhead.
533  *
534  * @param       dev_id          The identifier of the device.
535  * @param       qp_id           The index of the queue pair from which to
536  *                              retrieve processed packets. The value must be
537  *                              in the range [0, nb_queue_pair - 1] previously
538  *                              supplied to rte_cryptodev_configure().
539  * @param       pkts            The address of an array of pointers to
540  *                              *rte_mbuf* structures that must be large enough
541  *                              to store *nb_pkts* pointers in it.
542  * @param       nb_pkts         The maximum number of packets to dequeue.
543  *
544  * @return
545  *   - The number of packets actually dequeued, which is the number
546  *   of pointers to *rte_mbuf* structures effectively supplied to the
547  *   *pkts* array.
548  */
549 static inline uint16_t
550 rte_cryptodev_dequeue_burst(uint8_t dev_id, uint16_t qp_id,
551                 struct rte_mbuf **pkts, uint16_t nb_pkts)
552 {
553         struct rte_cryptodev *dev = &rte_cryptodevs[dev_id];
554
555         nb_pkts = (*dev->dequeue_burst)
556                         (dev->data->queue_pairs[qp_id], pkts, nb_pkts);
557
558         return nb_pkts;
559 }
560
561 /**
562  * Enqueue a burst of packets for processing on a crypto device.
563  *
564  * The rte_crypto_enqueue_burst() function is invoked to place packets
565  * on the queue *queue_id* of the device designated by its *dev_id*.
566  *
567  * The *nb_pkts* parameter is the number of packets to process which are
568  * supplied in the *pkts* array of *rte_mbuf* structures.
569  *
570  * The rte_crypto_enqueue_burst() function returns the number of packets it
571  * actually sent. A return value equal to *nb_pkts* means that all packets
572  * have been sent.
573  *
574  * Each mbuf in the *pkts* array must have a valid *rte_mbuf_offload* structure
575  * attached which contains a valid crypto operation.
576  *
577  * @param       dev_id          The identifier of the device.
578  * @param       qp_id           The index of the queue pair which packets are
579  *                              to be enqueued for processing. The value
580  *                              must be in the range [0, nb_queue_pairs - 1]
581  *                              previously supplied to
582  *                               *rte_cryptodev_configure*.
583  * @param       pkts            The address of an array of *nb_pkts* pointers
584  *                              to *rte_mbuf* structures which contain the
585  *                              output packets.
586  * @param       nb_pkts         The number of packets to transmit.
587  *
588  * @return
589  * The number of packets actually enqueued on the crypto device. The return
590  * value can be less than the value of the *nb_pkts* parameter when the
591  * crypto devices queue is full or has been filled up.
592  * The number of packets is 0 if the device hasn't been started.
593  */
594 static inline uint16_t
595 rte_cryptodev_enqueue_burst(uint8_t dev_id, uint16_t qp_id,
596                 struct rte_mbuf **pkts, uint16_t nb_pkts)
597 {
598         struct rte_cryptodev *dev = &rte_cryptodevs[dev_id];
599
600         return (*dev->enqueue_burst)(
601                         dev->data->queue_pairs[qp_id], pkts, nb_pkts);
602 }
603
604
605 /**
606  * Initialise a session for symmetric cryptographic operations.
607  *
608  * This function is used by the client to initialize immutable
609  * parameters of symmetric cryptographic operation.
610  * To perform the operation the rte_cryptodev_enqueue_burst function is
611  * used.  Each mbuf should contain a reference to the session
612  * pointer returned from this function contained within it's crypto_op if a
613  * session-based operation is being provisioned. Memory to contain the session
614  * information is allocated from within mempool managed by the cryptodev.
615  *
616  * The rte_cryptodev_session_free must be called to free allocated
617  * memory when the session is no longer required.
618  *
619  * @param       dev_id          The device identifier.
620  * @param       xform           Crypto transform chain.
621
622  *
623  * @return
624  *  Pointer to the created session or NULL
625  */
626 extern struct rte_cryptodev_session *
627 rte_cryptodev_session_create(uint8_t dev_id,
628                 struct rte_crypto_xform *xform);
629
630
631 /**
632  * Free the memory associated with a previously allocated session.
633  *
634  * @param       dev_id          The device identifier.
635  * @param       session         Session pointer previously allocated by
636  *                              *rte_cryptodev_session_create*.
637  *
638  * @return
639  *   NULL on successful freeing of session.
640  *   Session pointer on failure to free session.
641  */
642 extern struct rte_cryptodev_session *
643 rte_cryptodev_session_free(uint8_t dev_id,
644                 struct rte_cryptodev_session *session);
645
646
647 #ifdef __cplusplus
648 }
649 #endif
650
651 #endif /* _RTE_CRYPTODEV_H_ */