| 1 | /******************************************************************************* |
| 2 | Copyright (c) 2012-2024, Intel Corporation |
| 3 | |
| 4 | Redistribution and use in source and binary forms, with or without |
| 5 | modification, are permitted provided that the following conditions are met: |
| 6 | |
| 7 | * Redistributions of source code must retain the above copyright notice, |
| 8 | this list of conditions and the following disclaimer. |
| 9 | * Redistributions in binary form must reproduce the above copyright |
| 10 | notice, this list of conditions and the following disclaimer in the |
| 11 | documentation and/or other materials provided with the distribution. |
| 12 | * Neither the name of Intel Corporation nor the names of its contributors |
| 13 | may be used to endorse or promote products derived from this software |
| 14 | without specific prior written permission. |
| 15 | |
| 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE |
| 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 26 | *******************************************************************************/ |
| 27 | |
| 28 | #include "intel-ipsec-mb.h"cxx . . $ `<file>/lib/intel-ipsec-mb.h`/ |
| 29 | #include "include/ipsec_ooo_mgr.h"cxx . . $ `<file>/lib/include/ipsec_ooo_mgr.h`/ |
| 30 | #include "include/error.h"cxx . . $ `<file>/lib/include/error.h`/ |
| 31 | #include "include/cpu_feature.h"cxx . . $ `<file>/lib/include/cpu_feature.h`/ |
| 32 | #include "include/arch_x86_64.h"cxx . . $ `<file>/lib/include/arch_x86_64.h`/ |
| 33 | |
| 34 | IMB_DLL_LOCALcxx . . $ `lib/intel-ipsec-mb.h:55:9`! void |
| 35 | init_mb_mgr_sse_internalcxx . . $ init_mb_mgr_sse_internal(beec41fcb78e7267).(IMB_MGRcxx . . $ IMB_MGR# *state, const int reset_mgrs) |
| 36 | { |
| 37 | #ifdef SAFE_PARAMcxx . . $ `<built-in>:418:9`! |
| 38 | if (state == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) { |
| 39 | imb_set_errnocxx . . $ imb_set_errno(beec41fcb78e7267).(NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!, IMB_ERR_NULL_MBMGRcxx . . $ IMB_ERR_NULL_MBMGR.); |
| 40 | return; |
| 41 | } |
| 42 | #endif |
| 43 | |
| 44 | /* Check minimum CPU flags needed for SSE interface */ |
| 45 | if ((state->featurescxx . . $ IMB_MGR#features. & IMB_CPUFLAGS_SSEcxx . . $ `lib/intel-ipsec-mb.h:952:9`!) != IMB_CPUFLAGS_SSEcxx . . $ `lib/intel-ipsec-mb.h:952:9`!) { |
| 46 | imb_set_errnocxx . . $ imb_set_errno(beec41fcb78e7267).(state, IMB_ERR_MISSING_CPUFLAGS_INIT_MGRcxx . . $ IMB_ERR_MISSING_CPUFLAGS_INIT_MGR.); |
| 47 | return; |
| 48 | } |
| 49 | |
| 50 | state->featurescxx . . $ IMB_MGR#features. = cpu_feature_adjustcxx . . $ cpu_feature_adjust(80bad76eed2d2579).(state->flagscxx . . $ IMB_MGR#flags., cpu_feature_detectcxx . . $ cpu_feature_detect(f708dce9a8856c70).()); |
| 51 | |
| 52 | /* reset error status */ |
| 53 | imb_set_errnocxx . . $ imb_set_errno(beec41fcb78e7267).(state, 0); |
| 54 | |
| 55 | if ((state->featurescxx . . $ IMB_MGR#features. & IMB_CPUFLAGS_SSE_T3cxx . . $ `lib/intel-ipsec-mb.h:954:9`!) == IMB_CPUFLAGS_SSE_T3cxx . . $ `lib/intel-ipsec-mb.h:954:9`!) |
| 56 | init_mb_mgr_sse_t3_internalcxx . . $ init_mb_mgr_sse_t3_internal(beec41fcb78e7267).(state, reset_mgrs); |
| 57 | else if ((state->featurescxx . . $ IMB_MGR#features. & IMB_CPUFLAGS_SSE_T2cxx . . $ `lib/intel-ipsec-mb.h:953:9`!) == IMB_CPUFLAGS_SSE_T2cxx . . $ `lib/intel-ipsec-mb.h:953:9`!) |
| 58 | init_mb_mgr_sse_t2_internalcxx . . $ init_mb_mgr_sse_t2_internal(beec41fcb78e7267).(state, reset_mgrs); |
| 59 | else |
| 60 | init_mb_mgr_sse_t1_internalcxx . . $ init_mb_mgr_sse_t1_internal(beec41fcb78e7267).(state, reset_mgrs); |
| 61 | } |
| 62 | |
| 63 | void |
| 64 | init_mb_mgr_ssecxx . . $ init_mb_mgr_sse(d2992fa56a02ae3c).(IMB_MGRcxx . . $ IMB_MGR# *state) |
| 65 | { |
| 66 | init_mb_mgr_sse_internalcxx . . $ init_mb_mgr_sse_internal(beec41fcb78e7267).(state, 1); |
| 67 | |
| 68 | if (!self_testcxx . . $ self_test(6cff3712caec28fb).(state)) |
| 69 | imb_set_errnocxx . . $ imb_set_errno(beec41fcb78e7267).(state, IMB_ERR_SELFTESTcxx . . $ IMB_ERR_SELFTEST.); |
| 70 | } |
| 71 | |
| 72 | IMB_JOBcxx . . $ IMB_JOB# * |
| 73 | submit_job_ssecxx . . $ submit_job_sse(ba76486f76b4ebf4).(IMB_MGRcxx . . $ IMB_MGR# *state) |
| 74 | { |
| 75 | return IMB_SUBMIT_JOBcxx . . $ `lib/intel-ipsec-mb.h:1507:9`!(state); |
| 76 | } |
| 77 | |
| 78 | IMB_JOBcxx . . $ IMB_JOB# * |
| 79 | flush_job_ssecxx . . $ flush_job_sse(ba76486f76b4ebf4).(IMB_MGRcxx . . $ IMB_MGR# *state) |
| 80 | { |
| 81 | return IMB_FLUSH_JOBcxx . . $ `lib/intel-ipsec-mb.h:1536:9`!(state); |
| 82 | } |
| 83 | |
| 84 | uint32_tcxx . . $ uint32_t# |
| 85 | queue_size_ssecxx . . $ queue_size_sse(54eb936152da7ef6).(IMB_MGRcxx . . $ IMB_MGR# *state) |
| 86 | { |
| 87 | return IMB_QUEUE_SIZEcxx . . $ `lib/intel-ipsec-mb.h:1545:9`!(state); |
| 88 | } |
| 89 | |
| 90 | IMB_JOBcxx . . $ IMB_JOB# * |
| 91 | submit_job_nocheck_ssecxx . . $ submit_job_nocheck_sse(ba76486f76b4ebf4).(IMB_MGRcxx . . $ IMB_MGR# *state) |
| 92 | { |
| 93 | return IMB_SUBMIT_JOB_NOCHECKcxx . . $ `lib/intel-ipsec-mb.h:1518:9`!(state); |
| 94 | } |
| 95 | |
| 96 | IMB_JOBcxx . . $ IMB_JOB# * |
| 97 | get_next_job_ssecxx . . $ get_next_job_sse(ba76486f76b4ebf4).(IMB_MGRcxx . . $ IMB_MGR# *state) |
| 98 | { |
| 99 | return IMB_GET_NEXT_JOBcxx . . $ `lib/intel-ipsec-mb.h:1496:9`!(state); |
| 100 | } |
| 101 | |
| 102 | IMB_JOBcxx . . $ IMB_JOB# * |
| 103 | get_completed_job_ssecxx . . $ get_completed_job_sse(ba76486f76b4ebf4).(IMB_MGRcxx . . $ IMB_MGR# *state) |
| 104 | { |
| 105 | return IMB_GET_COMPLETED_JOBcxx . . $ `lib/intel-ipsec-mb.h:1527:9`!(state); |
| 106 | } |