DPDK
17.05.2
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
struct
rte_cryptodev_session {
61
RTE_STD_C11
62
struct
{
63
uint8_t
dev_id
;
64
enum
rte_cryptodev_type
type;
65
struct
rte_mempool
*
mp
;
66
}
__rte_aligned
(8);
67
68
__extension__
char
_private[0];
69
};
70
71
struct
rte_cryptodev_driver
;
72
90
typedef
int (*
cryptodev_init_t
)(
struct
rte_cryptodev_driver
*drv,
91
struct
rte_cryptodev
*dev);
92
110
typedef
int (*
cryptodev_uninit_t
)(
const
struct
rte_cryptodev_driver
*drv,
111
struct
rte_cryptodev
*dev);
112
125
struct
rte_cryptodev_driver
{
126
struct
rte_pci_driver
pci_drv
;
127
unsigned
dev_private_size
;
129
cryptodev_init_t
cryptodev_init
;
130
cryptodev_uninit_t
cryptodev_uninit
;
131
};
132
133
135
struct
rte_cryptodev_global
{
136
struct
rte_cryptodev
*
devs
;
137
struct
rte_cryptodev_data
*
data
[RTE_CRYPTO_MAX_DEVS];
139
uint8_t
nb_devs
;
140
uint8_t
max_devs
;
141
};
142
144
extern
struct
rte_cryptodev_global
*
rte_cryptodev_globals
;
145
155
struct
rte_cryptodev
*
156
rte_cryptodev_pmd_get_dev
(uint8_t
dev_id
);
157
166
struct
rte_cryptodev
*
167
rte_cryptodev_pmd_get_named_dev
(
const
char
*name);
168
177
unsigned
int
178
rte_cryptodev_pmd_is_valid_dev
(uint8_t
dev_id
);
179
183
extern
struct
rte_cryptodev
*rte_cryptodevs;
184
185
200
typedef
int (*
cryptodev_configure_t
)(
struct
rte_cryptodev
*dev,
201
struct
rte_cryptodev_config
*config);
202
210
typedef
int (*
cryptodev_start_t
)(
struct
rte_cryptodev
*dev);
211
217
typedef
void (*
cryptodev_stop_t
)(
struct
rte_cryptodev
*dev);
218
227
typedef
int (*
cryptodev_close_t
)(
struct
rte_cryptodev
*dev);
228
229
236
typedef
void (*
cryptodev_stats_get_t
)(
struct
rte_cryptodev
*dev,
237
struct
rte_cryptodev_stats
*stats);
238
239
245
typedef
void (*
cryptodev_stats_reset_t
)(
struct
rte_cryptodev
*dev);
246
247
253
typedef
void (*
cryptodev_info_get_t
)(
struct
rte_cryptodev
*dev,
254
struct
rte_cryptodev_info
*dev_info);
255
264
typedef
int (*
cryptodev_queue_pair_start_t
)(
struct
rte_cryptodev
*dev,
265
uint16_t qp_id);
266
275
typedef
int (*
cryptodev_queue_pair_stop_t
)(
struct
rte_cryptodev
*dev,
276
uint16_t qp_id);
277
288
typedef
int (*
cryptodev_queue_pair_setup_t
)(
struct
rte_cryptodev
*dev,
289
uint16_t qp_id,
const
struct
rte_cryptodev_qp_conf
*qp_conf,
290
int
socket_id);
291
302
typedef
int (*
cryptodev_queue_pair_release_t
)(
struct
rte_cryptodev
*dev,
303
uint16_t qp_id);
304
312
typedef
uint32_t (*
cryptodev_queue_pair_count_t
)(
struct
rte_cryptodev
*dev);
313
326
typedef
int (*
cryptodev_sym_create_session_pool_t
)(
327
struct
rte_cryptodev
*dev,
unsigned
nb_objs,
328
unsigned
obj_cache_size,
int
socket_id);
329
330
340
typedef
unsigned (*
cryptodev_sym_get_session_private_size_t
)(
341
struct
rte_cryptodev
*dev);
342
354
typedef
void (*
cryptodev_sym_initialize_session_t
)(
struct
rte_mempool
*mempool,
355
void
*session_private);
356
368
typedef
void
* (*cryptodev_sym_configure_session_t)(
struct
rte_cryptodev
*dev,
369
struct
rte_crypto_sym_xform
*xform,
void
*session_private);
370
375
typedef
void (*
cryptodev_sym_free_session_t
)(
struct
rte_cryptodev
*dev,
376
void
*session_private);
377
386
typedef
int (*
cryptodev_sym_queue_pair_attach_session_t
)(
387
struct
rte_cryptodev
*dev,
388
uint16_t qp_id,
389
void
*session_private);
390
399
typedef
int (*
cryptodev_sym_queue_pair_detach_session_t
)(
400
struct
rte_cryptodev
*dev,
401
uint16_t qp_id,
402
void
*session_private);
403
405
struct
rte_cryptodev_ops
{
406
cryptodev_configure_t
dev_configure
;
407
cryptodev_start_t
dev_start
;
408
cryptodev_stop_t
dev_stop
;
409
cryptodev_close_t
dev_close
;
411
cryptodev_info_get_t
dev_infos_get
;
413
cryptodev_stats_get_t
stats_get
;
415
cryptodev_stats_reset_t
stats_reset
;
418
cryptodev_queue_pair_setup_t
queue_pair_setup
;
420
cryptodev_queue_pair_release_t
queue_pair_release
;
422
cryptodev_queue_pair_start_t
queue_pair_start
;
424
cryptodev_queue_pair_stop_t
queue_pair_stop
;
426
cryptodev_queue_pair_count_t
queue_pair_count
;
429
cryptodev_sym_get_session_private_size_t
session_get_size
;
431
cryptodev_sym_initialize_session_t
session_initialize
;
433
cryptodev_sym_configure_session_t
session_configure
;
435
cryptodev_sym_free_session_t
session_clear
;
437
cryptodev_sym_queue_pair_attach_session_t
qp_attach_session
;
439
cryptodev_sym_queue_pair_attach_session_t
qp_detach_session
;
441
};
442
443
455
struct
rte_cryptodev
*
456
rte_cryptodev_pmd_allocate
(
const
char
*name,
int
socket_id);
457
470
struct
rte_cryptodev
*
471
rte_cryptodev_pmd_virtual_dev_init
(
const
char
*name,
size_t
dev_private_size,
472
int
socket_id);
473
474
485
extern
int
486
rte_cryptodev_pmd_release_device
(
struct
rte_cryptodev
*cryptodev);
487
498
void
rte_cryptodev_pmd_callback_process
(
struct
rte_cryptodev
*dev,
499
enum
rte_cryptodev_event_type
event);
500
505
int
rte_cryptodev_pci_probe
(
struct
rte_pci_driver
*pci_drv,
506
struct
rte_pci_device
*pci_dev);
507
512
int
rte_cryptodev_pci_remove
(
struct
rte_pci_device
*pci_dev);
513
518
int
519
rte_cryptodev_pmd_create_dev_name(
char
*name,
const
char
*dev_name_prefix);
520
521
#ifdef __cplusplus
522
}
523
#endif
524
525
#endif
/* _RTE_CRYPTODEV_PMD_H_ */
Generated by
1.8.1.2