DPDK
19.05.0
Main Page
Related Pages
Data Structures
Files
Examples
File List
Globals
lib
librte_eal
common
include
rte_eal.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: BSD-3-Clause
2
* Copyright(c) 2010-2018 Intel Corporation
3
*/
4
5
#ifndef _RTE_EAL_H_
6
#define _RTE_EAL_H_
7
14
#include <stdint.h>
15
#include <sched.h>
16
#include <time.h>
17
18
#include <rte_config.h>
19
#include <rte_compat.h>
20
#include <
rte_per_lcore.h
>
21
#include <
rte_bus.h
>
22
23
#include <rte_pci_dev_feature_defs.h>
24
25
#ifdef __cplusplus
26
extern
"C"
{
27
#endif
28
29
#define RTE_MAGIC 19820526
31
/* Maximum thread_name length. */
32
#define RTE_MAX_THREAD_NAME_LEN 16
33
37
enum
rte_lcore_role_t
{
38
ROLE_RTE,
39
ROLE_OFF,
40
ROLE_SERVICE,
41
};
42
46
enum
rte_proc_type_t
{
47
RTE_PROC_AUTO = -1,
/* allow auto-detection of primary/secondary */
48
RTE_PROC_PRIMARY = 0,
/* set to zero, so primary is the default */
49
RTE_PROC_SECONDARY,
50
51
RTE_PROC_INVALID
52
};
53
57
struct
rte_config
{
58
uint32_t
master_lcore
;
59
uint32_t
lcore_count
;
60
uint32_t
numa_node_count
;
61
uint32_t
numa_nodes
[RTE_MAX_NUMA_NODES];
62
uint32_t
service_lcore_count
;
63
enum
rte_lcore_role_t
lcore_role
[RTE_MAX_LCORE];
66
enum
rte_proc_type_t
process_type
;
67
69
enum
rte_iova_mode
iova_mode
;
70
75
struct
rte_mem_config
*
mem_config
;
76
} __attribute__((__packed__));
77
84
struct
rte_config
*
rte_eal_get_configuration
(
void
);
85
94
enum
rte_lcore_role_t
rte_eal_lcore_role
(
unsigned
lcore_id);
95
96
103
enum
rte_proc_type_t
rte_eal_process_type
(
void
);
104
114
int
rte_eal_iopl_init
(
void
);
115
174
int
rte_eal_init
(
int
argc,
char
**argv);
175
187
int
rte_eal_cleanup
(
void
);
188
204
int
rte_eal_primary_proc_alive
(
const
char
*config_file_path);
205
206
#define RTE_MP_MAX_FD_NUM 8
/* The max amount of fds */
207
#define RTE_MP_MAX_NAME_LEN 64
/* The max length of action name */
208
#define RTE_MP_MAX_PARAM_LEN 256
/* The max length of param */
209
struct
rte_mp_msg {
210
char
name[RTE_MP_MAX_NAME_LEN];
211
int
len_param;
212
int
num_fds;
213
uint8_t param[RTE_MP_MAX_PARAM_LEN];
214
int
fds[RTE_MP_MAX_FD_NUM];
215
};
216
217
struct
rte_mp_reply
{
218
int
nb_sent;
219
int
nb_received;
220
struct
rte_mp_msg *msgs;
/* caller to free */
221
};
222
236
typedef
int (*
rte_mp_t
)(
const
struct
rte_mp_msg *msg,
const
void
*peer);
237
252
typedef
int (*
rte_mp_async_reply_t
)(
const
struct
rte_mp_msg *request,
253
const
struct
rte_mp_reply
*reply);
254
275
int
__rte_experimental
276
rte_mp_action_register
(
const
char
*name,
rte_mp_t
action);
277
292
void
__rte_experimental
293
rte_mp_action_unregister
(
const
char
*name);
294
311
int
__rte_experimental
312
rte_mp_sendmsg
(
struct
rte_mp_msg *msg);
313
342
int
__rte_experimental
343
rte_mp_request_sync
(
struct
rte_mp_msg *req,
struct
rte_mp_reply
*reply,
344
const
struct
timespec *ts);
345
368
int
__rte_experimental
369
rte_mp_request_async
(
struct
rte_mp_msg *req,
const
struct
timespec *ts,
370
rte_mp_async_reply_t
clb);
371
396
int
__rte_experimental
397
rte_mp_reply
(
struct
rte_mp_msg *msg,
const
char
*peer);
398
405
int
__rte_experimental
406
rte_mp_dev_hotplug_init
(
void
);
407
414
typedef
void (*
rte_usage_hook_t
)(
const
char
* prgname);
415
437
rte_usage_hook_t
438
rte_set_application_usage_hook
(
rte_usage_hook_t
usage_func);
439
443
#define RTE_EAL_TAILQ_RWLOCK (&rte_eal_get_configuration()->mem_config->qlock)
444
448
#define RTE_EAL_MEMPOOL_RWLOCK (&rte_eal_get_configuration()->mem_config->mplock)
449
460
int
rte_eal_has_hugepages
(
void
);
461
469
int
rte_eal_has_pci
(
void
);
470
477
int
rte_eal_create_uio_dev
(
void
);
478
486
enum
rte_intr_mode
rte_eal_vfio_intr_mode
(
void
);
487
495
int
rte_sys_gettid
(
void
);
496
504
static
inline
int
rte_gettid
(
void
)
505
{
506
static
RTE_DEFINE_PER_LCORE
(
int
, _thread_id) = -1;
507
if
(
RTE_PER_LCORE
(_thread_id) == -1)
508
RTE_PER_LCORE
(_thread_id) =
rte_sys_gettid
();
509
return
RTE_PER_LCORE
(_thread_id);
510
}
511
518
enum
rte_iova_mode
rte_eal_iova_mode
(
void
);
519
526
const
char
*
527
rte_eal_mbuf_user_pool_ops
(
void
);
528
535
const
char
*
536
rte_eal_get_runtime_dir
(
void
);
537
538
#ifdef __cplusplus
539
}
540
#endif
541
542
#endif
/* _RTE_EAL_H_ */
Generated by
1.8.1.2