DPDK  17.05.2
rte_cryptodev_scheduler.h
Go to the documentation of this file.
1 /*-
2  * BSD LICENSE
3  *
4  * Copyright(c) 2017 Intel Corporation. All rights reserved.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above copyright
14  * notice, this list of conditions and the following disclaimer in
15  * the documentation and/or other materials provided with the
16  * distribution.
17  * * Neither the name of Intel Corporation nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 #ifndef _RTE_CRYPTO_SCHEDULER_H
35 #define _RTE_CRYPTO_SCHEDULER_H
36 
49 #include <stdint.h>
50 #include "rte_cryptodev_scheduler_operations.h"
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
57 #ifndef RTE_CRYPTODEV_SCHEDULER_MAX_NB_SLAVES
58 #define RTE_CRYPTODEV_SCHEDULER_MAX_NB_SLAVES (8)
59 #endif
60 
62 #define SCHEDULER_MODE_NAME_ROUND_ROBIN round-robin
63 
64 #define SCHEDULER_MODE_NAME_PKT_SIZE_DISTR packet-size-distr
65 
66 #define SCHEDULER_MODE_NAME_FAIL_OVER fail-over
67 
72  CDEV_SCHED_MODE_NOT_SET = 0,
81 
83 };
84 
85 #define RTE_CRYPTODEV_SCHEDULER_NAME_MAX_LEN (64)
86 #define RTE_CRYPTODEV_SCHEDULER_DESC_MAX_LEN (256)
87 
92  CDEV_SCHED_OPTION_NOT_SET = 0,
93  CDEV_SCHED_OPTION_THRESHOLD,
94 
95  CDEV_SCHED_OPTION_COUNT
96 };
97 
102  uint32_t threshold;
103 };
104 
106 
121 int
123  struct rte_cryptodev_scheduler *scheduler);
124 
139 int
140 rte_cryptodev_scheduler_slave_attach(uint8_t scheduler_id, uint8_t slave_id);
141 
155 int
156 rte_cryptodev_scheduler_slave_detach(uint8_t scheduler_id, uint8_t slave_id);
157 
158 
172 int
173 rte_cryptodev_scheduler_mode_set(uint8_t scheduler_id,
175 
187 rte_cryptodev_scheduler_mode_get(uint8_t scheduler_id);
188 
201 __rte_deprecated
202 int
203 rte_crpytodev_scheduler_mode_set(uint8_t scheduler_id,
205 
217 __rte_deprecated
219 rte_crpytodev_scheduler_mode_get(uint8_t scheduler_id);
220 
236 int
237 rte_cryptodev_scheduler_ordering_set(uint8_t scheduler_id,
238  uint32_t enable_reorder);
239 
251 int
252 rte_cryptodev_scheduler_ordering_get(uint8_t scheduler_id);
253 
268 int
269 rte_cryptodev_scheduler_slaves_get(uint8_t scheduler_id, uint8_t *slaves);
270 
285 int
286 rte_cryptodev_scheduler_option_set(uint8_t scheduler_id,
287  enum rte_cryptodev_schedule_option_type option_type,
288  void *option);
289 
304 int
305 rte_cryptodev_scheduler_option_get(uint8_t scheduler_id,
306  enum rte_cryptodev_schedule_option_type option_type,
307  void *option);
308 
309 typedef uint16_t (*rte_cryptodev_scheduler_burst_enqueue_t)(void *qp_ctx,
310  struct rte_crypto_op **ops, uint16_t nb_ops);
311 
312 typedef uint16_t (*rte_cryptodev_scheduler_burst_dequeue_t)(void *qp_ctx,
313  struct rte_crypto_op **ops, uint16_t nb_ops);
314 
317  const char *name;
318  const char *description;
322  struct rte_cryptodev_scheduler_ops *ops;
323 };
324 
331 
332 #ifdef __cplusplus
333 }
334 #endif
335 #endif /* _RTE_CRYPTO_SCHEDULER_H */