2 * Copyright (c) 2020 Intel and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 #include <vnet/crypto/crypto.h>
18 #ifndef __crypto_sw_scheduler_h__
19 #define __crypto_sw_scheduler_h__
21 #define CRYPTO_SW_SCHEDULER_QUEUE_SIZE 64
22 #define CRYPTO_SW_SCHEDULER_QUEUE_MASK (CRYPTO_SW_SCHEDULER_QUEUE_SIZE - 1)
26 CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
29 vnet_crypto_async_frame_t *jobs[0];
30 } crypto_sw_scheduler_queue_t;
34 CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
35 crypto_sw_scheduler_queue_t *queues[VNET_CRYPTO_ASYNC_OP_N_IDS];
36 vnet_crypto_op_t *crypto_ops;
37 vnet_crypto_op_t *integ_ops;
38 vnet_crypto_op_t *chained_crypto_ops;
39 vnet_crypto_op_t *chained_integ_ops;
40 vnet_crypto_op_chunk_t *chunks;
41 u8 self_crypto_enabled;
42 } crypto_sw_scheduler_per_thread_data_t;
46 u32 crypto_engine_index;
47 crypto_sw_scheduler_per_thread_data_t *per_thread_data;
48 vnet_crypto_key_t *keys;
49 } crypto_sw_scheduler_main_t;
51 extern crypto_sw_scheduler_main_t crypto_sw_scheduler_main;
53 extern int crypto_sw_scheduler_set_worker_crypto (u32 worker_idx, u8 enabled);
55 extern clib_error_t *crypto_sw_scheduler_api_init (vlib_main_t * vm);
57 #endif // __crypto_native_h__
60 * fd.io coding-style-patch-verification: ON
63 * eval: (c-set-style "gnu")