DPDK  20.05.0
rte_cryptodev_scheduler.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2017 Intel Corporation
3  */
4 
5 #ifndef _RTE_CRYPTO_SCHEDULER_H
6 #define _RTE_CRYPTO_SCHEDULER_H
7 
20 #include <stdint.h>
21 #include "rte_cryptodev_scheduler_operations.h"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
28 #ifndef RTE_CRYPTODEV_SCHEDULER_MAX_NB_SLAVES
29 #define RTE_CRYPTODEV_SCHEDULER_MAX_NB_SLAVES (8)
30 #endif
31 
33 #define RTE_CRYPTODEV_SCHEDULER_MAX_NB_WORKER_CORES (RTE_MAX_LCORE - 1)
34 
36 #define SCHEDULER_MODE_NAME_ROUND_ROBIN round-robin
37 
38 #define SCHEDULER_MODE_NAME_PKT_SIZE_DISTR packet-size-distr
39 
40 #define SCHEDULER_MODE_NAME_FAIL_OVER fail-over
41 
42 #define SCHEDULER_MODE_NAME_MULTI_CORE multi-core
43 
48  CDEV_SCHED_MODE_NOT_SET = 0,
59 
61 };
62 
63 #define RTE_CRYPTODEV_SCHEDULER_NAME_MAX_LEN (64)
64 #define RTE_CRYPTODEV_SCHEDULER_DESC_MAX_LEN (256)
65 
70  CDEV_SCHED_OPTION_NOT_SET = 0,
71  CDEV_SCHED_OPTION_THRESHOLD,
72 
73  CDEV_SCHED_OPTION_COUNT
74 };
75 
79 #define RTE_CRYPTODEV_SCHEDULER_PARAM_THRES "threshold"
80 struct rte_cryptodev_scheduler_threshold_option {
81  uint32_t threshold;
82 };
83 
85 
100 int
102  struct rte_cryptodev_scheduler *scheduler);
103 
118 int
119 rte_cryptodev_scheduler_slave_attach(uint8_t scheduler_id, uint8_t slave_id);
120 
134 int
135 rte_cryptodev_scheduler_slave_detach(uint8_t scheduler_id, uint8_t slave_id);
136 
137 
151 int
152 rte_cryptodev_scheduler_mode_set(uint8_t scheduler_id,
154 
166 rte_cryptodev_scheduler_mode_get(uint8_t scheduler_id);
167 
183 int
184 rte_cryptodev_scheduler_ordering_set(uint8_t scheduler_id,
185  uint32_t enable_reorder);
186 
198 int
199 rte_cryptodev_scheduler_ordering_get(uint8_t scheduler_id);
200 
215 int
216 rte_cryptodev_scheduler_slaves_get(uint8_t scheduler_id, uint8_t *slaves);
217 
232 int
233 rte_cryptodev_scheduler_option_set(uint8_t scheduler_id,
234  enum rte_cryptodev_schedule_option_type option_type,
235  void *option);
236 
251 int
252 rte_cryptodev_scheduler_option_get(uint8_t scheduler_id,
253  enum rte_cryptodev_schedule_option_type option_type,
254  void *option);
255 
256 typedef uint16_t (*rte_cryptodev_scheduler_burst_enqueue_t)(void *qp_ctx,
257  struct rte_crypto_op **ops, uint16_t nb_ops);
258 
259 typedef uint16_t (*rte_cryptodev_scheduler_burst_dequeue_t)(void *qp_ctx,
260  struct rte_crypto_op **ops, uint16_t nb_ops);
261 
264  const char *name;
265  const char *description;
269  struct rte_cryptodev_scheduler_ops *ops;
270 };
271 
280 
281 #ifdef __cplusplus
282 }
283 #endif
284 #endif /* _RTE_CRYPTO_SCHEDULER_H */
struct rte_cryptodev_scheduler * crypto_scheduler_multicore
enum rte_cryptodev_scheduler_mode mode
enum rte_cryptodev_scheduler_mode rte_cryptodev_scheduler_mode_get(uint8_t scheduler_id)
struct rte_cryptodev_scheduler * crypto_scheduler_roundrobin
int rte_cryptodev_scheduler_ordering_get(uint8_t scheduler_id)
int rte_cryptodev_scheduler_option_set(uint8_t scheduler_id, enum rte_cryptodev_schedule_option_type option_type, void *option)
int rte_cryptodev_scheduler_option_get(uint8_t scheduler_id, enum rte_cryptodev_schedule_option_type option_type, void *option)
struct rte_cryptodev_scheduler * crypto_scheduler_failover
struct rte_cryptodev_scheduler_ops * ops
int rte_cryptodev_scheduler_slaves_get(uint8_t scheduler_id, uint8_t *slaves)
int rte_cryptodev_scheduler_slave_detach(uint8_t scheduler_id, uint8_t slave_id)
struct rte_cryptodev_scheduler * crypto_scheduler_pkt_size_based_distr
rte_cryptodev_scheduler_mode
rte_cryptodev_schedule_option_type
int rte_cryptodev_scheduler_ordering_set(uint8_t scheduler_id, uint32_t enable_reorder)
int rte_cryptodev_scheduler_slave_attach(uint8_t scheduler_id, uint8_t slave_id)
int rte_cryptodev_scheduler_mode_set(uint8_t scheduler_id, enum rte_cryptodev_scheduler_mode mode)
int rte_cryptodev_scheduler_load_user_scheduler(uint8_t scheduler_id, struct rte_cryptodev_scheduler *scheduler)