2 *------------------------------------------------------------------
3 * Copyright (c) 2019 Cisco and/or its affiliates.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *------------------------------------------------------------------
18 #include <vlib/vlib.h>
19 #include <vnet/plugin/plugin.h>
20 #include <vnet/crypto/crypto.h>
21 #include <crypto_ia32/crypto_ia32.h>
23 crypto_ia32_main_t crypto_ia32_main;
26 crypto_ia32_init (vlib_main_t * vm)
28 crypto_ia32_main_t *cm = &crypto_ia32_main;
29 vlib_thread_main_t *tm = vlib_get_thread_main ();
32 if ((error = vlib_call_init_function (vm, vnet_crypto_init)))
35 vec_validate_aligned (cm->per_thread_data, tm->n_vlib_mains - 1,
36 CLIB_CACHE_LINE_BYTES);
38 cm->crypto_engine_index =
39 vnet_crypto_register_engine (vm, "ia32", 100,
40 "Intel IA32 ISA Optimized Crypto");
42 if (clib_cpu_supports_x86_aes () &&
43 (error = crypto_ia32_aesni_cbc_init (vm)))
48 vec_free (cm->per_thread_data);
53 VLIB_INIT_FUNCTION (crypto_ia32_init);
55 #include <vpp/app/version.h>
58 VLIB_PLUGIN_REGISTER () = {
59 .version = VPP_BUILD_VER,
60 .description = "Intel AESNI Software Crypto Backend Plugin",
65 * fd.io coding-style-patch-verification: ON
68 * eval: (c-set-style "gnu")