DPDK  20.11.3
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 
478  const char *driver_name;
479  uint8_t driver_id;
480  struct rte_device *device;
482  uint64_t feature_flags;
497  struct {
498  unsigned max_nb_sessions;
503  } sym;
504 };
505 
506 #define RTE_CRYPTODEV_DETACHED (0)
507 #define RTE_CRYPTODEV_ATTACHED (1)
508 
514 };
515 
518  uint32_t nb_descriptors;
523 };
524 
534 typedef void (*rte_cryptodev_cb_fn)(uint8_t dev_id,
535  enum rte_cryptodev_event_type event, void *cb_arg);
536 
537 
540  uint64_t enqueued_count;
542  uint64_t dequeued_count;
549 };
550 
551 #define RTE_CRYPTODEV_NAME_MAX_LEN (64)
552 
563 extern int
564 rte_cryptodev_get_dev_id(const char *name);
565 
576 extern const char *
577 rte_cryptodev_name_get(uint8_t dev_id);
578 
586 extern uint8_t
587 rte_cryptodev_count(void);
588 
597 extern uint8_t
598 rte_cryptodev_device_count_by_driver(uint8_t driver_id);
599 
611 uint8_t
612 rte_cryptodev_devices_get(const char *driver_name, uint8_t *devices,
613  uint8_t nb_devices);
614 /*
615  * Return the NUMA socket to which a device is connected
616  *
617  * @param dev_id
618  * The identifier of the device
619  * @return
620  * The NUMA socket id to which the device is connected or
621  * a default of zero if the socket could not be determined.
622  * -1 if returned is the dev_id value is out of range.
623  */
624 extern int
625 rte_cryptodev_socket_id(uint8_t dev_id);
626 
629  int socket_id;
630  uint16_t nb_queue_pairs;
632  uint64_t ff_disable;
639 };
640 
655 extern int
656 rte_cryptodev_configure(uint8_t dev_id, struct rte_cryptodev_config *config);
657 
673 extern int
674 rte_cryptodev_start(uint8_t dev_id);
675 
682 extern void
683 rte_cryptodev_stop(uint8_t dev_id);
684 
694 extern int
695 rte_cryptodev_close(uint8_t dev_id);
696 
718 extern int
719 rte_cryptodev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id,
720  const struct rte_cryptodev_qp_conf *qp_conf, int socket_id);
721 
735 __rte_experimental
736 int
737 rte_cryptodev_get_qp_status(uint8_t dev_id, uint16_t queue_pair_id);
738 
746 extern uint16_t
747 rte_cryptodev_queue_pair_count(uint8_t dev_id);
748 
749 
761 extern int
762 rte_cryptodev_stats_get(uint8_t dev_id, struct rte_cryptodev_stats *stats);
763 
769 extern void
770 rte_cryptodev_stats_reset(uint8_t dev_id);
771 
785 extern void
786 rte_cryptodev_info_get(uint8_t dev_id, struct rte_cryptodev_info *dev_info);
787 
788 
802 extern int
803 rte_cryptodev_callback_register(uint8_t dev_id,
804  enum rte_cryptodev_event_type event,
805  rte_cryptodev_cb_fn cb_fn, void *cb_arg);
806 
820 extern int
821 rte_cryptodev_callback_unregister(uint8_t dev_id,
822  enum rte_cryptodev_event_type event,
823  rte_cryptodev_cb_fn cb_fn, void *cb_arg);
824 
825 
826 typedef uint16_t (*dequeue_pkt_burst_t)(void *qp,
827  struct rte_crypto_op **ops, uint16_t nb_ops);
830 typedef uint16_t (*enqueue_pkt_burst_t)(void *qp,
831  struct rte_crypto_op **ops, uint16_t nb_ops);
837 struct rte_cryptodev_callback;
838 
840 TAILQ_HEAD(rte_cryptodev_cb_list, rte_cryptodev_callback);
841 
853  uint64_t feature_flags;
858  uint8_t driver_id;
861  struct rte_cryptodev_cb_list link_intr_cbs;
867  __extension__
868  uint8_t attached : 1;
871 
872 void *
873 rte_cryptodev_get_sec_ctx(uint8_t dev_id);
874 
883  uint8_t dev_id;
885  uint8_t socket_id;
890  __extension__
891  uint8_t dev_started : 1;
896  void **queue_pairs;
898  uint16_t nb_queue_pairs;
901  void *dev_private;
904 
905 extern struct rte_cryptodev *rte_cryptodevs;
942 static inline uint16_t
943 rte_cryptodev_dequeue_burst(uint8_t dev_id, uint16_t qp_id,
944  struct rte_crypto_op **ops, uint16_t nb_ops)
945 {
946  struct rte_cryptodev *dev = &rte_cryptodevs[dev_id];
947 
948  nb_ops = (*dev->dequeue_burst)
949  (dev->data->queue_pairs[qp_id], ops, nb_ops);
950 
951  rte_cryptodev_trace_dequeue_burst(dev_id, qp_id, (void **)ops, nb_ops);
952  return nb_ops;
953 }
954 
986 static inline uint16_t
987 rte_cryptodev_enqueue_burst(uint8_t dev_id, uint16_t qp_id,
988  struct rte_crypto_op **ops, uint16_t nb_ops)
989 {
990  struct rte_cryptodev *dev = &rte_cryptodevs[dev_id];
991 
992  rte_cryptodev_trace_enqueue_burst(dev_id, qp_id, (void **)ops, nb_ops);
993  return (*dev->enqueue_burst)(
994  dev->data->queue_pairs[qp_id], ops, nb_ops);
995 }
996 
997 
1003  uint64_t opaque_data;
1005  uint16_t nb_drivers;
1007  uint16_t user_data_sz;
1009  __extension__ struct {
1010  void *data;
1011  uint16_t refcnt;
1012  } sess_data[0];
1014 };
1015 
1018  __extension__ void *sess_private_data[0];
1020 };
1021 
1048 __rte_experimental
1049 struct rte_mempool *
1050 rte_cryptodev_sym_session_pool_create(const char *name, uint32_t nb_elts,
1051  uint32_t elt_size, uint32_t cache_size, uint16_t priv_size,
1052  int socket_id);
1053 
1065 
1075 __rte_experimental
1078 
1091 int
1093 
1106 __rte_experimental
1107 int
1109 
1126 int
1127 rte_cryptodev_sym_session_init(uint8_t dev_id,
1128  struct rte_cryptodev_sym_session *sess,
1129  struct rte_crypto_sym_xform *xforms,
1130  struct rte_mempool *mempool);
1131 
1147 __rte_experimental
1148 int
1149 rte_cryptodev_asym_session_init(uint8_t dev_id,
1150  struct rte_cryptodev_asym_session *sess,
1151  struct rte_crypto_asym_xform *xforms,
1152  struct rte_mempool *mempool);
1153 
1168 int
1169 rte_cryptodev_sym_session_clear(uint8_t dev_id,
1170  struct rte_cryptodev_sym_session *sess);
1171 
1182 __rte_experimental
1183 int
1184 rte_cryptodev_asym_session_clear(uint8_t dev_id,
1185  struct rte_cryptodev_asym_session *sess);
1186 
1194 unsigned int
1196 
1208 __rte_experimental
1209 unsigned int
1211  struct rte_cryptodev_sym_session *sess);
1212 
1219 __rte_experimental
1220 unsigned int
1222 
1234 unsigned int
1236 
1247 __rte_experimental
1248 unsigned int
1250 
1259 int rte_cryptodev_driver_id_get(const char *name);
1260 
1269 const char *rte_cryptodev_driver_name_get(uint8_t driver_id);
1270 
1283 __rte_experimental
1284 int
1286  struct rte_cryptodev_sym_session *sess,
1287  void *data,
1288  uint16_t size);
1289 
1300 __rte_experimental
1301 void *
1303  struct rte_cryptodev_sym_session *sess);
1304 
1317 __rte_experimental
1318 uint32_t
1320  struct rte_cryptodev_sym_session *sess, union rte_crypto_sym_ofs ofs,
1321  struct rte_crypto_sym_vec *vec);
1322 
1332 __rte_experimental
1333 int
1334 rte_cryptodev_get_raw_dp_ctx_size(uint8_t dev_id);
1335 
1341  struct rte_cryptodev_sym_session *crypto_sess;
1342  struct rte_crypto_sym_xform *xform;
1343  struct rte_security_session *sec_sess;
1344 };
1345 
1372  void *qp, uint8_t *drv_ctx, struct rte_crypto_sym_vec *vec,
1373  union rte_crypto_sym_ofs ofs, void *user_data[], int *enqueue_status);
1374 
1397  void *qp, uint8_t *drv_ctx, struct rte_crypto_vec *data_vec,
1398  uint16_t n_data_vecs, union rte_crypto_sym_ofs ofs,
1399  struct rte_crypto_va_iova_ptr *iv,
1400  struct rte_crypto_va_iova_ptr *digest,
1401  struct rte_crypto_va_iova_ptr *aad_or_auth_iv,
1402  void *user_data);
1403 
1415 typedef int (*cryptodev_sym_raw_operation_done_t)(void *qp, uint8_t *drv_ctx,
1416  uint32_t n);
1417 
1427 typedef uint32_t (*rte_cryptodev_raw_get_dequeue_count_t)(void *user_data);
1428 
1437 typedef void (*rte_cryptodev_raw_post_dequeue_t)(void *user_data,
1438  uint32_t index, uint8_t is_op_success);
1439 
1478 typedef uint32_t (*cryptodev_sym_raw_dequeue_burst_t)(void *qp,
1479  uint8_t *drv_ctx,
1480  rte_cryptodev_raw_get_dequeue_count_t get_dequeue_count,
1481  rte_cryptodev_raw_post_dequeue_t post_dequeue,
1482  void **out_user_data, uint8_t is_user_data_array,
1483  uint32_t *n_success, int *dequeue_status);
1484 
1508 typedef void * (*cryptodev_sym_raw_dequeue_t)(
1509  void *qp, uint8_t *drv_ctx, int *dequeue_status,
1510  enum rte_crypto_op_status *op_status);
1511 
1518  void *qp_data;
1519 
1521  cryptodev_sym_raw_enqueue_burst_t enqueue_burst;
1524  cryptodev_sym_raw_dequeue_burst_t dequeue_burst;
1526 
1527  /* Driver specific context data */
1528  __extension__ uint8_t drv_ctx_data[];
1529 };
1530 
1554 __rte_experimental
1555 int
1556 rte_cryptodev_configure_raw_dp_ctx(uint8_t dev_id, uint16_t qp_id,
1557  struct rte_crypto_raw_dp_ctx *ctx,
1558  enum rte_crypto_op_sess_type sess_type,
1559  union rte_cryptodev_session_ctx session_ctx,
1560  uint8_t is_update);
1561 
1586 __rte_experimental
1587 uint32_t
1589  struct rte_crypto_sym_vec *vec, union rte_crypto_sym_ofs ofs,
1590  void **user_data, int *enqueue_status);
1591 
1612 __rte_experimental
1613 static __rte_always_inline int
1615  struct rte_crypto_vec *data_vec, uint16_t n_data_vecs,
1616  union rte_crypto_sym_ofs ofs,
1617  struct rte_crypto_va_iova_ptr *iv,
1618  struct rte_crypto_va_iova_ptr *digest,
1619  struct rte_crypto_va_iova_ptr *aad_or_auth_iv,
1620  void *user_data)
1621 {
1622  return (*ctx->enqueue)(ctx->qp_data, ctx->drv_ctx_data, data_vec,
1623  n_data_vecs, ofs, iv, digest, aad_or_auth_iv, user_data);
1624 }
1625 
1636 __rte_experimental
1637 int
1639  uint32_t n);
1640 
1679 __rte_experimental
1680 uint32_t
1682  rte_cryptodev_raw_get_dequeue_count_t get_dequeue_count,
1683  rte_cryptodev_raw_post_dequeue_t post_dequeue,
1684  void **out_user_data, uint8_t is_user_data_array,
1685  uint32_t *n_success, int *dequeue_status);
1686 
1710 __rte_experimental
1711 static __rte_always_inline void *
1713  int *dequeue_status, enum rte_crypto_op_status *op_status)
1714 {
1715  return (*ctx->dequeue)(ctx->qp_data, ctx->drv_ctx_data, dequeue_status,
1716  op_status);
1717 }
1718 
1728 __rte_experimental
1729 int
1731  uint32_t n);
1732 
1733 #ifdef __cplusplus
1734 }
1735 #endif
1736 
1737 #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:226
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:224
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:227
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:400
__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)
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:213
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