4 * Copyright (c) Intel Corporation.
5 * Copyright(c) 2016 6WIND S.A.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
12 * * Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * * Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in
16 * the documentation and/or other materials provided with the
18 * * Neither the name of Intel Corporation nor the names of its
19 * contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 * DATA, OR PROFITS; OR BUSINESS INTERRUcryptoION) HOWEVER CAUSED AND ON ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 #ifndef _RTE_CRYPTO_H_
36 #define _RTE_CRYPTO_H_
42 /* In order to mock some DPDK functions, we place headers here with the name name as the DPDK headers
43 * so these definitions wil be picked up. Only what's mocked is included.
47 #include "rte_mempool.h"
48 #include "rte_crypto_sym.h"
50 enum rte_crypto_op_type
{
51 RTE_CRYPTO_OP_TYPE_UNDEFINED
,
52 RTE_CRYPTO_OP_TYPE_SYMMETRIC
,
55 enum rte_crypto_op_status
{
56 RTE_CRYPTO_OP_STATUS_SUCCESS
,
57 RTE_CRYPTO_OP_STATUS_NOT_PROCESSED
,
58 RTE_CRYPTO_OP_STATUS_AUTH_FAILED
,
59 RTE_CRYPTO_OP_STATUS_INVALID_SESSION
,
60 RTE_CRYPTO_OP_STATUS_INVALID_ARGS
,
61 RTE_CRYPTO_OP_STATUS_ERROR
,
64 struct rte_crypto_op
{
69 struct rte_mempool
*mempool
;
73 struct rte_crypto_sym_op sym
[0];
77 extern struct rte_mempool
*
78 rte_crypto_op_pool_create(const char *name
, enum rte_crypto_op_type type
,
79 unsigned nb_elts
, unsigned cache_size
, uint16_t priv_size
,
82 static inline unsigned
83 rte_crypto_op_bulk_alloc(struct rte_mempool
*mempool
,
84 enum rte_crypto_op_type type
,
85 struct rte_crypto_op
**ops
, uint16_t nb_ops
);
88 rte_crypto_op_attach_sym_session(struct rte_crypto_op
*op
,
89 struct rte_cryptodev_sym_session
*sess
);