DPDK  22.11.0
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_compat.h>
22 #include "rte_kvargs.h"
23 #include "rte_crypto.h"
24 #include <rte_common.h>
25 #include <rte_rcu_qsbr.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 
102 #define RTE_CRYPTO_CIPHER_DATA_UNIT_LEN_512_BYTES RTE_BIT32(0)
103 #define RTE_CRYPTO_CIPHER_DATA_UNIT_LEN_4096_BYTES RTE_BIT32(1)
104 #define RTE_CRYPTO_CIPHER_DATA_UNIT_LEN_1_MEGABYTES RTE_BIT32(2)
105 
110  enum rte_crypto_sym_xform_type xform_type;
113  union {
114  struct {
117  uint16_t block_size;
119  struct rte_crypto_param_range key_size;
121  struct rte_crypto_param_range digest_size;
123  struct rte_crypto_param_range aad_size;
125  struct rte_crypto_param_range iv_size;
127  } auth;
129  struct {
132  uint16_t block_size;
134  struct rte_crypto_param_range key_size;
136  struct rte_crypto_param_range iv_size;
138  uint32_t dataunit_set;
144  } cipher;
146  struct {
149  uint16_t block_size;
151  struct rte_crypto_param_range key_size;
153  struct rte_crypto_param_range digest_size;
155  struct rte_crypto_param_range aad_size;
157  struct rte_crypto_param_range iv_size;
159  } aead;
160  };
161 };
162 
168  enum rte_crypto_asym_xform_type xform_type;
171  uint32_t op_types;
180  __extension__
181  union {
182  struct rte_crypto_param_range modlen;
186  };
187 };
188 
195 };
196 
197 
204  union {
209  };
210 };
211 
214  enum rte_crypto_sym_xform_type type;
215  union {
216  enum rte_crypto_cipher_algorithm cipher;
217  enum rte_crypto_auth_algorithm auth;
218  enum rte_crypto_aead_algorithm aead;
219  } algo;
220 };
221 
230 };
231 
243 rte_cryptodev_sym_capability_get(uint8_t dev_id,
244  const struct rte_cryptodev_sym_capability_idx *idx);
245 
256 __rte_experimental
258 rte_cryptodev_asym_capability_get(uint8_t dev_id,
259  const struct rte_cryptodev_asym_capability_idx *idx);
260 
273 int
275  const struct rte_cryptodev_symmetric_capability *capability,
276  uint16_t key_size, uint16_t iv_size);
277 
291 int
293  const struct rte_cryptodev_symmetric_capability *capability,
294  uint16_t key_size, uint16_t digest_size, uint16_t iv_size);
295 
310 int
312  const struct rte_cryptodev_symmetric_capability *capability,
313  uint16_t key_size, uint16_t digest_size, uint16_t aad_size,
314  uint16_t iv_size);
315 
326 __rte_experimental
327 int
329  const struct rte_cryptodev_asymmetric_xform_capability *capability,
330  enum rte_crypto_asym_op_type op_type);
331 
342 __rte_experimental
343 int
345  const struct rte_cryptodev_asymmetric_xform_capability *capability,
346  uint16_t modlen);
347 
359 int
361  const char *algo_string);
362 
374 int
376  const char *algo_string);
377 
389 int
391  const char *algo_string);
392 
404 __rte_experimental
405 int
407  const char *xform_string);
408 
409 
411 #define RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST() \
412  { RTE_CRYPTO_OP_TYPE_UNDEFINED }
413 
414 
423 #define RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO (1ULL << 0)
424 
425 #define RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO (1ULL << 1)
426 
427 #define RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING (1ULL << 2)
428 
429 #define RTE_CRYPTODEV_FF_CPU_SSE (1ULL << 3)
430 
431 #define RTE_CRYPTODEV_FF_CPU_AVX (1ULL << 4)
432 
433 #define RTE_CRYPTODEV_FF_CPU_AVX2 (1ULL << 5)
434 
435 #define RTE_CRYPTODEV_FF_CPU_AESNI (1ULL << 6)
436 
437 #define RTE_CRYPTODEV_FF_HW_ACCELERATED (1ULL << 7)
438 
441 #define RTE_CRYPTODEV_FF_CPU_AVX512 (1ULL << 8)
442 
443 #define RTE_CRYPTODEV_FF_IN_PLACE_SGL (1ULL << 9)
444 
447 #define RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT (1ULL << 10)
448 
451 #define RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT (1ULL << 11)
452 
456 #define RTE_CRYPTODEV_FF_OOP_LB_IN_SGL_OUT (1ULL << 12)
457 
460 #define RTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUT (1ULL << 13)
461 
462 #define RTE_CRYPTODEV_FF_CPU_NEON (1ULL << 14)
463 
464 #define RTE_CRYPTODEV_FF_CPU_ARM_CE (1ULL << 15)
465 
466 #define RTE_CRYPTODEV_FF_SECURITY (1ULL << 16)
467 
468 #define RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_EXP (1ULL << 17)
469 
470 #define RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_QT (1ULL << 18)
471 
472 #define RTE_CRYPTODEV_FF_DIGEST_ENCRYPTED (1ULL << 19)
473 
474 #define RTE_CRYPTODEV_FF_ASYM_SESSIONLESS (1ULL << 20)
475 
476 #define RTE_CRYPTODEV_FF_SYM_CPU_CRYPTO (1ULL << 21)
477 
478 #define RTE_CRYPTODEV_FF_SYM_SESSIONLESS (1ULL << 22)
479 
480 #define RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA (1ULL << 23)
481 
482 #define RTE_CRYPTODEV_FF_SYM_RAW_DP (1ULL << 24)
483 
484 #define RTE_CRYPTODEV_FF_CIPHER_MULTIPLE_DATA_UNITS (1ULL << 25)
485 
486 #define RTE_CRYPTODEV_FF_CIPHER_WRAPPED_KEY (1ULL << 26)
487 
488 #define RTE_CRYPTODEV_FF_SECURITY_INNER_CSUM (1ULL << 27)
489 
500 extern const char *
501 rte_cryptodev_get_feature_name(uint64_t flag);
502 
505  const char *driver_name;
506  uint8_t driver_id;
507  struct rte_device *device;
509  uint64_t feature_flags;
524  struct {
525  unsigned max_nb_sessions;
530  } sym;
531 };
532 
533 #define RTE_CRYPTODEV_DETACHED (0)
534 #define RTE_CRYPTODEV_ATTACHED (1)
535 
541 };
542 
545  uint32_t nb_descriptors;
548 };
549 
571 typedef uint16_t (*rte_cryptodev_callback_fn)(uint16_t dev_id, uint16_t qp_id,
572  struct rte_crypto_op **ops, uint16_t nb_ops, void *user_param);
573 
583 typedef void (*rte_cryptodev_cb_fn)(uint8_t dev_id,
584  enum rte_cryptodev_event_type event, void *cb_arg);
585 
586 
589  uint64_t enqueued_count;
591  uint64_t dequeued_count;
598 };
599 
600 #define RTE_CRYPTODEV_NAME_MAX_LEN (64)
601 
612 extern int
613 rte_cryptodev_get_dev_id(const char *name);
614 
625 extern const char *
626 rte_cryptodev_name_get(uint8_t dev_id);
627 
635 extern uint8_t
636 rte_cryptodev_count(void);
637 
646 extern uint8_t
647 rte_cryptodev_device_count_by_driver(uint8_t driver_id);
648 
660 uint8_t
661 rte_cryptodev_devices_get(const char *driver_name, uint8_t *devices,
662  uint8_t nb_devices);
663 /*
664  * Return the NUMA socket to which a device is connected
665  *
666  * @param dev_id
667  * The identifier of the device
668  * @return
669  * The NUMA socket id to which the device is connected or
670  * a default of zero if the socket could not be determined.
671  * -1 if returned is the dev_id value is out of range.
672  */
673 extern int
674 rte_cryptodev_socket_id(uint8_t dev_id);
675 
678  int socket_id;
679  uint16_t nb_queue_pairs;
681  uint64_t ff_disable;
688 };
689 
704 extern int
705 rte_cryptodev_configure(uint8_t dev_id, struct rte_cryptodev_config *config);
706 
722 extern int
723 rte_cryptodev_start(uint8_t dev_id);
724 
731 extern void
732 rte_cryptodev_stop(uint8_t dev_id);
733 
743 extern int
744 rte_cryptodev_close(uint8_t dev_id);
745 
767 extern int
768 rte_cryptodev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id,
769  const struct rte_cryptodev_qp_conf *qp_conf, int socket_id);
770 
784 __rte_experimental
785 int
786 rte_cryptodev_get_qp_status(uint8_t dev_id, uint16_t queue_pair_id);
787 
795 extern uint16_t
796 rte_cryptodev_queue_pair_count(uint8_t dev_id);
797 
798 
810 extern int
811 rte_cryptodev_stats_get(uint8_t dev_id, struct rte_cryptodev_stats *stats);
812 
818 extern void
819 rte_cryptodev_stats_reset(uint8_t dev_id);
820 
834 extern void
835 rte_cryptodev_info_get(uint8_t dev_id, struct rte_cryptodev_info *dev_info);
836 
837 
851 extern int
852 rte_cryptodev_callback_register(uint8_t dev_id,
853  enum rte_cryptodev_event_type event,
854  rte_cryptodev_cb_fn cb_fn, void *cb_arg);
855 
869 extern int
870 rte_cryptodev_callback_unregister(uint8_t dev_id,
871  enum rte_cryptodev_event_type event,
872  rte_cryptodev_cb_fn cb_fn, void *cb_arg);
873 
874 struct rte_cryptodev_callback;
875 
877 RTE_TAILQ_HEAD(rte_cryptodev_cb_list, rte_cryptodev_callback);
878 
888  void *arg;
890 };
891 
896 struct rte_cryptodev_cb_rcu {
897  struct rte_cryptodev_cb *next;
899  struct rte_rcu_qsbr *qsbr;
901 };
902 
903 void *
904 rte_cryptodev_get_sec_ctx(uint8_t dev_id);
905 
932 __rte_experimental
933 struct rte_mempool *
934 rte_cryptodev_sym_session_pool_create(const char *name, uint32_t nb_elts,
935  uint32_t elt_size, uint32_t cache_size, uint16_t priv_size,
936  int socket_id);
937 
938 
959 __rte_experimental
960 struct rte_mempool *
961 rte_cryptodev_asym_session_pool_create(const char *name, uint32_t nb_elts,
962  uint32_t cache_size, uint16_t user_data_size, int socket_id);
963 
977 void *
978 rte_cryptodev_sym_session_create(uint8_t dev_id,
979  struct rte_crypto_sym_xform *xforms,
980  struct rte_mempool *mp);
998 __rte_experimental
999 int
1000 rte_cryptodev_asym_session_create(uint8_t dev_id,
1001  struct rte_crypto_asym_xform *xforms, struct rte_mempool *mp,
1002  void **session);
1003 
1016 int
1017 rte_cryptodev_sym_session_free(uint8_t dev_id,
1018  void *sess);
1019 
1031 __rte_experimental
1032 int
1033 rte_cryptodev_asym_session_free(uint8_t dev_id, void *sess);
1034 
1041 __rte_experimental
1042 unsigned int
1044 
1056 unsigned int
1058 
1069 __rte_experimental
1070 unsigned int
1072 
1081 unsigned int
1082 rte_cryptodev_is_valid_dev(uint8_t dev_id);
1083 
1092 int rte_cryptodev_driver_id_get(const char *name);
1093 
1102 const char *rte_cryptodev_driver_name_get(uint8_t driver_id);
1103 
1116 __rte_experimental
1117 int
1119  void *data,
1120  uint16_t size);
1121 
1122 #define CRYPTO_SESS_OPAQUE_DATA_OFF 0
1123 
1126 static inline uint64_t
1128 {
1129  return *((uint64_t *)sess + CRYPTO_SESS_OPAQUE_DATA_OFF);
1130 }
1131 
1135 static inline void
1136 rte_cryptodev_sym_session_opaque_data_set(void *sess, uint64_t opaque)
1137 {
1138  uint64_t *data;
1139  data = (((uint64_t *)sess) + CRYPTO_SESS_OPAQUE_DATA_OFF);
1140  *data = opaque;
1141 }
1142 
1153 __rte_experimental
1154 void *
1156 
1170 __rte_experimental
1171 int
1172 rte_cryptodev_asym_session_set_user_data(void *sess, void *data, uint16_t size);
1173 
1184 __rte_experimental
1185 void *
1187 
1200 __rte_experimental
1201 uint32_t
1203  void *sess, union rte_crypto_sym_ofs ofs,
1204  struct rte_crypto_sym_vec *vec);
1205 
1215 __rte_experimental
1216 int
1217 rte_cryptodev_get_raw_dp_ctx_size(uint8_t dev_id);
1218 
1234 __rte_experimental
1235 int
1236 rte_cryptodev_session_event_mdata_set(uint8_t dev_id, void *sess,
1237  enum rte_crypto_op_type op_type,
1238  enum rte_crypto_op_sess_type sess_type,
1239  void *ev_mdata, uint16_t size);
1240 
1245 union rte_cryptodev_session_ctx {void *crypto_sess;
1246  struct rte_crypto_sym_xform *xform;
1247  struct rte_security_session *sec_sess;
1248 };
1249 
1276  void *qp, uint8_t *drv_ctx, struct rte_crypto_sym_vec *vec,
1277  union rte_crypto_sym_ofs ofs, void *user_data[], int *enqueue_status);
1278 
1301  void *qp, uint8_t *drv_ctx, struct rte_crypto_vec *data_vec,
1302  uint16_t n_data_vecs, union rte_crypto_sym_ofs ofs,
1303  struct rte_crypto_va_iova_ptr *iv,
1304  struct rte_crypto_va_iova_ptr *digest,
1305  struct rte_crypto_va_iova_ptr *aad_or_auth_iv,
1306  void *user_data);
1307 
1319 typedef int (*cryptodev_sym_raw_operation_done_t)(void *qp, uint8_t *drv_ctx,
1320  uint32_t n);
1321 
1331 typedef uint32_t (*rte_cryptodev_raw_get_dequeue_count_t)(void *user_data);
1332 
1341 typedef void (*rte_cryptodev_raw_post_dequeue_t)(void *user_data,
1342  uint32_t index, uint8_t is_op_success);
1343 
1385 typedef uint32_t (*cryptodev_sym_raw_dequeue_burst_t)(void *qp,
1386  uint8_t *drv_ctx,
1387  rte_cryptodev_raw_get_dequeue_count_t get_dequeue_count,
1388  uint32_t max_nb_to_dequeue,
1389  rte_cryptodev_raw_post_dequeue_t post_dequeue,
1390  void **out_user_data, uint8_t is_user_data_array,
1391  uint32_t *n_success, int *dequeue_status);
1392 
1416 typedef void * (*cryptodev_sym_raw_dequeue_t)(
1417  void *qp, uint8_t *drv_ctx, int *dequeue_status,
1418  enum rte_crypto_op_status *op_status);
1419 
1426  void *qp_data;
1427 
1429  cryptodev_sym_raw_enqueue_burst_t enqueue_burst;
1432  cryptodev_sym_raw_dequeue_burst_t dequeue_burst;
1434 
1435  /* Driver specific context data */
1436  __extension__ uint8_t drv_ctx_data[];
1437 };
1438 
1462 __rte_experimental
1463 int
1464 rte_cryptodev_configure_raw_dp_ctx(uint8_t dev_id, uint16_t qp_id,
1465  struct rte_crypto_raw_dp_ctx *ctx,
1466  enum rte_crypto_op_sess_type sess_type,
1467  union rte_cryptodev_session_ctx session_ctx,
1468  uint8_t is_update);
1469 
1494 __rte_experimental
1495 uint32_t
1497  struct rte_crypto_sym_vec *vec, union rte_crypto_sym_ofs ofs,
1498  void **user_data, int *enqueue_status);
1499 
1520 __rte_experimental
1521 static __rte_always_inline int
1523  struct rte_crypto_vec *data_vec, uint16_t n_data_vecs,
1524  union rte_crypto_sym_ofs ofs,
1525  struct rte_crypto_va_iova_ptr *iv,
1526  struct rte_crypto_va_iova_ptr *digest,
1527  struct rte_crypto_va_iova_ptr *aad_or_auth_iv,
1528  void *user_data)
1529 {
1530  return (*ctx->enqueue)(ctx->qp_data, ctx->drv_ctx_data, data_vec,
1531  n_data_vecs, ofs, iv, digest, aad_or_auth_iv, user_data);
1532 }
1533 
1544 __rte_experimental
1545 int
1547  uint32_t n);
1548 
1590 __rte_experimental
1591 uint32_t
1593  rte_cryptodev_raw_get_dequeue_count_t get_dequeue_count,
1594  uint32_t max_nb_to_dequeue,
1595  rte_cryptodev_raw_post_dequeue_t post_dequeue,
1596  void **out_user_data, uint8_t is_user_data_array,
1597  uint32_t *n_success, int *dequeue_status);
1598 
1622 __rte_experimental
1623 static __rte_always_inline void *
1625  int *dequeue_status, enum rte_crypto_op_status *op_status)
1626 {
1627  return (*ctx->dequeue)(ctx->qp_data, ctx->drv_ctx_data, dequeue_status,
1628  op_status);
1629 }
1630 
1640 __rte_experimental
1641 int
1643  uint32_t n);
1644 
1681 __rte_experimental
1682 struct rte_cryptodev_cb *
1683 rte_cryptodev_add_enq_callback(uint8_t dev_id,
1684  uint16_t qp_id,
1686  void *cb_arg);
1687 
1710 __rte_experimental
1711 int rte_cryptodev_remove_enq_callback(uint8_t dev_id,
1712  uint16_t qp_id,
1713  struct rte_cryptodev_cb *cb);
1714 
1750 __rte_experimental
1751 struct rte_cryptodev_cb *
1752 rte_cryptodev_add_deq_callback(uint8_t dev_id,
1753  uint16_t qp_id,
1755  void *cb_arg);
1756 
1778 __rte_experimental
1779 int rte_cryptodev_remove_deq_callback(uint8_t dev_id,
1780  uint16_t qp_id,
1781  struct rte_cryptodev_cb *cb);
1782 
1783 #include <rte_cryptodev_core.h>
1820 static inline uint16_t
1821 rte_cryptodev_dequeue_burst(uint8_t dev_id, uint16_t qp_id,
1822  struct rte_crypto_op **ops, uint16_t nb_ops)
1823 {
1824  const struct rte_crypto_fp_ops *fp_ops;
1825  void *qp;
1826 
1827  rte_cryptodev_trace_dequeue_burst(dev_id, qp_id, (void **)ops, nb_ops);
1828 
1829  fp_ops = &rte_crypto_fp_ops[dev_id];
1830  qp = fp_ops->qp.data[qp_id];
1831 
1832  nb_ops = fp_ops->dequeue_burst(qp, ops, nb_ops);
1833 
1834 #ifdef RTE_CRYPTO_CALLBACKS
1835  if (unlikely(fp_ops->qp.deq_cb != NULL)) {
1836  struct rte_cryptodev_cb_rcu *list;
1837  struct rte_cryptodev_cb *cb;
1838 
1839  /* __ATOMIC_RELEASE memory order was used when the
1840  * call back was inserted into the list.
1841  * Since there is a clear dependency between loading
1842  * cb and cb->fn/cb->next, __ATOMIC_ACQUIRE memory order is
1843  * not required.
1844  */
1845  list = &fp_ops->qp.deq_cb[qp_id];
1846  rte_rcu_qsbr_thread_online(list->qsbr, 0);
1847  cb = __atomic_load_n(&list->next, __ATOMIC_RELAXED);
1848 
1849  while (cb != NULL) {
1850  nb_ops = cb->fn(dev_id, qp_id, ops, nb_ops,
1851  cb->arg);
1852  cb = cb->next;
1853  };
1854 
1855  rte_rcu_qsbr_thread_offline(list->qsbr, 0);
1856  }
1857 #endif
1858  return nb_ops;
1859 }
1860 
1892 static inline uint16_t
1893 rte_cryptodev_enqueue_burst(uint8_t dev_id, uint16_t qp_id,
1894  struct rte_crypto_op **ops, uint16_t nb_ops)
1895 {
1896  const struct rte_crypto_fp_ops *fp_ops;
1897  void *qp;
1898 
1899  fp_ops = &rte_crypto_fp_ops[dev_id];
1900  qp = fp_ops->qp.data[qp_id];
1901 #ifdef RTE_CRYPTO_CALLBACKS
1902  if (unlikely(fp_ops->qp.enq_cb != NULL)) {
1903  struct rte_cryptodev_cb_rcu *list;
1904  struct rte_cryptodev_cb *cb;
1905 
1906  /* __ATOMIC_RELEASE memory order was used when the
1907  * call back was inserted into the list.
1908  * Since there is a clear dependency between loading
1909  * cb and cb->fn/cb->next, __ATOMIC_ACQUIRE memory order is
1910  * not required.
1911  */
1912  list = &fp_ops->qp.enq_cb[qp_id];
1913  rte_rcu_qsbr_thread_online(list->qsbr, 0);
1914  cb = __atomic_load_n(&list->next, __ATOMIC_RELAXED);
1915 
1916  while (cb != NULL) {
1917  nb_ops = cb->fn(dev_id, qp_id, ops, nb_ops,
1918  cb->arg);
1919  cb = cb->next;
1920  };
1921 
1922  rte_rcu_qsbr_thread_offline(list->qsbr, 0);
1923  }
1924 #endif
1925 
1926  rte_cryptodev_trace_enqueue_burst(dev_id, qp_id, (void **)ops, nb_ops);
1927  return fp_ops->enqueue_burst(qp, ops, nb_ops);
1928 }
1929 
1930 
1931 
1932 #ifdef __cplusplus
1933 }
1934 #endif
1935 
1936 #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)
__rte_experimental int rte_cryptodev_asym_session_free(uint8_t dev_id, void *sess)
#define __rte_always_inline
Definition: rte_common.h:255
struct rte_cryptodev_cb * next
struct rte_mempool * mp_session
void rte_cryptodev_info_get(uint8_t dev_id, struct rte_cryptodev_info *dev_info)
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)
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)
__rte_experimental struct rte_mempool * rte_cryptodev_asym_session_pool_create(const char *name, uint32_t nb_elts, uint32_t cache_size, uint16_t user_data_size, 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)
__rte_experimental void * rte_cryptodev_sym_session_get_user_data(void *sess)
int rte_cryptodev_driver_id_get(const char *name)
__rte_experimental int rte_cryptodev_asym_session_set_user_data(void *sess, void *data, uint16_t size)
__rte_experimental int rte_cryptodev_asym_get_xform_enum(enum rte_crypto_asym_xform_type *xform_enum, const char *xform_string)
__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)
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:231
static __rte_always_inline void rte_rcu_qsbr_thread_offline(struct rte_rcu_qsbr *v, unsigned int thread_id)
Definition: rte_rcu_qsbr.h:354
char name[RTE_MEMPOOL_NAMESIZE]
Definition: rte_mempool.h:220
const struct rte_cryptodev_symmetric_capability * rte_cryptodev_sym_capability_get(uint8_t dev_id, const struct rte_cryptodev_sym_capability_idx *idx)
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
int rte_cryptodev_sym_session_free(uint8_t dev_id, void *sess)
uint32_t(* rte_cryptodev_raw_get_dequeue_count_t)(void *user_data)
rte_crypto_asym_op_type
__rte_experimental struct rte_cryptodev_cb * rte_cryptodev_add_enq_callback(uint8_t dev_id, uint16_t qp_id, rte_cryptodev_callback_fn cb_fn, void *cb_arg)
uint32_t size
Definition: rte_mempool.h:230
void rte_cryptodev_stop(uint8_t dev_id)
const char * driver_name
int rte_cryptodev_close(uint8_t dev_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)
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)
#define unlikely(x)
__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, uint32_t max_nb_to_dequeue, 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)
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)
__rte_experimental int rte_cryptodev_session_event_mdata_set(uint8_t dev_id, void *sess, enum rte_crypto_op_type op_type, enum rte_crypto_op_sess_type sess_type, void *ev_mdata, uint16_t size)
__rte_experimental int rte_cryptodev_asym_session_create(uint8_t dev_id, struct rte_crypto_asym_xform *xforms, struct rte_mempool *mp, void **session)
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)
const char * rte_cryptodev_name_get(uint8_t dev_id)
__rte_experimental uint32_t rte_cryptodev_sym_cpu_crypto_process(uint8_t dev_id, void *sess, union rte_crypto_sym_ofs ofs, struct rte_crypto_sym_vec *vec)
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)
__rte_experimental int rte_cryptodev_sym_session_set_user_data(void *sess, void *data, uint16_t size)
rte_cryptodev_callback_fn fn
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)
uint16_t(* rte_cryptodev_callback_fn)(uint16_t dev_id, uint16_t qp_id, struct rte_crypto_op **ops, uint16_t nb_ops, void *user_param)
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_device * device
uint32_t elt_size
Definition: rte_mempool.h:234
__rte_experimental int rte_cryptodev_remove_enq_callback(uint8_t dev_id, uint16_t qp_id, struct rte_cryptodev_cb *cb)
uint8_t rte_cryptodev_count(void)
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)
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)
__rte_experimental void * rte_cryptodev_asym_session_get_user_data(void *sess)
__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)
static __rte_always_inline void rte_rcu_qsbr_thread_online(struct rte_rcu_qsbr *v, unsigned int thread_id)
Definition: rte_rcu_qsbr.h:301
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:39
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_TAILQ_HEAD(rte_cryptodev_cb_list, rte_cryptodev_callback)
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)
uint64_t enqueue_err_count
uint32_t(* cryptodev_sym_raw_dequeue_burst_t)(void *qp, uint8_t *drv_ctx, rte_cryptodev_raw_get_dequeue_count_t get_dequeue_count, uint32_t max_nb_to_dequeue, 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)
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)
unsigned max_nb_sessions
rte_cryptodev_event_type
static uint64_t rte_cryptodev_sym_session_opaque_data_get(void *sess)
__rte_experimental int rte_cryptodev_remove_deq_callback(uint8_t dev_id, uint16_t qp_id, struct rte_cryptodev_cb *cb)
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_sym_session_create(uint8_t dev_id, struct rte_crypto_sym_xform *xforms, struct rte_mempool *mp)
unsigned max_nb_queue_pairs
uint8_t rte_cryptodev_device_count_by_driver(uint8_t driver_id)
static void rte_cryptodev_sym_session_opaque_data_set(void *sess, uint64_t opaque)
__rte_experimental struct rte_cryptodev_cb * rte_cryptodev_add_deq_callback(uint8_t dev_id, uint16_t qp_id, rte_cryptodev_callback_fn cb_fn, void *cb_arg)
unsigned int rte_cryptodev_is_valid_dev(uint8_t dev_id)
void(* rte_cryptodev_raw_post_dequeue_t)(void *user_data, uint32_t index, uint8_t is_op_success)
rte_crypto_op_status
Definition: rte_crypto.h:39
rte_crypto_aead_algorithm
rte_crypto_cipher_algorithm