DPDK  21.11.6
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 #include <rte_rcu_qsbr.h>
27 
28 #include "rte_cryptodev_trace_fp.h"
29 
30 extern const char **rte_cyptodev_names;
31 
32 /* Logging Macros */
33 
34 #define CDEV_LOG_ERR(...) \
35  RTE_LOG(ERR, CRYPTODEV, \
36  RTE_FMT("%s() line %u: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
37  __func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__,)))
38 
39 #define CDEV_LOG_INFO(...) \
40  RTE_LOG(INFO, CRYPTODEV, \
41  RTE_FMT(RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
42  RTE_FMT_TAIL(__VA_ARGS__,)))
43 
44 #define CDEV_LOG_DEBUG(...) \
45  RTE_LOG(DEBUG, CRYPTODEV, \
46  RTE_FMT("%s() line %u: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
47  __func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__,)))
48 
49 #define CDEV_PMD_TRACE(...) \
50  RTE_LOG(DEBUG, CRYPTODEV, \
51  RTE_FMT("[%s] %s: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
52  dev, __func__, RTE_FMT_TAIL(__VA_ARGS__,)))
53 
67 #define rte_crypto_op_ctod_offset(c, t, o) \
68  ((t)((char *)(c) + (o)))
69 
81 #define rte_crypto_op_ctophys_offset(c, o) \
82  (rte_iova_t)((c)->phys_addr + (o))
83 
88  uint16_t min;
89  uint16_t max;
90  uint16_t increment;
96 };
97 
103 #define RTE_CRYPTO_CIPHER_DATA_UNIT_LEN_512_BYTES RTE_BIT32(0)
104 #define RTE_CRYPTO_CIPHER_DATA_UNIT_LEN_4096_BYTES RTE_BIT32(1)
105 #define RTE_CRYPTO_CIPHER_DATA_UNIT_LEN_1_MEGABYTES RTE_BIT32(2)
106 
114  union {
115  struct {
118  uint16_t block_size;
128  } auth;
130  struct {
133  uint16_t block_size;
139  uint32_t dataunit_set;
145  } cipher;
147  struct {
150  uint16_t block_size;
160  } aead;
161  };
162 };
163 
172  uint32_t op_types;
175  __extension__
176  union {
181  };
182 };
183 
190 };
191 
192 
199  union {
204  };
205 };
206 
209  enum rte_crypto_sym_xform_type type;
210  union {
211  enum rte_crypto_cipher_algorithm cipher;
212  enum rte_crypto_auth_algorithm auth;
213  enum rte_crypto_aead_algorithm aead;
214  } algo;
215 };
216 
225 };
226 
238 rte_cryptodev_sym_capability_get(uint8_t dev_id,
239  const struct rte_cryptodev_sym_capability_idx *idx);
240 
251 __rte_experimental
253 rte_cryptodev_asym_capability_get(uint8_t dev_id,
254  const struct rte_cryptodev_asym_capability_idx *idx);
255 
268 int
270  const struct rte_cryptodev_symmetric_capability *capability,
271  uint16_t key_size, uint16_t iv_size);
272 
286 int
288  const struct rte_cryptodev_symmetric_capability *capability,
289  uint16_t key_size, uint16_t digest_size, uint16_t iv_size);
290 
305 int
307  const struct rte_cryptodev_symmetric_capability *capability,
308  uint16_t key_size, uint16_t digest_size, uint16_t aad_size,
309  uint16_t iv_size);
310 
321 __rte_experimental
322 int
324  const struct rte_cryptodev_asymmetric_xform_capability *capability,
325  enum rte_crypto_asym_op_type op_type);
326 
337 __rte_experimental
338 int
340  const struct rte_cryptodev_asymmetric_xform_capability *capability,
341  uint16_t modlen);
342 
354 int
356  const char *algo_string);
357 
369 int
371  const char *algo_string);
372 
384 int
386  const char *algo_string);
387 
399 __rte_experimental
400 int
402  const char *xform_string);
403 
404 
406 #define RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST() \
407  { RTE_CRYPTO_OP_TYPE_UNDEFINED }
408 
409 
418 #define RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO (1ULL << 0)
419 
420 #define RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO (1ULL << 1)
421 
422 #define RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING (1ULL << 2)
423 
424 #define RTE_CRYPTODEV_FF_CPU_SSE (1ULL << 3)
425 
426 #define RTE_CRYPTODEV_FF_CPU_AVX (1ULL << 4)
427 
428 #define RTE_CRYPTODEV_FF_CPU_AVX2 (1ULL << 5)
429 
430 #define RTE_CRYPTODEV_FF_CPU_AESNI (1ULL << 6)
431 
432 #define RTE_CRYPTODEV_FF_HW_ACCELERATED (1ULL << 7)
433 
436 #define RTE_CRYPTODEV_FF_CPU_AVX512 (1ULL << 8)
437 
438 #define RTE_CRYPTODEV_FF_IN_PLACE_SGL (1ULL << 9)
439 
442 #define RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT (1ULL << 10)
443 
446 #define RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT (1ULL << 11)
447 
451 #define RTE_CRYPTODEV_FF_OOP_LB_IN_SGL_OUT (1ULL << 12)
452 
455 #define RTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUT (1ULL << 13)
456 
457 #define RTE_CRYPTODEV_FF_CPU_NEON (1ULL << 14)
458 
459 #define RTE_CRYPTODEV_FF_CPU_ARM_CE (1ULL << 15)
460 
461 #define RTE_CRYPTODEV_FF_SECURITY (1ULL << 16)
462 
463 #define RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_EXP (1ULL << 17)
464 
465 #define RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_QT (1ULL << 18)
466 
467 #define RTE_CRYPTODEV_FF_DIGEST_ENCRYPTED (1ULL << 19)
468 
469 #define RTE_CRYPTODEV_FF_ASYM_SESSIONLESS (1ULL << 20)
470 
471 #define RTE_CRYPTODEV_FF_SYM_CPU_CRYPTO (1ULL << 21)
472 
473 #define RTE_CRYPTODEV_FF_SYM_SESSIONLESS (1ULL << 22)
474 
475 #define RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA (1ULL << 23)
476 
477 #define RTE_CRYPTODEV_FF_SYM_RAW_DP (1ULL << 24)
478 
479 #define RTE_CRYPTODEV_FF_CIPHER_MULTIPLE_DATA_UNITS (1ULL << 25)
480 
481 #define RTE_CRYPTODEV_FF_CIPHER_WRAPPED_KEY (1ULL << 26)
482 
483 #define RTE_CRYPTODEV_FF_SECURITY_INNER_CSUM (1ULL << 27)
484 
495 extern const char *
496 rte_cryptodev_get_feature_name(uint64_t flag);
497 
500  const char *driver_name;
501  uint8_t driver_id;
502  struct rte_device *device;
504  uint64_t feature_flags;
519  struct {
520  unsigned max_nb_sessions;
525  } sym;
526 };
527 
528 #define RTE_CRYPTODEV_DETACHED (0)
529 #define RTE_CRYPTODEV_ATTACHED (1)
530 
536 };
537 
540  uint32_t nb_descriptors;
545 };
546 
568 typedef uint16_t (*rte_cryptodev_callback_fn)(uint16_t dev_id, uint16_t qp_id,
569  struct rte_crypto_op **ops, uint16_t nb_ops, void *user_param);
570 
580 typedef void (*rte_cryptodev_cb_fn)(uint8_t dev_id,
581  enum rte_cryptodev_event_type event, void *cb_arg);
582 
583 
586  uint64_t enqueued_count;
588  uint64_t dequeued_count;
595 };
596 
597 #define RTE_CRYPTODEV_NAME_MAX_LEN (64)
598 
609 extern int
610 rte_cryptodev_get_dev_id(const char *name);
611 
622 extern const char *
623 rte_cryptodev_name_get(uint8_t dev_id);
624 
632 extern uint8_t
633 rte_cryptodev_count(void);
634 
643 extern uint8_t
644 rte_cryptodev_device_count_by_driver(uint8_t driver_id);
645 
657 uint8_t
658 rte_cryptodev_devices_get(const char *driver_name, uint8_t *devices,
659  uint8_t nb_devices);
660 /*
661  * Return the NUMA socket to which a device is connected
662  *
663  * @param dev_id
664  * The identifier of the device
665  * @return
666  * The NUMA socket id to which the device is connected or
667  * a default of zero if the socket could not be determined.
668  * -1 if returned is the dev_id value is out of range.
669  */
670 extern int
671 rte_cryptodev_socket_id(uint8_t dev_id);
672 
675  int socket_id;
676  uint16_t nb_queue_pairs;
678  uint64_t ff_disable;
685 };
686 
701 extern int
702 rte_cryptodev_configure(uint8_t dev_id, struct rte_cryptodev_config *config);
703 
719 extern int
720 rte_cryptodev_start(uint8_t dev_id);
721 
728 extern void
729 rte_cryptodev_stop(uint8_t dev_id);
730 
740 extern int
741 rte_cryptodev_close(uint8_t dev_id);
742 
764 extern int
765 rte_cryptodev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id,
766  const struct rte_cryptodev_qp_conf *qp_conf, int socket_id);
767 
781 __rte_experimental
782 int
783 rte_cryptodev_get_qp_status(uint8_t dev_id, uint16_t queue_pair_id);
784 
792 extern uint16_t
793 rte_cryptodev_queue_pair_count(uint8_t dev_id);
794 
795 
807 extern int
808 rte_cryptodev_stats_get(uint8_t dev_id, struct rte_cryptodev_stats *stats);
809 
815 extern void
816 rte_cryptodev_stats_reset(uint8_t dev_id);
817 
831 extern void
832 rte_cryptodev_info_get(uint8_t dev_id, struct rte_cryptodev_info *dev_info);
833 
834 
848 extern int
849 rte_cryptodev_callback_register(uint8_t dev_id,
850  enum rte_cryptodev_event_type event,
851  rte_cryptodev_cb_fn cb_fn, void *cb_arg);
852 
866 extern int
867 rte_cryptodev_callback_unregister(uint8_t dev_id,
868  enum rte_cryptodev_event_type event,
869  rte_cryptodev_cb_fn cb_fn, void *cb_arg);
870 
871 struct rte_cryptodev_callback;
872 
874 RTE_TAILQ_HEAD(rte_cryptodev_cb_list, rte_cryptodev_callback);
875 
885  void *arg;
887 };
888 
893 struct rte_cryptodev_cb_rcu {
894  struct rte_cryptodev_cb *next;
896  struct rte_rcu_qsbr *qsbr;
898 };
899 
909 void *
910 rte_cryptodev_get_sec_ctx(uint8_t dev_id);
911 
917  uint64_t opaque_data;
919  uint16_t nb_drivers;
921  uint16_t user_data_sz;
923  __extension__ struct {
924  void *data;
925  uint16_t refcnt;
926  } sess_data[0];
928 };
929 
932  __extension__ void *sess_private_data[0];
934 };
935 
962 __rte_experimental
963 struct rte_mempool *
964 rte_cryptodev_sym_session_pool_create(const char *name, uint32_t nb_elts,
965  uint32_t elt_size, uint32_t cache_size, uint16_t priv_size,
966  int socket_id);
967 
979 
989 __rte_experimental
992 
1005 int
1007 
1020 __rte_experimental
1021 int
1023 
1040 int
1041 rte_cryptodev_sym_session_init(uint8_t dev_id,
1042  struct rte_cryptodev_sym_session *sess,
1043  struct rte_crypto_sym_xform *xforms,
1044  struct rte_mempool *mempool);
1045 
1061 __rte_experimental
1062 int
1063 rte_cryptodev_asym_session_init(uint8_t dev_id,
1064  struct rte_cryptodev_asym_session *sess,
1065  struct rte_crypto_asym_xform *xforms,
1066  struct rte_mempool *mempool);
1067 
1082 int
1083 rte_cryptodev_sym_session_clear(uint8_t dev_id,
1084  struct rte_cryptodev_sym_session *sess);
1085 
1096 __rte_experimental
1097 int
1098 rte_cryptodev_asym_session_clear(uint8_t dev_id,
1099  struct rte_cryptodev_asym_session *sess);
1100 
1108 unsigned int
1110 
1122 __rte_experimental
1123 unsigned int
1125  struct rte_cryptodev_sym_session *sess);
1126 
1133 __rte_experimental
1134 unsigned int
1136 
1148 unsigned int
1150 
1161 __rte_experimental
1162 unsigned int
1164 
1173 unsigned int
1174 rte_cryptodev_is_valid_dev(uint8_t dev_id);
1175 
1184 int rte_cryptodev_driver_id_get(const char *name);
1185 
1194 const char *rte_cryptodev_driver_name_get(uint8_t driver_id);
1195 
1208 __rte_experimental
1209 int
1211  struct rte_cryptodev_sym_session *sess,
1212  void *data,
1213  uint16_t size);
1214 
1225 __rte_experimental
1226 void *
1228  struct rte_cryptodev_sym_session *sess);
1229 
1242 __rte_experimental
1243 uint32_t
1245  struct rte_cryptodev_sym_session *sess, union rte_crypto_sym_ofs ofs,
1246  struct rte_crypto_sym_vec *vec);
1247 
1257 __rte_experimental
1258 int
1259 rte_cryptodev_get_raw_dp_ctx_size(uint8_t dev_id);
1260 
1266  struct rte_cryptodev_sym_session *crypto_sess;
1267  struct rte_crypto_sym_xform *xform;
1268  struct rte_security_session *sec_sess;
1269 };
1270 
1297  void *qp, uint8_t *drv_ctx, struct rte_crypto_sym_vec *vec,
1298  union rte_crypto_sym_ofs ofs, void *user_data[], int *enqueue_status);
1299 
1322  void *qp, uint8_t *drv_ctx, struct rte_crypto_vec *data_vec,
1323  uint16_t n_data_vecs, union rte_crypto_sym_ofs ofs,
1324  struct rte_crypto_va_iova_ptr *iv,
1325  struct rte_crypto_va_iova_ptr *digest,
1326  struct rte_crypto_va_iova_ptr *aad_or_auth_iv,
1327  void *user_data);
1328 
1340 typedef int (*cryptodev_sym_raw_operation_done_t)(void *qp, uint8_t *drv_ctx,
1341  uint32_t n);
1342 
1352 typedef uint32_t (*rte_cryptodev_raw_get_dequeue_count_t)(void *user_data);
1353 
1362 typedef void (*rte_cryptodev_raw_post_dequeue_t)(void *user_data,
1363  uint32_t index, uint8_t is_op_success);
1364 
1406 typedef uint32_t (*cryptodev_sym_raw_dequeue_burst_t)(void *qp,
1407  uint8_t *drv_ctx,
1408  rte_cryptodev_raw_get_dequeue_count_t get_dequeue_count,
1409  uint32_t max_nb_to_dequeue,
1410  rte_cryptodev_raw_post_dequeue_t post_dequeue,
1411  void **out_user_data, uint8_t is_user_data_array,
1412  uint32_t *n_success, int *dequeue_status);
1413 
1437 typedef void * (*cryptodev_sym_raw_dequeue_t)(
1438  void *qp, uint8_t *drv_ctx, int *dequeue_status,
1439  enum rte_crypto_op_status *op_status);
1440 
1447  void *qp_data;
1448 
1450  cryptodev_sym_raw_enqueue_burst_t enqueue_burst;
1453  cryptodev_sym_raw_dequeue_burst_t dequeue_burst;
1455 
1456  /* Driver specific context data */
1457  __extension__ uint8_t drv_ctx_data[];
1458 };
1459 
1483 __rte_experimental
1484 int
1485 rte_cryptodev_configure_raw_dp_ctx(uint8_t dev_id, uint16_t qp_id,
1486  struct rte_crypto_raw_dp_ctx *ctx,
1487  enum rte_crypto_op_sess_type sess_type,
1488  union rte_cryptodev_session_ctx session_ctx,
1489  uint8_t is_update);
1490 
1515 __rte_experimental
1516 uint32_t
1518  struct rte_crypto_sym_vec *vec, union rte_crypto_sym_ofs ofs,
1519  void **user_data, int *enqueue_status);
1520 
1541 __rte_experimental
1542 static __rte_always_inline int
1544  struct rte_crypto_vec *data_vec, uint16_t n_data_vecs,
1545  union rte_crypto_sym_ofs ofs,
1546  struct rte_crypto_va_iova_ptr *iv,
1547  struct rte_crypto_va_iova_ptr *digest,
1548  struct rte_crypto_va_iova_ptr *aad_or_auth_iv,
1549  void *user_data)
1550 {
1551  return (*ctx->enqueue)(ctx->qp_data, ctx->drv_ctx_data, data_vec,
1552  n_data_vecs, ofs, iv, digest, aad_or_auth_iv, user_data);
1553 }
1554 
1565 __rte_experimental
1566 int
1568  uint32_t n);
1569 
1611 __rte_experimental
1612 uint32_t
1614  rte_cryptodev_raw_get_dequeue_count_t get_dequeue_count,
1615  uint32_t max_nb_to_dequeue,
1616  rte_cryptodev_raw_post_dequeue_t post_dequeue,
1617  void **out_user_data, uint8_t is_user_data_array,
1618  uint32_t *n_success, int *dequeue_status);
1619 
1643 __rte_experimental
1644 static __rte_always_inline void *
1646  int *dequeue_status, enum rte_crypto_op_status *op_status)
1647 {
1648  return (*ctx->dequeue)(ctx->qp_data, ctx->drv_ctx_data, dequeue_status,
1649  op_status);
1650 }
1651 
1661 __rte_experimental
1662 int
1664  uint32_t n);
1665 
1702 __rte_experimental
1703 struct rte_cryptodev_cb *
1704 rte_cryptodev_add_enq_callback(uint8_t dev_id,
1705  uint16_t qp_id,
1707  void *cb_arg);
1708 
1731 __rte_experimental
1732 int rte_cryptodev_remove_enq_callback(uint8_t dev_id,
1733  uint16_t qp_id,
1734  struct rte_cryptodev_cb *cb);
1735 
1771 __rte_experimental
1772 struct rte_cryptodev_cb *
1773 rte_cryptodev_add_deq_callback(uint8_t dev_id,
1774  uint16_t qp_id,
1776  void *cb_arg);
1777 
1799 __rte_experimental
1800 int rte_cryptodev_remove_deq_callback(uint8_t dev_id,
1801  uint16_t qp_id,
1802  struct rte_cryptodev_cb *cb);
1803 
1804 #include <rte_cryptodev_core.h>
1841 static inline uint16_t
1842 rte_cryptodev_dequeue_burst(uint8_t dev_id, uint16_t qp_id,
1843  struct rte_crypto_op **ops, uint16_t nb_ops)
1844 {
1845  const struct rte_crypto_fp_ops *fp_ops;
1846  void *qp;
1847 
1848  rte_cryptodev_trace_dequeue_burst(dev_id, qp_id, (void **)ops, nb_ops);
1849 
1850  fp_ops = &rte_crypto_fp_ops[dev_id];
1851  qp = fp_ops->qp.data[qp_id];
1852 
1853  nb_ops = fp_ops->dequeue_burst(qp, ops, nb_ops);
1854 
1855 #ifdef RTE_CRYPTO_CALLBACKS
1856  if (unlikely(fp_ops->qp.deq_cb != NULL)) {
1857  struct rte_cryptodev_cb_rcu *list;
1858  struct rte_cryptodev_cb *cb;
1859 
1860  /* __ATOMIC_RELEASE memory order was used when the
1861  * call back was inserted into the list.
1862  * Since there is a clear dependency between loading
1863  * cb and cb->fn/cb->next, __ATOMIC_ACQUIRE memory order is
1864  * not required.
1865  */
1866  list = &fp_ops->qp.deq_cb[qp_id];
1867  rte_rcu_qsbr_thread_online(list->qsbr, 0);
1868  cb = __atomic_load_n(&list->next, __ATOMIC_RELAXED);
1869 
1870  while (cb != NULL) {
1871  nb_ops = cb->fn(dev_id, qp_id, ops, nb_ops,
1872  cb->arg);
1873  cb = cb->next;
1874  };
1875 
1876  rte_rcu_qsbr_thread_offline(list->qsbr, 0);
1877  }
1878 #endif
1879  return nb_ops;
1880 }
1881 
1913 static inline uint16_t
1914 rte_cryptodev_enqueue_burst(uint8_t dev_id, uint16_t qp_id,
1915  struct rte_crypto_op **ops, uint16_t nb_ops)
1916 {
1917  const struct rte_crypto_fp_ops *fp_ops;
1918  void *qp;
1919 
1920  fp_ops = &rte_crypto_fp_ops[dev_id];
1921  qp = fp_ops->qp.data[qp_id];
1922 #ifdef RTE_CRYPTO_CALLBACKS
1923  if (unlikely(fp_ops->qp.enq_cb != NULL)) {
1924  struct rte_cryptodev_cb_rcu *list;
1925  struct rte_cryptodev_cb *cb;
1926 
1927  /* __ATOMIC_RELEASE memory order was used when the
1928  * call back was inserted into the list.
1929  * Since there is a clear dependency between loading
1930  * cb and cb->fn/cb->next, __ATOMIC_ACQUIRE memory order is
1931  * not required.
1932  */
1933  list = &fp_ops->qp.enq_cb[qp_id];
1934  rte_rcu_qsbr_thread_online(list->qsbr, 0);
1935  cb = __atomic_load_n(&list->next, __ATOMIC_RELAXED);
1936 
1937  while (cb != NULL) {
1938  nb_ops = cb->fn(dev_id, qp_id, ops, nb_ops,
1939  cb->arg);
1940  cb = cb->next;
1941  };
1942 
1943  rte_rcu_qsbr_thread_offline(list->qsbr, 0);
1944  }
1945 #endif
1946 
1947  rte_cryptodev_trace_enqueue_burst(dev_id, qp_id, (void **)ops, nb_ops);
1948  return fp_ops->enqueue_burst(qp, ops, nb_ops);
1949 }
1950 
1951 
1952 
1953 #ifdef __cplusplus
1954 }
1955 #endif
1956 
1957 #endif /* _RTE_CRYPTODEV_H_ */
rte_cryptodev_devices_get
uint8_t rte_cryptodev_devices_get(const char *driver_name, uint8_t *devices, uint8_t nb_devices)
rte_crypto_raw_dp_ctx
Definition: rte_cryptodev.h:1446
rte_cryptodev_raw_enqueue
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)
Definition: rte_cryptodev.h:1543
rte_cryptodev_dequeue_burst
static uint16_t rte_cryptodev_dequeue_burst(uint8_t dev_id, uint16_t qp_id, struct rte_crypto_op **ops, uint16_t nb_ops)
Definition: rte_cryptodev.h:1842
rte_cryptodev_info
Definition: rte_cryptodev.h:499
rte_cryptodev_info::min_mbuf_headroom_req
uint16_t min_mbuf_headroom_req
Definition: rte_cryptodev.h:513
rte_cryptodev_stats::enqueued_count
uint64_t enqueued_count
Definition: rte_cryptodev.h:586
rte_cryptodev_asym_session_init
__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)
rte_cryptodev_raw_post_dequeue_t
void(* rte_cryptodev_raw_post_dequeue_t)(void *user_data, uint32_t index, uint8_t is_op_success)
Definition: rte_cryptodev.h:1362
rte_cryptodev_info::max_nb_queue_pairs
unsigned max_nb_queue_pairs
Definition: rte_cryptodev.h:510
rte_crypto_param_range::increment
uint16_t increment
Definition: rte_cryptodev.h:90
rte_crypto_cipher_algorithm
rte_crypto_cipher_algorithm
Definition: rte_crypto_sym.h:119
rte_cryptodev_remove_enq_callback
__rte_experimental int rte_cryptodev_remove_enq_callback(uint8_t dev_id, uint16_t qp_id, struct rte_cryptodev_cb *cb)
rte_cryptodev_asym_session_free
__rte_experimental int rte_cryptodev_asym_session_free(struct rte_cryptodev_asym_session *sess)
rte_crypto_sym_ofs
Definition: rte_crypto_sym.h:102
rte_cryptodev_capabilities
Definition: rte_cryptodev.h:194
rte_cryptodev_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)
Definition: rte_cryptodev.h:1914
rte_cryptodev_sym_capability_idx
Definition: rte_cryptodev.h:208
rte_mempool::name
char name[RTE_MEMPOOL_NAMESIZE]
Definition: rte_mempool.h:213
rte_cryptodev_qp_conf::mp_session_private
struct rte_mempool * mp_session_private
Definition: rte_cryptodev.h:543
unlikely
#define unlikely(x)
Definition: rte_branch_prediction.h:42
rte_crypto.h
rte_cryptodev_driver_id_get
int rte_cryptodev_driver_id_get(const char *name)
rte_cryptodev_info_get
void rte_cryptodev_info_get(uint8_t dev_id, struct rte_cryptodev_info *dev_info)
rte_cryptodev_asym_capability_idx::type
enum rte_crypto_asym_xform_type type
Definition: rte_cryptodev.h:223
rte_cryptodev_asymmetric_xform_capability::op_types
uint32_t op_types
Definition: rte_cryptodev.h:172
rte_cryptodev_sym_capability_get
const struct rte_cryptodev_symmetric_capability * rte_cryptodev_sym_capability_get(uint8_t dev_id, const struct rte_cryptodev_sym_capability_idx *idx)
rte_cryptodev_is_valid_dev
unsigned int rte_cryptodev_is_valid_dev(uint8_t dev_id)
RTE_CRYPTODEV_EVENT_MAX
@ RTE_CRYPTODEV_EVENT_MAX
Definition: rte_cryptodev.h:535
rte_cryptodev_symmetric_capability::key_size
struct rte_crypto_param_range key_size
Definition: rte_cryptodev.h:120
rte_cryptodev_raw_enqueue_burst
__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)
rte_cryptodev_asym_xform_capability_check_optype
__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)
rte_cryptodev_raw_dequeue_done
__rte_experimental int rte_cryptodev_raw_dequeue_done(struct rte_crypto_raw_dp_ctx *ctx, uint32_t n)
rte_cryptodev_symmetric_capability::digest_size
struct rte_crypto_param_range digest_size
Definition: rte_cryptodev.h:122
__rte_always_inline
#define __rte_always_inline
Definition: rte_common.h:233
RTE_CRYPTODEV_EVENT_ERROR
@ RTE_CRYPTODEV_EVENT_ERROR
Definition: rte_cryptodev.h:534
rte_cryptodev_sym_session_pool_create
__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)
rte_cryptodev_raw_dequeue_burst
__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)
rte_cryptodev_stop
void rte_cryptodev_stop(uint8_t dev_id)
RTE_CRYPTODEV_EVENT_UNKNOWN
@ RTE_CRYPTODEV_EVENT_UNKNOWN
Definition: rte_cryptodev.h:533
rte_cryptodev_callback_unregister
int rte_cryptodev_callback_unregister(uint8_t dev_id, enum rte_cryptodev_event_type event, rte_cryptodev_cb_fn cb_fn, void *cb_arg)
rte_cryptodev_sym_session::nb_drivers
uint16_t nb_drivers
Definition: rte_cryptodev.h:919
rte_cryptodev_sym_capability_check_cipher
int rte_cryptodev_sym_capability_check_cipher(const struct rte_cryptodev_symmetric_capability *capability, uint16_t key_size, uint16_t iv_size)
rte_cryptodev_capabilities::asym
struct rte_cryptodev_asymmetric_capability asym
Definition: rte_cryptodev.h:202
rte_cryptodev_symmetric_capability::iv_size
struct rte_crypto_param_range iv_size
Definition: rte_cryptodev.h:126
rte_cryptodev_sym_cpu_crypto_process
__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)
rte_cryptodev_cb::next
struct rte_cryptodev_cb * next
Definition: rte_cryptodev.h:881
rte_cryptodev_raw_get_dequeue_count_t
uint32_t(* rte_cryptodev_raw_get_dequeue_count_t)(void *user_data)
Definition: rte_cryptodev.h:1352
rte_cryptodev_callback_register
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_crypto_op_sess_type
rte_crypto_op_sess_type
Definition: rte_crypto.h:62
rte_cryptodev_queue_pair_setup
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_cryptodev_sym_session::user_data_sz
uint16_t user_data_sz
Definition: rte_cryptodev.h:921
rte_cryptodev_config::ff_disable
uint64_t ff_disable
Definition: rte_cryptodev.h:678
rte_cryptodev_asym_capability_get
__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)
cryptodev_sym_raw_enqueue_burst_t
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)
Definition: rte_cryptodev.h:1296
rte_cryptodev_qp_conf
Definition: rte_cryptodev.h:539
rte_cryptodev_get_qp_status
__rte_experimental int rte_cryptodev_get_qp_status(uint8_t dev_id, uint16_t queue_pair_id)
rte_cryptodev_asymmetric_xform_capability::xform_type
enum rte_crypto_asym_xform_type xform_type
Definition: rte_cryptodev.h:169
rte_crypto_op
Definition: rte_crypto.h:83
rte_cryptodev_sym_session_set_user_data
__rte_experimental int rte_cryptodev_sym_session_set_user_data(struct rte_cryptodev_sym_session *sess, void *data, uint16_t size)
rte_cryptodev_stats::dequeue_err_count
uint64_t dequeue_err_count
Definition: rte_cryptodev.h:593
rte_crypto_asym_op_type
rte_crypto_asym_op_type
Definition: rte_crypto_asym.h:104
rte_crypto_asym_xform_type
rte_crypto_asym_xform_type
Definition: rte_crypto_asym.h:60
rte_crypto_param_range::max
uint16_t max
Definition: rte_cryptodev.h:89
rte_cryptodev_get_raw_dp_ctx_size
__rte_experimental int rte_cryptodev_get_raw_dp_ctx_size(uint8_t dev_id)
rte_cryptodev_info::min_mbuf_tailroom_req
uint16_t min_mbuf_tailroom_req
Definition: rte_cryptodev.h:516
rte_cryptodev_callback_fn
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)
Definition: rte_cryptodev.h:568
rte_cryptodev_capabilities::op
enum rte_crypto_op_type op
Definition: rte_cryptodev.h:195
rte_cryptodev_asym_get_private_session_size
__rte_experimental unsigned int rte_cryptodev_asym_get_private_session_size(uint8_t dev_id)
rte_cryptodev_info::device
struct rte_device * device
Definition: rte_cryptodev.h:502
rte_cryptodev_asymmetric_xform_capability
Definition: rte_cryptodev.h:168
cryptodev_sym_raw_operation_done_t
int(* cryptodev_sym_raw_operation_done_t)(void *qp, uint8_t *drv_ctx, uint32_t n)
Definition: rte_cryptodev.h:1340
rte_crypto_sym_vec
Definition: rte_crypto_sym.h:70
rte_cryptodev_driver_name_get
const char * rte_cryptodev_driver_name_get(uint8_t driver_id)
rte_cryptodev_get_sec_ctx
void * rte_cryptodev_get_sec_ctx(uint8_t dev_id)
rte_cryptodev_sym_session_clear
int rte_cryptodev_sym_session_clear(uint8_t dev_id, struct rte_cryptodev_sym_session *sess)
rte_cryptodev_sym_session_free
int rte_cryptodev_sym_session_free(struct rte_cryptodev_sym_session *sess)
rte_cryptodev_info::feature_flags
uint64_t feature_flags
Definition: rte_cryptodev.h:504
rte_cryptodev_add_deq_callback
__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)
rte_cryptodev_asym_get_xform_enum
__rte_experimental int rte_cryptodev_asym_get_xform_enum(enum rte_crypto_asym_xform_type *xform_enum, const char *xform_string)
rte_cryptodev_symmetric_capability::dataunit_set
uint32_t dataunit_set
Definition: rte_cryptodev.h:139
rte_cryptodev_cb::fn
rte_cryptodev_callback_fn fn
Definition: rte_cryptodev.h:883
rte_crypto_op_type
rte_crypto_op_type
Definition: rte_crypto.h:29
rte_cryptodev_configure
int rte_cryptodev_configure(uint8_t dev_id, struct rte_cryptodev_config *config)
cryptodev_sym_raw_dequeue_burst_t
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)
Definition: rte_cryptodev.h:1406
rte_cryptodev_cb_fn
void(* rte_cryptodev_cb_fn)(uint8_t dev_id, enum rte_cryptodev_event_type event, void *cb_arg)
Definition: rte_cryptodev.h:580
rte_rcu_qsbr_thread_offline
static __rte_always_inline void rte_rcu_qsbr_thread_offline(struct rte_rcu_qsbr *v, unsigned int thread_id)
Definition: rte_rcu_qsbr.h:356
rte_cryptodev_event_type
rte_cryptodev_event_type
Definition: rte_cryptodev.h:532
rte_cryptodev_asym_session_create
__rte_experimental struct rte_cryptodev_asym_session * rte_cryptodev_asym_session_create(struct rte_mempool *mempool)
rte_crypto_aead_algorithm
rte_crypto_aead_algorithm
Definition: rte_crypto_sym.h:465
rte_cryptodev_stats::dequeued_count
uint64_t dequeued_count
Definition: rte_cryptodev.h:588
rte_common.h
rte_cryptodev_symmetric_capability::block_size
uint16_t block_size
Definition: rte_cryptodev.h:118
rte_cryptodev_sym_get_private_session_size
unsigned int rte_cryptodev_sym_get_private_session_size(uint8_t dev_id)
rte_cryptodev_sym_session_create
struct rte_cryptodev_sym_session * rte_cryptodev_sym_session_create(struct rte_mempool *mempool)
rte_cryptodev_configure_raw_dp_ctx
__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)
rte_cryptodev_close
int rte_cryptodev_close(uint8_t dev_id)
rte_cryptodev_sym_session_init
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_cryptodev_cb::arg
void * arg
Definition: rte_cryptodev.h:885
rte_cryptodev_asym_session_clear
__rte_experimental int rte_cryptodev_asym_session_clear(uint8_t dev_id, struct rte_cryptodev_asym_session *sess)
rte_cryptodev_asym_capability_idx
Definition: rte_cryptodev.h:222
rte_cryptodev_sym_capability_check_aead
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)
rte_cryptodev_core.h
rte_rcu_qsbr_thread_online
static __rte_always_inline void rte_rcu_qsbr_thread_online(struct rte_rcu_qsbr *v, unsigned int thread_id)
Definition: rte_rcu_qsbr.h:303
rte_cryptodev_start
int rte_cryptodev_start(uint8_t dev_id)
rte_cryptodev_symmetric_capability::cipher
struct rte_cryptodev_symmetric_capability::@130::@133 cipher
rte_cryptodev_asym_session
Definition: rte_cryptodev.h:931
cryptodev_sym_raw_enqueue_t
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)
Definition: rte_cryptodev.h:1321
rte_cryptodev_sym_get_existing_header_session_size
__rte_experimental unsigned int rte_cryptodev_sym_get_existing_header_session_size(struct rte_cryptodev_sym_session *sess)
rte_crypto_sym_xform
Definition: rte_crypto_sym.h:567
rte_cryptodev_stats_get
int rte_cryptodev_stats_get(uint8_t dev_id, struct rte_cryptodev_stats *stats)
rte_cryptodev_remove_deq_callback
__rte_experimental int rte_cryptodev_remove_deq_callback(uint8_t dev_id, uint16_t qp_id, struct rte_cryptodev_cb *cb)
rte_mempool
Definition: rte_mempool.h:212
cryptodev_sym_raw_dequeue_t
void *(* cryptodev_sym_raw_dequeue_t)(void *qp, uint8_t *drv_ctx, int *dequeue_status, enum rte_crypto_op_status *op_status)
Definition: rte_cryptodev.h:1437
rte_cryptodev_config::socket_id
int socket_id
Definition: rte_cryptodev.h:675
rte_cryptodev_sym_session::sess_data
__extension__ struct rte_cryptodev_sym_session::@141 sess_data[0]
rte_cryptodev_stats::enqueue_err_count
uint64_t enqueue_err_count
Definition: rte_cryptodev.h:591
RTE_STD_C11
#define RTE_STD_C11
Definition: rte_common.h:42
rte_cryptodev_sym_session_get_user_data
__rte_experimental void * rte_cryptodev_sym_session_get_user_data(struct rte_cryptodev_sym_session *sess)
rte_cryptodev_sym_session
Definition: rte_cryptodev.h:916
rte_crypto_sym_xform_type
rte_crypto_sym_xform_type
Definition: rte_crypto_sym.h:551
rte_cryptodev_asymmetric_xform_capability::modlen
struct rte_crypto_param_range modlen
Definition: rte_cryptodev.h:177
rte_cryptodev_config::nb_queue_pairs
uint16_t nb_queue_pairs
Definition: rte_cryptodev.h:676
rte_cryptodev_device_count_by_driver
uint8_t rte_cryptodev_device_count_by_driver(uint8_t driver_id)
rte_cryptodev_name_get
const char * rte_cryptodev_name_get(uint8_t dev_id)
rte_cryptodev_get_dev_id
int rte_cryptodev_get_dev_id(const char *name)
rte_kvargs.h
rte_crypto_param_range
Definition: rte_cryptodev.h:87
rte_cryptodev_info::driver_id
uint8_t driver_id
Definition: rte_cryptodev.h:501
rte_crypto_vec
Definition: rte_crypto_sym.h:33
rte_cryptodev_stats
Definition: rte_cryptodev.h:585
rte_cryptodev_info::driver_name
const char * driver_name
Definition: rte_cryptodev.h:500
rte_crypto_auth_algorithm
rte_crypto_auth_algorithm
Definition: rte_crypto_sym.h:301
rte_cryptodev_cb
Definition: rte_cryptodev.h:880
rte_cryptodev_raw_enqueue_done
__rte_experimental int rte_cryptodev_raw_enqueue_done(struct rte_crypto_raw_dp_ctx *ctx, uint32_t n)
rte_cryptodev_sym_session::opaque_data
uint64_t opaque_data
Definition: rte_cryptodev.h:917
rte_cryptodev_asym_xform_capability_check_modlen
__rte_experimental int rte_cryptodev_asym_xform_capability_check_modlen(const struct rte_cryptodev_asymmetric_xform_capability *capability, uint16_t modlen)
rte_rcu_qsbr.h
rte_cryptodev_symmetric_capability::algo
enum rte_crypto_auth_algorithm algo
Definition: rte_cryptodev.h:116
rte_cryptodev_count
uint8_t rte_cryptodev_count(void)
rte_cryptodev_stats_reset
void rte_cryptodev_stats_reset(uint8_t dev_id)
rte_cryptodev_symmetric_capability::aad_size
struct rte_crypto_param_range aad_size
Definition: rte_cryptodev.h:124
rte_cryptodev_raw_dequeue
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)
Definition: rte_cryptodev.h:1645
rte_cryptodev_asym_get_header_session_size
__rte_experimental unsigned int rte_cryptodev_asym_get_header_session_size(void)
rte_crypto_param_range::min
uint16_t min
Definition: rte_cryptodev.h:88
rte_cryptodev_qp_conf::mp_session
struct rte_mempool * mp_session
Definition: rte_cryptodev.h:541
rte_device
Definition: rte_dev.h:85
rte_mempool::cache_size
uint32_t cache_size
Definition: rte_mempool.h:224
rte_cryptodev_symmetric_capability::auth
struct rte_cryptodev_symmetric_capability::@130::@132 auth
rte_cryptodev_session_ctx
Definition: rte_cryptodev.h:1265
rte_cryptodev_get_feature_name
const char * rte_cryptodev_get_feature_name(uint64_t flag)
rte_cryptodev_get_aead_algo_enum
int rte_cryptodev_get_aead_algo_enum(enum rte_crypto_aead_algorithm *algo_enum, const char *algo_string)
rte_cryptodev_sym_get_header_session_size
unsigned int rte_cryptodev_sym_get_header_session_size(void)
rte_cryptodev_qp_conf::nb_descriptors
uint32_t nb_descriptors
Definition: rte_cryptodev.h:540
rte_cryptodev_capabilities::sym
struct rte_cryptodev_symmetric_capability sym
Definition: rte_cryptodev.h:200
rte_cryptodev_asymmetric_capability
Definition: rte_cryptodev.h:188
RTE_TAILQ_HEAD
RTE_TAILQ_HEAD(rte_cryptodev_cb_list, rte_cryptodev_callback)
rte_cryptodev_get_cipher_algo_enum
int rte_cryptodev_get_cipher_algo_enum(enum rte_crypto_cipher_algorithm *algo_enum, const char *algo_string)
rte_cryptodev_config
Definition: rte_cryptodev.h:674
rte_cryptodev_info::capabilities
const struct rte_cryptodev_capabilities * capabilities
Definition: rte_cryptodev.h:507
rte_cryptodev_symmetric_capability::xform_type
enum rte_crypto_sym_xform_type xform_type
Definition: rte_cryptodev.h:111
rte_mempool::socket_id
int socket_id
Definition: rte_mempool.h:222
rte_cryptodev_add_enq_callback
__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)
rte_cryptodev_info::max_nb_sessions
unsigned max_nb_sessions
Definition: rte_cryptodev.h:520
rte_cryptodev_sym_capability_check_auth
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)
rte_cryptodev_symmetric_capability
Definition: rte_cryptodev.h:110
rte_crypto_asym_xform
Definition: rte_crypto_asym.h:400
rte_mempool::elt_size
uint32_t elt_size
Definition: rte_mempool.h:227
rte_cryptodev_asym_session::sess_private_data
__extension__ void * sess_private_data[0]
Definition: rte_cryptodev.h:932
rte_dev.h
rte_cryptodev_get_auth_algo_enum
int rte_cryptodev_get_auth_algo_enum(enum rte_crypto_auth_algorithm *algo_enum, const char *algo_string)
rte_cryptodev_queue_pair_count
uint16_t rte_cryptodev_queue_pair_count(uint8_t dev_id)
rte_crypto_va_iova_ptr
Definition: rte_crypto_sym.h:60
rte_crypto_op_status
rte_crypto_op_status
Definition: rte_crypto.h:39