DPDK  23.03.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 
418 __rte_experimental
419 const char *
421 
431 __rte_experimental
432 const char *
434 
444 __rte_experimental
445 const char *
447 
457 __rte_experimental
458 const char *
460 
461 
463 #define RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST() \
464  { RTE_CRYPTO_OP_TYPE_UNDEFINED }
465 
466 
475 #define RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO (1ULL << 0)
476 
477 #define RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO (1ULL << 1)
478 
479 #define RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING (1ULL << 2)
480 
481 #define RTE_CRYPTODEV_FF_CPU_SSE (1ULL << 3)
482 
483 #define RTE_CRYPTODEV_FF_CPU_AVX (1ULL << 4)
484 
485 #define RTE_CRYPTODEV_FF_CPU_AVX2 (1ULL << 5)
486 
487 #define RTE_CRYPTODEV_FF_CPU_AESNI (1ULL << 6)
488 
489 #define RTE_CRYPTODEV_FF_HW_ACCELERATED (1ULL << 7)
490 
493 #define RTE_CRYPTODEV_FF_CPU_AVX512 (1ULL << 8)
494 
495 #define RTE_CRYPTODEV_FF_IN_PLACE_SGL (1ULL << 9)
496 
499 #define RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT (1ULL << 10)
500 
503 #define RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT (1ULL << 11)
504 
508 #define RTE_CRYPTODEV_FF_OOP_LB_IN_SGL_OUT (1ULL << 12)
509 
512 #define RTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUT (1ULL << 13)
513 
514 #define RTE_CRYPTODEV_FF_CPU_NEON (1ULL << 14)
515 
516 #define RTE_CRYPTODEV_FF_CPU_ARM_CE (1ULL << 15)
517 
518 #define RTE_CRYPTODEV_FF_SECURITY (1ULL << 16)
519 
520 #define RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_EXP (1ULL << 17)
521 
522 #define RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_QT (1ULL << 18)
523 
524 #define RTE_CRYPTODEV_FF_DIGEST_ENCRYPTED (1ULL << 19)
525 
526 #define RTE_CRYPTODEV_FF_ASYM_SESSIONLESS (1ULL << 20)
527 
528 #define RTE_CRYPTODEV_FF_SYM_CPU_CRYPTO (1ULL << 21)
529 
530 #define RTE_CRYPTODEV_FF_SYM_SESSIONLESS (1ULL << 22)
531 
532 #define RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA (1ULL << 23)
533 
534 #define RTE_CRYPTODEV_FF_SYM_RAW_DP (1ULL << 24)
535 
536 #define RTE_CRYPTODEV_FF_CIPHER_MULTIPLE_DATA_UNITS (1ULL << 25)
537 
538 #define RTE_CRYPTODEV_FF_CIPHER_WRAPPED_KEY (1ULL << 26)
539 
540 #define RTE_CRYPTODEV_FF_SECURITY_INNER_CSUM (1ULL << 27)
541 
552 extern const char *
553 rte_cryptodev_get_feature_name(uint64_t flag);
554 
556 /* Structure rte_cryptodev_info 8< */
558  const char *driver_name;
559  uint8_t driver_id;
560  struct rte_device *device;
562  uint64_t feature_flags;
577  struct {
578  unsigned max_nb_sessions;
583  } sym;
584 };
585 /* >8 End of structure rte_cryptodev_info. */
586 
587 #define RTE_CRYPTODEV_DETACHED (0)
588 #define RTE_CRYPTODEV_ATTACHED (1)
589 
595 };
596 
598 /* Structure rte_cryptodev_qp_conf 8<*/
600  uint32_t nb_descriptors;
603 };
604 /* >8 End of structure rte_cryptodev_qp_conf. */
605 
627 typedef uint16_t (*rte_cryptodev_callback_fn)(uint16_t dev_id, uint16_t qp_id,
628  struct rte_crypto_op **ops, uint16_t nb_ops, void *user_param);
629 
639 typedef void (*rte_cryptodev_cb_fn)(uint8_t dev_id,
640  enum rte_cryptodev_event_type event, void *cb_arg);
641 
642 
645  uint64_t enqueued_count;
647  uint64_t dequeued_count;
654 };
655 
656 #define RTE_CRYPTODEV_NAME_MAX_LEN (64)
657 
668 extern int
669 rte_cryptodev_get_dev_id(const char *name);
670 
681 extern const char *
682 rte_cryptodev_name_get(uint8_t dev_id);
683 
691 extern uint8_t
692 rte_cryptodev_count(void);
693 
702 extern uint8_t
703 rte_cryptodev_device_count_by_driver(uint8_t driver_id);
704 
716 uint8_t
717 rte_cryptodev_devices_get(const char *driver_name, uint8_t *devices,
718  uint8_t nb_devices);
719 /*
720  * Return the NUMA socket to which a device is connected
721  *
722  * @param dev_id
723  * The identifier of the device
724  * @return
725  * The NUMA socket id to which the device is connected or
726  * a default of zero if the socket could not be determined.
727  * -1 if returned is the dev_id value is out of range.
728  */
729 extern int
730 rte_cryptodev_socket_id(uint8_t dev_id);
731 
733 /* Structure rte_cryptodev_config 8< */
735  int socket_id;
736  uint16_t nb_queue_pairs;
738  uint64_t ff_disable;
745 };
746 /* >8 End of structure rte_cryptodev_config. */
747 
762 extern int
763 rte_cryptodev_configure(uint8_t dev_id, struct rte_cryptodev_config *config);
764 
780 extern int
781 rte_cryptodev_start(uint8_t dev_id);
782 
789 extern void
790 rte_cryptodev_stop(uint8_t dev_id);
791 
801 extern int
802 rte_cryptodev_close(uint8_t dev_id);
803 
825 extern int
826 rte_cryptodev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id,
827  const struct rte_cryptodev_qp_conf *qp_conf, int socket_id);
828 
842 __rte_experimental
843 int
844 rte_cryptodev_get_qp_status(uint8_t dev_id, uint16_t queue_pair_id);
845 
853 extern uint16_t
854 rte_cryptodev_queue_pair_count(uint8_t dev_id);
855 
856 
868 extern int
869 rte_cryptodev_stats_get(uint8_t dev_id, struct rte_cryptodev_stats *stats);
870 
876 extern void
877 rte_cryptodev_stats_reset(uint8_t dev_id);
878 
892 extern void
893 rte_cryptodev_info_get(uint8_t dev_id, struct rte_cryptodev_info *dev_info);
894 
895 
909 extern int
910 rte_cryptodev_callback_register(uint8_t dev_id,
911  enum rte_cryptodev_event_type event,
912  rte_cryptodev_cb_fn cb_fn, void *cb_arg);
913 
927 extern int
928 rte_cryptodev_callback_unregister(uint8_t dev_id,
929  enum rte_cryptodev_event_type event,
930  rte_cryptodev_cb_fn cb_fn, void *cb_arg);
931 
947 __rte_experimental
948 int
949 rte_cryptodev_queue_pair_event_error_query(uint8_t dev_id, uint16_t qp_id);
950 
951 struct rte_cryptodev_callback;
952 
954 RTE_TAILQ_HEAD(rte_cryptodev_cb_list, rte_cryptodev_callback);
955 
965  void *arg;
967 };
968 
973 struct rte_cryptodev_cb_rcu {
974  struct rte_cryptodev_cb *next;
976  struct rte_rcu_qsbr *qsbr;
978 };
979 
980 void *
981 rte_cryptodev_get_sec_ctx(uint8_t dev_id);
982 
1012 __rte_experimental
1013 struct rte_mempool *
1014 rte_cryptodev_sym_session_pool_create(const char *name, uint32_t nb_elts,
1015  uint32_t elt_size, uint32_t cache_size, uint16_t priv_size,
1016  int socket_id);
1017 
1018 
1039 __rte_experimental
1040 struct rte_mempool *
1041 rte_cryptodev_asym_session_pool_create(const char *name, uint32_t nb_elts,
1042  uint32_t cache_size, uint16_t user_data_size, int socket_id);
1043 
1057 void *
1058 rte_cryptodev_sym_session_create(uint8_t dev_id,
1059  struct rte_crypto_sym_xform *xforms,
1060  struct rte_mempool *mp);
1078 __rte_experimental
1079 int
1080 rte_cryptodev_asym_session_create(uint8_t dev_id,
1081  struct rte_crypto_asym_xform *xforms, struct rte_mempool *mp,
1082  void **session);
1083 
1096 int
1097 rte_cryptodev_sym_session_free(uint8_t dev_id,
1098  void *sess);
1099 
1111 __rte_experimental
1112 int
1113 rte_cryptodev_asym_session_free(uint8_t dev_id, void *sess);
1114 
1121 __rte_experimental
1122 unsigned int
1124 
1136 unsigned int
1138 
1149 __rte_experimental
1150 unsigned int
1152 
1161 unsigned int
1162 rte_cryptodev_is_valid_dev(uint8_t dev_id);
1163 
1172 int rte_cryptodev_driver_id_get(const char *name);
1173 
1182 const char *rte_cryptodev_driver_name_get(uint8_t driver_id);
1183 
1196 __rte_experimental
1197 int
1199  void *data,
1200  uint16_t size);
1201 
1202 #define CRYPTO_SESS_OPAQUE_DATA_OFF 0
1203 
1206 static inline uint64_t
1208 {
1209  return *((uint64_t *)sess + CRYPTO_SESS_OPAQUE_DATA_OFF);
1210 }
1211 
1215 static inline void
1216 rte_cryptodev_sym_session_opaque_data_set(void *sess, uint64_t opaque)
1217 {
1218  uint64_t *data;
1219  data = (((uint64_t *)sess) + CRYPTO_SESS_OPAQUE_DATA_OFF);
1220  *data = opaque;
1221 }
1222 
1233 __rte_experimental
1234 void *
1236 
1250 __rte_experimental
1251 int
1252 rte_cryptodev_asym_session_set_user_data(void *sess, void *data, uint16_t size);
1253 
1264 __rte_experimental
1265 void *
1267 
1280 __rte_experimental
1281 uint32_t
1283  void *sess, union rte_crypto_sym_ofs ofs,
1284  struct rte_crypto_sym_vec *vec);
1285 
1295 __rte_experimental
1296 int
1297 rte_cryptodev_get_raw_dp_ctx_size(uint8_t dev_id);
1298 
1314 __rte_experimental
1315 int
1316 rte_cryptodev_session_event_mdata_set(uint8_t dev_id, void *sess,
1317  enum rte_crypto_op_type op_type,
1318  enum rte_crypto_op_sess_type sess_type,
1319  void *ev_mdata, uint16_t size);
1320 
1325 union rte_cryptodev_session_ctx {void *crypto_sess;
1326  struct rte_crypto_sym_xform *xform;
1327  struct rte_security_session *sec_sess;
1328 };
1329 
1356  void *qp, uint8_t *drv_ctx, struct rte_crypto_sym_vec *vec,
1357  union rte_crypto_sym_ofs ofs, void *user_data[], int *enqueue_status);
1358 
1381  void *qp, uint8_t *drv_ctx, struct rte_crypto_vec *data_vec,
1382  uint16_t n_data_vecs, union rte_crypto_sym_ofs ofs,
1383  struct rte_crypto_va_iova_ptr *iv,
1384  struct rte_crypto_va_iova_ptr *digest,
1385  struct rte_crypto_va_iova_ptr *aad_or_auth_iv,
1386  void *user_data);
1387 
1399 typedef int (*cryptodev_sym_raw_operation_done_t)(void *qp, uint8_t *drv_ctx,
1400  uint32_t n);
1401 
1411 typedef uint32_t (*rte_cryptodev_raw_get_dequeue_count_t)(void *user_data);
1412 
1421 typedef void (*rte_cryptodev_raw_post_dequeue_t)(void *user_data,
1422  uint32_t index, uint8_t is_op_success);
1423 
1465 typedef uint32_t (*cryptodev_sym_raw_dequeue_burst_t)(void *qp,
1466  uint8_t *drv_ctx,
1467  rte_cryptodev_raw_get_dequeue_count_t get_dequeue_count,
1468  uint32_t max_nb_to_dequeue,
1469  rte_cryptodev_raw_post_dequeue_t post_dequeue,
1470  void **out_user_data, uint8_t is_user_data_array,
1471  uint32_t *n_success, int *dequeue_status);
1472 
1496 typedef void * (*cryptodev_sym_raw_dequeue_t)(
1497  void *qp, uint8_t *drv_ctx, int *dequeue_status,
1498  enum rte_crypto_op_status *op_status);
1499 
1506  void *qp_data;
1507 
1509  cryptodev_sym_raw_enqueue_burst_t enqueue_burst;
1512  cryptodev_sym_raw_dequeue_burst_t dequeue_burst;
1514 
1515  /* Driver specific context data */
1516  __extension__ uint8_t drv_ctx_data[];
1517 };
1518 
1542 __rte_experimental
1543 int
1544 rte_cryptodev_configure_raw_dp_ctx(uint8_t dev_id, uint16_t qp_id,
1545  struct rte_crypto_raw_dp_ctx *ctx,
1546  enum rte_crypto_op_sess_type sess_type,
1547  union rte_cryptodev_session_ctx session_ctx,
1548  uint8_t is_update);
1549 
1574 __rte_experimental
1575 uint32_t
1577  struct rte_crypto_sym_vec *vec, union rte_crypto_sym_ofs ofs,
1578  void **user_data, int *enqueue_status);
1579 
1600 __rte_experimental
1601 static __rte_always_inline int
1603  struct rte_crypto_vec *data_vec, uint16_t n_data_vecs,
1604  union rte_crypto_sym_ofs ofs,
1605  struct rte_crypto_va_iova_ptr *iv,
1606  struct rte_crypto_va_iova_ptr *digest,
1607  struct rte_crypto_va_iova_ptr *aad_or_auth_iv,
1608  void *user_data)
1609 {
1610  return (*ctx->enqueue)(ctx->qp_data, ctx->drv_ctx_data, data_vec,
1611  n_data_vecs, ofs, iv, digest, aad_or_auth_iv, user_data);
1612 }
1613 
1624 __rte_experimental
1625 int
1627  uint32_t n);
1628 
1670 __rte_experimental
1671 uint32_t
1673  rte_cryptodev_raw_get_dequeue_count_t get_dequeue_count,
1674  uint32_t max_nb_to_dequeue,
1675  rte_cryptodev_raw_post_dequeue_t post_dequeue,
1676  void **out_user_data, uint8_t is_user_data_array,
1677  uint32_t *n_success, int *dequeue_status);
1678 
1702 __rte_experimental
1703 static __rte_always_inline void *
1705  int *dequeue_status, enum rte_crypto_op_status *op_status)
1706 {
1707  return (*ctx->dequeue)(ctx->qp_data, ctx->drv_ctx_data, dequeue_status,
1708  op_status);
1709 }
1710 
1720 __rte_experimental
1721 int
1723  uint32_t n);
1724 
1761 __rte_experimental
1762 struct rte_cryptodev_cb *
1763 rte_cryptodev_add_enq_callback(uint8_t dev_id,
1764  uint16_t qp_id,
1766  void *cb_arg);
1767 
1790 __rte_experimental
1791 int rte_cryptodev_remove_enq_callback(uint8_t dev_id,
1792  uint16_t qp_id,
1793  struct rte_cryptodev_cb *cb);
1794 
1830 __rte_experimental
1831 struct rte_cryptodev_cb *
1832 rte_cryptodev_add_deq_callback(uint8_t dev_id,
1833  uint16_t qp_id,
1835  void *cb_arg);
1836 
1858 __rte_experimental
1859 int rte_cryptodev_remove_deq_callback(uint8_t dev_id,
1860  uint16_t qp_id,
1861  struct rte_cryptodev_cb *cb);
1862 
1863 #include <rte_cryptodev_core.h>
1900 static inline uint16_t
1901 rte_cryptodev_dequeue_burst(uint8_t dev_id, uint16_t qp_id,
1902  struct rte_crypto_op **ops, uint16_t nb_ops)
1903 {
1904  const struct rte_crypto_fp_ops *fp_ops;
1905  void *qp;
1906 
1907  rte_cryptodev_trace_dequeue_burst(dev_id, qp_id, (void **)ops, nb_ops);
1908 
1909  fp_ops = &rte_crypto_fp_ops[dev_id];
1910  qp = fp_ops->qp.data[qp_id];
1911 
1912  nb_ops = fp_ops->dequeue_burst(qp, ops, nb_ops);
1913 
1914 #ifdef RTE_CRYPTO_CALLBACKS
1915  if (unlikely(fp_ops->qp.deq_cb != NULL)) {
1916  struct rte_cryptodev_cb_rcu *list;
1917  struct rte_cryptodev_cb *cb;
1918 
1919  /* __ATOMIC_RELEASE memory order was used when the
1920  * call back was inserted into the list.
1921  * Since there is a clear dependency between loading
1922  * cb and cb->fn/cb->next, __ATOMIC_ACQUIRE memory order is
1923  * not required.
1924  */
1925  list = &fp_ops->qp.deq_cb[qp_id];
1926  rte_rcu_qsbr_thread_online(list->qsbr, 0);
1927  cb = __atomic_load_n(&list->next, __ATOMIC_RELAXED);
1928 
1929  while (cb != NULL) {
1930  nb_ops = cb->fn(dev_id, qp_id, ops, nb_ops,
1931  cb->arg);
1932  cb = cb->next;
1933  };
1934 
1935  rte_rcu_qsbr_thread_offline(list->qsbr, 0);
1936  }
1937 #endif
1938  return nb_ops;
1939 }
1940 
1972 static inline uint16_t
1973 rte_cryptodev_enqueue_burst(uint8_t dev_id, uint16_t qp_id,
1974  struct rte_crypto_op **ops, uint16_t nb_ops)
1975 {
1976  const struct rte_crypto_fp_ops *fp_ops;
1977  void *qp;
1978 
1979  fp_ops = &rte_crypto_fp_ops[dev_id];
1980  qp = fp_ops->qp.data[qp_id];
1981 #ifdef RTE_CRYPTO_CALLBACKS
1982  if (unlikely(fp_ops->qp.enq_cb != NULL)) {
1983  struct rte_cryptodev_cb_rcu *list;
1984  struct rte_cryptodev_cb *cb;
1985 
1986  /* __ATOMIC_RELEASE memory order was used when the
1987  * call back was inserted into the list.
1988  * Since there is a clear dependency between loading
1989  * cb and cb->fn/cb->next, __ATOMIC_ACQUIRE memory order is
1990  * not required.
1991  */
1992  list = &fp_ops->qp.enq_cb[qp_id];
1993  rte_rcu_qsbr_thread_online(list->qsbr, 0);
1994  cb = __atomic_load_n(&list->next, __ATOMIC_RELAXED);
1995 
1996  while (cb != NULL) {
1997  nb_ops = cb->fn(dev_id, qp_id, ops, nb_ops,
1998  cb->arg);
1999  cb = cb->next;
2000  };
2001 
2002  rte_rcu_qsbr_thread_offline(list->qsbr, 0);
2003  }
2004 #endif
2005 
2006  rte_cryptodev_trace_enqueue_burst(dev_id, qp_id, (void **)ops, nb_ops);
2007  return fp_ops->enqueue_burst(qp, ops, nb_ops);
2008 }
2009 
2010 
2011 
2012 #ifdef __cplusplus
2013 }
2014 #endif
2015 
2016 #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 const char * rte_cryptodev_get_aead_algo_string(enum rte_crypto_aead_algorithm algo_enum)
__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 char * rte_cryptodev_asym_get_xform_string(enum rte_crypto_asym_xform_type xform_enum)
__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_experimental const char * rte_cryptodev_get_cipher_algo_string(enum rte_crypto_cipher_algorithm algo_enum)
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
__rte_experimental int rte_cryptodev_queue_pair_event_error_query(uint8_t dev_id, uint16_t qp_id)
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
__rte_experimental const char * rte_cryptodev_get_auth_algo_string(enum rte_crypto_auth_algorithm algo_enum)
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