DPDK  20.11.10
rte_cryptodev.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2015-2020 Intel Corporation.
3  */
4 
5 #ifndef _RTE_CRYPTODEV_H_
6 #define _RTE_CRYPTODEV_H_
7 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 #include "rte_kvargs.h"
22 #include "rte_crypto.h"
23 #include "rte_dev.h"
24 #include <rte_common.h>
25 #include <rte_config.h>
26 
27 #include "rte_cryptodev_trace_fp.h"
28 
29 extern const char **rte_cyptodev_names;
30 
31 /* Logging Macros */
32 
33 #define CDEV_LOG_ERR(...) \
34  RTE_LOG(ERR, CRYPTODEV, \
35  RTE_FMT("%s() line %u: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
36  __func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__,)))
37 
38 #define CDEV_LOG_INFO(...) \
39  RTE_LOG(INFO, CRYPTODEV, \
40  RTE_FMT(RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
41  RTE_FMT_TAIL(__VA_ARGS__,)))
42 
43 #define CDEV_LOG_DEBUG(...) \
44  RTE_LOG(DEBUG, CRYPTODEV, \
45  RTE_FMT("%s() line %u: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
46  __func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__,)))
47 
48 #define CDEV_PMD_TRACE(...) \
49  RTE_LOG(DEBUG, CRYPTODEV, \
50  RTE_FMT("[%s] %s: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
51  dev, __func__, RTE_FMT_TAIL(__VA_ARGS__,)))
52 
66 #define rte_crypto_op_ctod_offset(c, t, o) \
67  ((t)((char *)(c) + (o)))
68 
80 #define rte_crypto_op_ctophys_offset(c, o) \
81  (rte_iova_t)((c)->phys_addr + (o))
82 
87  uint16_t min;
88  uint16_t max;
89  uint16_t increment;
95 };
96 
101  enum rte_crypto_sym_xform_type xform_type;
104  union {
105  struct {
108  uint16_t block_size;
110  struct rte_crypto_param_range key_size;
112  struct rte_crypto_param_range digest_size;
114  struct rte_crypto_param_range aad_size;
116  struct rte_crypto_param_range iv_size;
118  } auth;
120  struct {
123  uint16_t block_size;
125  struct rte_crypto_param_range key_size;
127  struct rte_crypto_param_range iv_size;
129  } cipher;
131  struct {
134  uint16_t block_size;
136  struct rte_crypto_param_range key_size;
138  struct rte_crypto_param_range digest_size;
140  struct rte_crypto_param_range aad_size;
142  struct rte_crypto_param_range iv_size;
144  } aead;
145  };
146 };
147 
153  enum rte_crypto_asym_xform_type xform_type;
156  uint32_t op_types;
159  __extension__
160  union {
161  struct rte_crypto_param_range modlen;
165  };
166 };
167 
174 };
175 
176 
183  union {
188  };
189 };
190 
193  enum rte_crypto_sym_xform_type type;
194  union {
195  enum rte_crypto_cipher_algorithm cipher;
196  enum rte_crypto_auth_algorithm auth;
197  enum rte_crypto_aead_algorithm aead;
198  } algo;
199 };
200 
209 };
210 
222 rte_cryptodev_sym_capability_get(uint8_t dev_id,
223  const struct rte_cryptodev_sym_capability_idx *idx);
224 
235 __rte_experimental
237 rte_cryptodev_asym_capability_get(uint8_t dev_id,
238  const struct rte_cryptodev_asym_capability_idx *idx);
239 
252 int
254  const struct rte_cryptodev_symmetric_capability *capability,
255  uint16_t key_size, uint16_t iv_size);
256 
270 int
272  const struct rte_cryptodev_symmetric_capability *capability,
273  uint16_t key_size, uint16_t digest_size, uint16_t iv_size);
274 
289 int
291  const struct rte_cryptodev_symmetric_capability *capability,
292  uint16_t key_size, uint16_t digest_size, uint16_t aad_size,
293  uint16_t iv_size);
294 
305 __rte_experimental
306 int
308  const struct rte_cryptodev_asymmetric_xform_capability *capability,
309  enum rte_crypto_asym_op_type op_type);
310 
321 __rte_experimental
322 int
324  const struct rte_cryptodev_asymmetric_xform_capability *capability,
325  uint16_t modlen);
326 
338 int
340  const char *algo_string);
341 
353 int
355  const char *algo_string);
356 
368 int
370  const char *algo_string);
371 
383 __rte_experimental
384 int
386  const char *xform_string);
387 
388 
390 #define RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST() \
391  { RTE_CRYPTO_OP_TYPE_UNDEFINED }
392 
393 
402 #define RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO (1ULL << 0)
403 
404 #define RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO (1ULL << 1)
405 
406 #define RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING (1ULL << 2)
407 
408 #define RTE_CRYPTODEV_FF_CPU_SSE (1ULL << 3)
409 
410 #define RTE_CRYPTODEV_FF_CPU_AVX (1ULL << 4)
411 
412 #define RTE_CRYPTODEV_FF_CPU_AVX2 (1ULL << 5)
413 
414 #define RTE_CRYPTODEV_FF_CPU_AESNI (1ULL << 6)
415 
416 #define RTE_CRYPTODEV_FF_HW_ACCELERATED (1ULL << 7)
417 
420 #define RTE_CRYPTODEV_FF_CPU_AVX512 (1ULL << 8)
421 
422 #define RTE_CRYPTODEV_FF_IN_PLACE_SGL (1ULL << 9)
423 
426 #define RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT (1ULL << 10)
427 
430 #define RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT (1ULL << 11)
431 
435 #define RTE_CRYPTODEV_FF_OOP_LB_IN_SGL_OUT (1ULL << 12)
436 
439 #define RTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUT (1ULL << 13)
440 
441 #define RTE_CRYPTODEV_FF_CPU_NEON (1ULL << 14)
442 
443 #define RTE_CRYPTODEV_FF_CPU_ARM_CE (1ULL << 15)
444 
445 #define RTE_CRYPTODEV_FF_SECURITY (1ULL << 16)
446 
447 #define RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_EXP (1ULL << 17)
448 
449 #define RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_QT (1ULL << 18)
450 
451 #define RTE_CRYPTODEV_FF_DIGEST_ENCRYPTED (1ULL << 19)
452 
453 #define RTE_CRYPTODEV_FF_ASYM_SESSIONLESS (1ULL << 20)
454 
455 #define RTE_CRYPTODEV_FF_SYM_CPU_CRYPTO (1ULL << 21)
456 
457 #define RTE_CRYPTODEV_FF_SYM_SESSIONLESS (1ULL << 22)
458 
459 #define RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA (1ULL << 23)
460 
461 #define RTE_CRYPTODEV_FF_SYM_RAW_DP (1ULL << 24)
462 
473 extern const char *
474 rte_cryptodev_get_feature_name(uint64_t flag);
475 
477 /* Structure rte_cryptodev_info 8< */
479  const char *driver_name;
480  uint8_t driver_id;
481  struct rte_device *device;
483  uint64_t feature_flags;
498  struct {
499  unsigned max_nb_sessions;
504  } sym;
505 };
506 /* >8 End of structure rte_cryptodev_info. */
507 
508 #define RTE_CRYPTODEV_DETACHED (0)
509 #define RTE_CRYPTODEV_ATTACHED (1)
510 
516 };
517 
519 /* Structure rte_cryptodev_qp_conf 8<*/
521  uint32_t nb_descriptors;
526 };
527 /* >8 End of structure rte_cryptodev_qp_conf. */
528 
538 typedef void (*rte_cryptodev_cb_fn)(uint8_t dev_id,
539  enum rte_cryptodev_event_type event, void *cb_arg);
540 
541 
544  uint64_t enqueued_count;
546  uint64_t dequeued_count;
553 };
554 
555 #define RTE_CRYPTODEV_NAME_MAX_LEN (64)
556 
567 extern int
568 rte_cryptodev_get_dev_id(const char *name);
569 
580 extern const char *
581 rte_cryptodev_name_get(uint8_t dev_id);
582 
590 extern uint8_t
591 rte_cryptodev_count(void);
592 
601 extern uint8_t
602 rte_cryptodev_device_count_by_driver(uint8_t driver_id);
603 
615 uint8_t
616 rte_cryptodev_devices_get(const char *driver_name, uint8_t *devices,
617  uint8_t nb_devices);
618 /*
619  * Return the NUMA socket to which a device is connected
620  *
621  * @param dev_id
622  * The identifier of the device
623  * @return
624  * The NUMA socket id to which the device is connected or
625  * a default of zero if the socket could not be determined.
626  * -1 if returned is the dev_id value is out of range.
627  */
628 extern int
629 rte_cryptodev_socket_id(uint8_t dev_id);
630 
632 /* Structure rte_cryptodev_config 8< */
634  int socket_id;
635  uint16_t nb_queue_pairs;
637  uint64_t ff_disable;
644 };
645 /* >8 End of structure rte_cryptodev_config. */
646 
661 extern int
662 rte_cryptodev_configure(uint8_t dev_id, struct rte_cryptodev_config *config);
663 
679 extern int
680 rte_cryptodev_start(uint8_t dev_id);
681 
688 extern void
689 rte_cryptodev_stop(uint8_t dev_id);
690 
700 extern int
701 rte_cryptodev_close(uint8_t dev_id);
702 
724 extern int
725 rte_cryptodev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id,
726  const struct rte_cryptodev_qp_conf *qp_conf, int socket_id);
727 
741 __rte_experimental
742 int
743 rte_cryptodev_get_qp_status(uint8_t dev_id, uint16_t queue_pair_id);
744 
752 extern uint16_t
753 rte_cryptodev_queue_pair_count(uint8_t dev_id);
754 
755 
767 extern int
768 rte_cryptodev_stats_get(uint8_t dev_id, struct rte_cryptodev_stats *stats);
769 
775 extern void
776 rte_cryptodev_stats_reset(uint8_t dev_id);
777 
791 extern void
792 rte_cryptodev_info_get(uint8_t dev_id, struct rte_cryptodev_info *dev_info);
793 
794 
808 extern int
809 rte_cryptodev_callback_register(uint8_t dev_id,
810  enum rte_cryptodev_event_type event,
811  rte_cryptodev_cb_fn cb_fn, void *cb_arg);
812 
826 extern int
827 rte_cryptodev_callback_unregister(uint8_t dev_id,
828  enum rte_cryptodev_event_type event,
829  rte_cryptodev_cb_fn cb_fn, void *cb_arg);
830 
831 
832 typedef uint16_t (*dequeue_pkt_burst_t)(void *qp,
833  struct rte_crypto_op **ops, uint16_t nb_ops);
836 typedef uint16_t (*enqueue_pkt_burst_t)(void *qp,
837  struct rte_crypto_op **ops, uint16_t nb_ops);
843 struct rte_cryptodev_callback;
844 
846 TAILQ_HEAD(rte_cryptodev_cb_list, rte_cryptodev_callback);
847 
859  uint64_t feature_flags;
864  uint8_t driver_id;
867  struct rte_cryptodev_cb_list link_intr_cbs;
873  __extension__
874  uint8_t attached : 1;
877 
887 void *
888 rte_cryptodev_get_sec_ctx(uint8_t dev_id);
889 
898  uint8_t dev_id;
900  uint8_t socket_id;
905  __extension__
906  uint8_t dev_started : 1;
911  void **queue_pairs;
913  uint16_t nb_queue_pairs;
916  void *dev_private;
919 
920 extern struct rte_cryptodev *rte_cryptodevs;
957 static inline uint16_t
958 rte_cryptodev_dequeue_burst(uint8_t dev_id, uint16_t qp_id,
959  struct rte_crypto_op **ops, uint16_t nb_ops)
960 {
961  struct rte_cryptodev *dev = &rte_cryptodevs[dev_id];
962 
963  nb_ops = (*dev->dequeue_burst)
964  (dev->data->queue_pairs[qp_id], ops, nb_ops);
965 
966  rte_cryptodev_trace_dequeue_burst(dev_id, qp_id, (void **)ops, nb_ops);
967  return nb_ops;
968 }
969 
1001 static inline uint16_t
1002 rte_cryptodev_enqueue_burst(uint8_t dev_id, uint16_t qp_id,
1003  struct rte_crypto_op **ops, uint16_t nb_ops)
1004 {
1005  struct rte_cryptodev *dev = &rte_cryptodevs[dev_id];
1006 
1007  rte_cryptodev_trace_enqueue_burst(dev_id, qp_id, (void **)ops, nb_ops);
1008  return (*dev->enqueue_burst)(
1009  dev->data->queue_pairs[qp_id], ops, nb_ops);
1010 }
1011 
1012 
1018  uint64_t opaque_data;
1020  uint16_t nb_drivers;
1022  uint16_t user_data_sz;
1024  __extension__ struct {
1025  void *data;
1026  uint16_t refcnt;
1027  } sess_data[0];
1029 };
1030 
1033  __extension__ void *sess_private_data[0];
1035 };
1036 
1063 __rte_experimental
1064 struct rte_mempool *
1065 rte_cryptodev_sym_session_pool_create(const char *name, uint32_t nb_elts,
1066  uint32_t elt_size, uint32_t cache_size, uint16_t priv_size,
1067  int socket_id);
1068 
1080 
1090 __rte_experimental
1093 
1106 int
1108 
1121 __rte_experimental
1122 int
1124 
1141 int
1142 rte_cryptodev_sym_session_init(uint8_t dev_id,
1143  struct rte_cryptodev_sym_session *sess,
1144  struct rte_crypto_sym_xform *xforms,
1145  struct rte_mempool *mempool);
1146 
1162 __rte_experimental
1163 int
1164 rte_cryptodev_asym_session_init(uint8_t dev_id,
1165  struct rte_cryptodev_asym_session *sess,
1166  struct rte_crypto_asym_xform *xforms,
1167  struct rte_mempool *mempool);
1168 
1183 int
1184 rte_cryptodev_sym_session_clear(uint8_t dev_id,
1185  struct rte_cryptodev_sym_session *sess);
1186 
1197 __rte_experimental
1198 int
1199 rte_cryptodev_asym_session_clear(uint8_t dev_id,
1200  struct rte_cryptodev_asym_session *sess);
1201 
1209 unsigned int
1211 
1223 __rte_experimental
1224 unsigned int
1226  struct rte_cryptodev_sym_session *sess);
1227 
1234 __rte_experimental
1235 unsigned int
1237 
1249 unsigned int
1251 
1262 __rte_experimental
1263 unsigned int
1265 
1274 int rte_cryptodev_driver_id_get(const char *name);
1275 
1284 const char *rte_cryptodev_driver_name_get(uint8_t driver_id);
1285 
1298 __rte_experimental
1299 int
1301  struct rte_cryptodev_sym_session *sess,
1302  void *data,
1303  uint16_t size);
1304 
1315 __rte_experimental
1316 void *
1318  struct rte_cryptodev_sym_session *sess);
1319 
1332 __rte_experimental
1333 uint32_t
1335  struct rte_cryptodev_sym_session *sess, union rte_crypto_sym_ofs ofs,
1336  struct rte_crypto_sym_vec *vec);
1337 
1347 __rte_experimental
1348 int
1349 rte_cryptodev_get_raw_dp_ctx_size(uint8_t dev_id);
1350 
1356  struct rte_cryptodev_sym_session *crypto_sess;
1357  struct rte_crypto_sym_xform *xform;
1358  struct rte_security_session *sec_sess;
1359 };
1360 
1387  void *qp, uint8_t *drv_ctx, struct rte_crypto_sym_vec *vec,
1388  union rte_crypto_sym_ofs ofs, void *user_data[], int *enqueue_status);
1389 
1412  void *qp, uint8_t *drv_ctx, struct rte_crypto_vec *data_vec,
1413  uint16_t n_data_vecs, union rte_crypto_sym_ofs ofs,
1414  struct rte_crypto_va_iova_ptr *iv,
1415  struct rte_crypto_va_iova_ptr *digest,
1416  struct rte_crypto_va_iova_ptr *aad_or_auth_iv,
1417  void *user_data);
1418 
1430 typedef int (*cryptodev_sym_raw_operation_done_t)(void *qp, uint8_t *drv_ctx,
1431  uint32_t n);
1432 
1442 typedef uint32_t (*rte_cryptodev_raw_get_dequeue_count_t)(void *user_data);
1443 
1452 typedef void (*rte_cryptodev_raw_post_dequeue_t)(void *user_data,
1453  uint32_t index, uint8_t is_op_success);
1454 
1493 typedef uint32_t (*cryptodev_sym_raw_dequeue_burst_t)(void *qp,
1494  uint8_t *drv_ctx,
1495  rte_cryptodev_raw_get_dequeue_count_t get_dequeue_count,
1496  rte_cryptodev_raw_post_dequeue_t post_dequeue,
1497  void **out_user_data, uint8_t is_user_data_array,
1498  uint32_t *n_success, int *dequeue_status);
1499 
1523 typedef void * (*cryptodev_sym_raw_dequeue_t)(
1524  void *qp, uint8_t *drv_ctx, int *dequeue_status,
1525  enum rte_crypto_op_status *op_status);
1526 
1533  void *qp_data;
1534 
1536  cryptodev_sym_raw_enqueue_burst_t enqueue_burst;
1539  cryptodev_sym_raw_dequeue_burst_t dequeue_burst;
1541 
1542  /* Driver specific context data */
1543  __extension__ uint8_t drv_ctx_data[];
1544 };
1545 
1569 __rte_experimental
1570 int
1571 rte_cryptodev_configure_raw_dp_ctx(uint8_t dev_id, uint16_t qp_id,
1572  struct rte_crypto_raw_dp_ctx *ctx,
1573  enum rte_crypto_op_sess_type sess_type,
1574  union rte_cryptodev_session_ctx session_ctx,
1575  uint8_t is_update);
1576 
1601 __rte_experimental
1602 uint32_t
1604  struct rte_crypto_sym_vec *vec, union rte_crypto_sym_ofs ofs,
1605  void **user_data, int *enqueue_status);
1606 
1627 __rte_experimental
1628 static __rte_always_inline int
1630  struct rte_crypto_vec *data_vec, uint16_t n_data_vecs,
1631  union rte_crypto_sym_ofs ofs,
1632  struct rte_crypto_va_iova_ptr *iv,
1633  struct rte_crypto_va_iova_ptr *digest,
1634  struct rte_crypto_va_iova_ptr *aad_or_auth_iv,
1635  void *user_data)
1636 {
1637  return (*ctx->enqueue)(ctx->qp_data, ctx->drv_ctx_data, data_vec,
1638  n_data_vecs, ofs, iv, digest, aad_or_auth_iv, user_data);
1639 }
1640 
1651 __rte_experimental
1652 int
1654  uint32_t n);
1655 
1694 __rte_experimental
1695 uint32_t
1697  rte_cryptodev_raw_get_dequeue_count_t get_dequeue_count,
1698  rte_cryptodev_raw_post_dequeue_t post_dequeue,
1699  void **out_user_data, uint8_t is_user_data_array,
1700  uint32_t *n_success, int *dequeue_status);
1701 
1725 __rte_experimental
1726 static __rte_always_inline void *
1728  int *dequeue_status, enum rte_crypto_op_status *op_status)
1729 {
1730  return (*ctx->dequeue)(ctx->qp_data, ctx->drv_ctx_data, dequeue_status,
1731  op_status);
1732 }
1733 
1743 __rte_experimental
1744 int
1746  uint32_t n);
1747 
1748 #ifdef __cplusplus
1749 }
1750 #endif
1751 
1752 #endif /* _RTE_CRYPTODEV_H_ */
int rte_cryptodev_get_cipher_algo_enum(enum rte_crypto_cipher_algorithm *algo_enum, const char *algo_string)
int rte_cryptodev_get_auth_algo_enum(enum rte_crypto_auth_algorithm *algo_enum, const char *algo_string)
#define __rte_always_inline
Definition: rte_common.h:231
struct rte_mempool * mp_session
void rte_cryptodev_info_get(uint8_t dev_id, struct rte_cryptodev_info *dev_info)
__rte_experimental unsigned int rte_cryptodev_sym_get_existing_header_session_size(struct rte_cryptodev_sym_session *sess)
static __rte_experimental __rte_always_inline int rte_cryptodev_raw_enqueue(struct rte_crypto_raw_dp_ctx *ctx, struct rte_crypto_vec *data_vec, uint16_t n_data_vecs, union rte_crypto_sym_ofs ofs, struct rte_crypto_va_iova_ptr *iv, struct rte_crypto_va_iova_ptr *digest, struct rte_crypto_va_iova_ptr *aad_or_auth_iv, void *user_data)
const char * rte_cryptodev_get_feature_name(uint64_t flag)
__rte_experimental unsigned int rte_cryptodev_asym_get_private_session_size(uint8_t dev_id)
void * security_ctx
int rte_cryptodev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id, const struct rte_cryptodev_qp_conf *qp_conf, int socket_id)
uint8_t rte_cryptodev_devices_get(const char *driver_name, uint8_t *devices, uint8_t nb_devices)
rte_crypto_asym_xform_type
static uint16_t rte_cryptodev_dequeue_burst(uint8_t dev_id, uint16_t qp_id, struct rte_crypto_op **ops, uint16_t nb_ops)
uint64_t feature_flags
int rte_cryptodev_driver_id_get(const char *name)
int rte_cryptodev_sym_session_clear(uint8_t dev_id, struct rte_cryptodev_sym_session *sess)
TAILQ_HEAD(rte_cryptodev_cb_list, rte_cryptodev_callback)
__rte_experimental uint32_t rte_cryptodev_raw_dequeue_burst(struct rte_crypto_raw_dp_ctx *ctx, rte_cryptodev_raw_get_dequeue_count_t get_dequeue_count, rte_cryptodev_raw_post_dequeue_t post_dequeue, void **out_user_data, uint8_t is_user_data_array, uint32_t *n_success, int *dequeue_status)
__extension__ uint8_t attached
__rte_experimental int rte_cryptodev_asym_get_xform_enum(enum rte_crypto_asym_xform_type *xform_enum, const char *xform_string)
int rte_cryptodev_sym_session_init(uint8_t dev_id, struct rte_cryptodev_sym_session *sess, struct rte_crypto_sym_xform *xforms, struct rte_mempool *mempool)
__rte_experimental uint32_t rte_cryptodev_raw_enqueue_burst(struct rte_crypto_raw_dp_ctx *ctx, struct rte_crypto_sym_vec *vec, union rte_crypto_sym_ofs ofs, void **user_data, int *enqueue_status)
struct rte_mempool * session_pool
uint64_t dequeue_err_count
int rte_cryptodev_get_aead_algo_enum(enum rte_crypto_aead_algorithm *algo_enum, const char *algo_string)
uint32_t cache_size
Definition: rte_mempool.h:225
const struct rte_cryptodev_symmetric_capability * rte_cryptodev_sym_capability_get(uint8_t dev_id, const struct rte_cryptodev_sym_capability_idx *idx)
dequeue_pkt_burst_t dequeue_burst
int rte_cryptodev_configure(uint8_t dev_id, struct rte_cryptodev_config *config)
int rte_cryptodev_callback_unregister(uint8_t dev_id, enum rte_cryptodev_event_type event, rte_cryptodev_cb_fn cb_fn, void *cb_arg)
const struct rte_cryptodev_capabilities * capabilities
uint32_t(* rte_cryptodev_raw_get_dequeue_count_t)(void *user_data)
rte_crypto_asym_op_type
void rte_cryptodev_stop(uint8_t dev_id)
const char * driver_name
int rte_cryptodev_close(uint8_t dev_id)
uint8_t driver_id
int(* cryptodev_sym_raw_operation_done_t)(void *qp, uint8_t *drv_ctx, uint32_t n)
void(* rte_cryptodev_cb_fn)(uint8_t dev_id, enum rte_cryptodev_event_type event, void *cb_arg)
__rte_experimental int rte_cryptodev_sym_session_set_user_data(struct rte_cryptodev_sym_session *sess, void *data, uint16_t size)
int rte_cryptodev_sym_capability_check_aead(const struct rte_cryptodev_symmetric_capability *capability, uint16_t key_size, uint16_t digest_size, uint16_t aad_size, uint16_t iv_size)
unsigned int rte_cryptodev_sym_get_header_session_size(void)
const char * rte_cryptodev_driver_name_get(uint8_t driver_id)
int rte_cryptodev_callback_register(uint8_t dev_id, enum rte_cryptodev_event_type event, rte_cryptodev_cb_fn cb_fn, void *cb_arg)
uint16_t min_mbuf_tailroom_req
__rte_experimental int rte_cryptodev_raw_dequeue_done(struct rte_crypto_raw_dp_ctx *ctx, uint32_t n)
__rte_experimental int rte_cryptodev_get_raw_dp_ctx_size(uint8_t dev_id)
struct rte_cryptodev_sym_session * rte_cryptodev_sym_session_create(struct rte_mempool *mempool)
int rte_cryptodev_sym_session_free(struct rte_cryptodev_sym_session *sess)
const char * rte_cryptodev_name_get(uint8_t dev_id)
__rte_experimental void * rte_cryptodev_sym_session_get_user_data(struct rte_cryptodev_sym_session *sess)
rte_crypto_op_type
Definition: rte_crypto.h:29
__rte_experimental const struct rte_cryptodev_asymmetric_xform_capability * rte_cryptodev_asym_capability_get(uint8_t dev_id, const struct rte_cryptodev_asym_capability_idx *idx)
#define RTE_CRYPTODEV_NAME_MAX_LEN
__rte_experimental int rte_cryptodev_asym_session_clear(uint8_t dev_id, struct rte_cryptodev_asym_session *sess)
__rte_experimental int rte_cryptodev_asym_session_free(struct rte_cryptodev_asym_session *sess)
enqueue_pkt_burst_t enqueue_burst
static uint16_t rte_cryptodev_enqueue_burst(uint8_t dev_id, uint16_t qp_id, struct rte_crypto_op **ops, uint16_t nb_ops)
int rte_cryptodev_sym_capability_check_cipher(const struct rte_cryptodev_symmetric_capability *capability, uint16_t key_size, uint16_t iv_size)
__rte_experimental int rte_cryptodev_asym_session_init(uint8_t dev_id, struct rte_cryptodev_asym_session *sess, struct rte_crypto_asym_xform *xforms, struct rte_mempool *mempool)
int rte_cryptodev_stats_get(uint8_t dev_id, struct rte_cryptodev_stats *stats)
__rte_experimental int rte_cryptodev_raw_enqueue_done(struct rte_crypto_raw_dp_ctx *ctx, uint32_t n)
struct rte_cryptodev_data * data
struct rte_device * device
__rte_experimental struct rte_cryptodev_asym_session * rte_cryptodev_asym_session_create(struct rte_mempool *mempool)
uint32_t elt_size
Definition: rte_mempool.h:228
uint8_t rte_cryptodev_count(void)
__extension__ uint8_t dev_started
void *(* cryptodev_sym_raw_dequeue_t)(void *qp, uint8_t *drv_ctx, int *dequeue_status, enum rte_crypto_op_status *op_status)
int rte_cryptodev_sym_capability_check_auth(const struct rte_cryptodev_symmetric_capability *capability, uint16_t key_size, uint16_t digest_size, uint16_t iv_size)
struct rte_cryptodev_ops * dev_ops
uint16_t min_mbuf_headroom_req
__rte_experimental unsigned int rte_cryptodev_asym_get_header_session_size(void)
unsigned int rte_cryptodev_sym_get_private_session_size(uint8_t dev_id)
#define __rte_cache_aligned
Definition: rte_common.h:405
__rte_experimental struct rte_mempool * rte_cryptodev_sym_session_pool_create(const char *name, uint32_t nb_elts, uint32_t elt_size, uint32_t cache_size, uint16_t priv_size, int socket_id)
uint32_t(* cryptodev_sym_raw_enqueue_burst_t)(void *qp, uint8_t *drv_ctx, struct rte_crypto_sym_vec *vec, union rte_crypto_sym_ofs ofs, void *user_data[], int *enqueue_status)
#define RTE_STD_C11
Definition: rte_common.h:40
rte_crypto_auth_algorithm
__rte_experimental int rte_cryptodev_asym_xform_capability_check_modlen(const struct rte_cryptodev_asymmetric_xform_capability *capability, uint16_t modlen)
rte_crypto_sym_xform_type
__rte_experimental uint32_t rte_cryptodev_sym_cpu_crypto_process(uint8_t dev_id, struct rte_cryptodev_sym_session *sess, union rte_crypto_sym_ofs ofs, struct rte_crypto_sym_vec *vec)
struct rte_mempool * mp_session_private
int rte_cryptodev_start(uint8_t dev_id)
__rte_experimental int rte_cryptodev_configure_raw_dp_ctx(uint8_t dev_id, uint16_t qp_id, struct rte_crypto_raw_dp_ctx *ctx, enum rte_crypto_op_sess_type sess_type, union rte_cryptodev_session_ctx session_ctx, uint8_t is_update)
uint16_t(* enqueue_pkt_burst_t)(void *qp, struct rte_crypto_op **ops, uint16_t nb_ops)
uint64_t enqueue_err_count
uint16_t(* dequeue_pkt_burst_t)(void *qp, struct rte_crypto_op **ops, uint16_t nb_ops)
rte_crypto_op_sess_type
Definition: rte_crypto.h:62
struct rte_crypto_param_range modlen
uint16_t rte_cryptodev_queue_pair_count(uint8_t dev_id)
__rte_experimental int rte_cryptodev_asym_xform_capability_check_optype(const struct rte_cryptodev_asymmetric_xform_capability *capability, enum rte_crypto_asym_op_type op_type)
int(* cryptodev_sym_raw_enqueue_t)(void *qp, uint8_t *drv_ctx, struct rte_crypto_vec *data_vec, uint16_t n_data_vecs, union rte_crypto_sym_ofs ofs, struct rte_crypto_va_iova_ptr *iv, struct rte_crypto_va_iova_ptr *digest, struct rte_crypto_va_iova_ptr *aad_or_auth_iv, void *user_data)
__rte_experimental int rte_cryptodev_get_qp_status(uint8_t dev_id, uint16_t queue_pair_id)
struct rte_device * device
unsigned max_nb_sessions
rte_cryptodev_event_type
uint32_t(* cryptodev_sym_raw_dequeue_burst_t)(void *qp, uint8_t *drv_ctx, rte_cryptodev_raw_get_dequeue_count_t get_dequeue_count, rte_cryptodev_raw_post_dequeue_t post_dequeue, void **out_user_data, uint8_t is_user_data_array, uint32_t *n_success, int *dequeue_status)
static __rte_experimental __rte_always_inline void * rte_cryptodev_raw_dequeue(struct rte_crypto_raw_dp_ctx *ctx, int *dequeue_status, enum rte_crypto_op_status *op_status)
void rte_cryptodev_stats_reset(uint8_t dev_id)
int rte_cryptodev_get_dev_id(const char *name)
void * rte_cryptodev_get_sec_ctx(uint8_t dev_id)
unsigned max_nb_queue_pairs
uint8_t rte_cryptodev_device_count_by_driver(uint8_t driver_id)
char name[RTE_MEMZONE_NAMESIZE]
Definition: rte_mempool.h:214
void(* rte_cryptodev_raw_post_dequeue_t)(void *user_data, uint32_t index, uint8_t is_op_success)
struct rte_cryptodev * rte_cryptodevs
rte_crypto_op_status
Definition: rte_crypto.h:39
rte_crypto_aead_algorithm
rte_crypto_cipher_algorithm