DPDK
17.02.1
Main Page
Related Pages
Data Structures
Files
Examples
File List
Globals
lib
librte_cryptodev
rte_cryptodev_pmd.h
Go to the documentation of this file.
1
/*-
2
*
3
* Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
4
*
5
* Redistribution and use in source and binary forms, with or without
6
* modification, are permitted provided that the following conditions
7
* are met:
8
*
9
* * Redistributions of source code must retain the above copyright
10
* notice, this list of conditions and the following disclaimer.
11
* * Redistributions in binary form must reproduce the above copyright
12
* notice, this list of conditions and the following disclaimer in
13
* the documentation and/or other materials provided with the
14
* distribution.
15
* * Neither the name of Intel Corporation nor the names of its
16
* contributors may be used to endorse or promote products derived
17
* from this software without specific prior written permission.
18
*
19
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
*/
31
32
#ifndef _RTE_CRYPTODEV_PMD_H_
33
#define _RTE_CRYPTODEV_PMD_H_
34
43
#ifdef __cplusplus
44
extern
"C"
{
45
#endif
46
47
#include <string.h>
48
49
#include <
rte_dev.h
>
50
#include <
rte_pci.h
>
51
#include <
rte_malloc.h
>
52
#include <
rte_mbuf.h
>
53
#include <
rte_mempool.h
>
54
#include <
rte_log.h
>
55
#include <
rte_common.h
>
56
57
#include "
rte_crypto.h
"
58
#include "
rte_cryptodev.h
"
59
60
61
#ifdef RTE_LIBRTE_CRYPTODEV_DEBUG
62
#define RTE_PMD_DEBUG_TRACE(...) \
63
rte_pmd_debug_trace(__func__, __VA_ARGS__)
64
#else
65
#define RTE_PMD_DEBUG_TRACE(...)
66
#endif
67
68
struct
rte_cryptodev_session {
69
RTE_STD_C11
70
struct
{
71
uint8_t
dev_id
;
72
enum
rte_cryptodev_type
type;
73
struct
rte_mempool
*
mp
;
74
}
__rte_aligned
(8);
75
76
__extension__
char
_private[0];
77
};
78
79
struct
rte_cryptodev_driver
;
80
98
typedef
int (*
cryptodev_init_t
)(
struct
rte_cryptodev_driver
*drv,
99
struct
rte_cryptodev
*dev);
100
118
typedef
int (*
cryptodev_uninit_t
)(
const
struct
rte_cryptodev_driver
*drv,
119
struct
rte_cryptodev
*dev);
120
133
struct
rte_cryptodev_driver
{
134
struct
rte_pci_driver
pci_drv
;
135
unsigned
dev_private_size
;
137
cryptodev_init_t
cryptodev_init
;
138
cryptodev_uninit_t
cryptodev_uninit
;
139
};
140
141
143
struct
rte_cryptodev_global
{
144
struct
rte_cryptodev
*
devs
;
145
struct
rte_cryptodev_data
*
data
[RTE_CRYPTO_MAX_DEVS];
147
uint8_t
nb_devs
;
148
uint8_t
max_devs
;
149
};
150
152
extern
struct
rte_cryptodev_global
*
rte_cryptodev_globals
;
153
163
struct
rte_cryptodev
*
164
rte_cryptodev_pmd_get_dev
(uint8_t
dev_id
);
165
174
struct
rte_cryptodev
*
175
rte_cryptodev_pmd_get_named_dev
(
const
char
*name);
176
185
unsigned
int
186
rte_cryptodev_pmd_is_valid_dev
(uint8_t
dev_id
);
187
191
extern
struct
rte_cryptodev
*rte_cryptodevs;
192
193
207
typedef
int (*
cryptodev_configure_t
)(
struct
rte_cryptodev
*dev);
208
216
typedef
int (*
cryptodev_start_t
)(
struct
rte_cryptodev
*dev);
217
223
typedef
void (*
cryptodev_stop_t
)(
struct
rte_cryptodev
*dev);
224
233
typedef
int (*
cryptodev_close_t
)(
struct
rte_cryptodev
*dev);
234
235
242
typedef
void (*
cryptodev_stats_get_t
)(
struct
rte_cryptodev
*dev,
243
struct
rte_cryptodev_stats
*stats);
244
245
251
typedef
void (*
cryptodev_stats_reset_t
)(
struct
rte_cryptodev
*dev);
252
253
259
typedef
void (*
cryptodev_info_get_t
)(
struct
rte_cryptodev
*dev,
260
struct
rte_cryptodev_info
*dev_info);
261
270
typedef
int (*
cryptodev_queue_pair_start_t
)(
struct
rte_cryptodev
*dev,
271
uint16_t qp_id);
272
281
typedef
int (*
cryptodev_queue_pair_stop_t
)(
struct
rte_cryptodev
*dev,
282
uint16_t qp_id);
283
294
typedef
int (*
cryptodev_queue_pair_setup_t
)(
struct
rte_cryptodev
*dev,
295
uint16_t qp_id,
const
struct
rte_cryptodev_qp_conf
*qp_conf,
296
int
socket_id);
297
308
typedef
int (*
cryptodev_queue_pair_release_t
)(
struct
rte_cryptodev
*dev,
309
uint16_t qp_id);
310
318
typedef
uint32_t (*
cryptodev_queue_pair_count_t
)(
struct
rte_cryptodev
*dev);
319
332
typedef
int (*
cryptodev_sym_create_session_pool_t
)(
333
struct
rte_cryptodev
*dev,
unsigned
nb_objs,
334
unsigned
obj_cache_size,
int
socket_id);
335
336
346
typedef
unsigned (*
cryptodev_sym_get_session_private_size_t
)(
347
struct
rte_cryptodev
*dev);
348
360
typedef
void (*
cryptodev_sym_initialize_session_t
)(
struct
rte_mempool
*mempool,
361
void
*session_private);
362
374
typedef
void
* (*cryptodev_sym_configure_session_t)(
struct
rte_cryptodev
*dev,
375
struct
rte_crypto_sym_xform
*xform,
void
*session_private);
376
381
typedef
void (*
cryptodev_sym_free_session_t
)(
struct
rte_cryptodev
*dev,
382
void
*session_private);
383
384
386
struct
rte_cryptodev_ops
{
387
cryptodev_configure_t
dev_configure
;
388
cryptodev_start_t
dev_start
;
389
cryptodev_stop_t
dev_stop
;
390
cryptodev_close_t
dev_close
;
392
cryptodev_info_get_t
dev_infos_get
;
394
cryptodev_stats_get_t
stats_get
;
396
cryptodev_stats_reset_t
stats_reset
;
399
cryptodev_queue_pair_setup_t
queue_pair_setup
;
401
cryptodev_queue_pair_release_t
queue_pair_release
;
403
cryptodev_queue_pair_start_t
queue_pair_start
;
405
cryptodev_queue_pair_stop_t
queue_pair_stop
;
407
cryptodev_queue_pair_count_t
queue_pair_count
;
410
cryptodev_sym_get_session_private_size_t
session_get_size
;
412
cryptodev_sym_initialize_session_t
session_initialize
;
414
cryptodev_sym_configure_session_t
session_configure
;
416
cryptodev_sym_free_session_t
session_clear
;
418
};
419
420
432
struct
rte_cryptodev
*
433
rte_cryptodev_pmd_allocate
(
const
char
*name,
int
socket_id);
434
447
struct
rte_cryptodev
*
448
rte_cryptodev_pmd_virtual_dev_init
(
const
char
*name,
size_t
dev_private_size,
449
int
socket_id);
450
451
462
extern
int
463
rte_cryptodev_pmd_release_device
(
struct
rte_cryptodev
*cryptodev);
464
475
void
rte_cryptodev_pmd_callback_process
(
struct
rte_cryptodev
*dev,
476
enum
rte_cryptodev_event_type
event);
477
482
int
rte_cryptodev_pci_probe
(
struct
rte_pci_driver
*pci_drv,
483
struct
rte_pci_device
*pci_dev);
484
489
int
rte_cryptodev_pci_remove
(
struct
rte_pci_device
*pci_dev);
490
495
int
496
rte_cryptodev_pmd_create_dev_name(
char
*name,
const
char
*dev_name_prefix);
497
498
#ifdef __cplusplus
499
}
500
#endif
501
502
#endif
/* _RTE_CRYPTODEV_PMD_H_ */
Generated by
1.8.1.2