DPDK
18.05.1
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
190
int
__rte_experimental
rte_eal_cleanup
(
void
);
191
207
int
rte_eal_primary_proc_alive
(
const
char
*config_file_path);
208
209
#define RTE_MP_MAX_FD_NUM 8
/* The max amount of fds */
210
#define RTE_MP_MAX_NAME_LEN 64
/* The max length of action name */
211
#define RTE_MP_MAX_PARAM_LEN 256
/* The max length of param */
212
struct
rte_mp_msg {
213
char
name[RTE_MP_MAX_NAME_LEN];
214
int
len_param;
215
int
num_fds;
216
uint8_t param[RTE_MP_MAX_PARAM_LEN];
217
int
fds[RTE_MP_MAX_FD_NUM];
218
};
219
220
struct
rte_mp_reply
{
221
int
nb_sent;
222
int
nb_received;
223
struct
rte_mp_msg *msgs;
/* caller to free */
224
};
225
232
typedef
int (*
rte_mp_t
)(
const
struct
rte_mp_msg *msg,
const
void
*peer);
233
241
typedef
int (*
rte_mp_async_reply_t
)(
const
struct
rte_mp_msg *request,
242
const
struct
rte_mp_reply
*reply);
243
264
int
__rte_experimental
265
rte_mp_action_register
(
const
char
*name,
rte_mp_t
action);
266
281
void
__rte_experimental
282
rte_mp_action_unregister
(
const
char
*name);
283
300
int
__rte_experimental
301
rte_mp_sendmsg
(
struct
rte_mp_msg *msg);
302
328
int
__rte_experimental
329
rte_mp_request_sync
(
struct
rte_mp_msg *req,
struct
rte_mp_reply
*reply,
330
const
struct
timespec *ts);
331
354
int
__rte_experimental
355
rte_mp_request_async
(
struct
rte_mp_msg *req,
const
struct
timespec *ts,
356
rte_mp_async_reply_t
clb);
357
377
int
__rte_experimental
378
rte_mp_reply
(
struct
rte_mp_msg *msg,
const
char
*peer);
379
386
typedef
void (*
rte_usage_hook_t
)(
const
char
* prgname);
387
409
rte_usage_hook_t
410
rte_set_application_usage_hook
(
rte_usage_hook_t
usage_func);
411
415
#define RTE_EAL_TAILQ_RWLOCK (&rte_eal_get_configuration()->mem_config->qlock)
416
420
#define RTE_EAL_MEMPOOL_RWLOCK (&rte_eal_get_configuration()->mem_config->mplock)
421
432
int
rte_eal_has_hugepages
(
void
);
433
441
int
rte_eal_has_pci
(
void
);
442
449
int
rte_eal_create_uio_dev
(
void
);
450
458
enum
rte_intr_mode
rte_eal_vfio_intr_mode
(
void
);
459
467
int
rte_sys_gettid
(
void
);
468
476
static
inline
int
rte_gettid
(
void
)
477
{
478
static
RTE_DEFINE_PER_LCORE
(
int
, _thread_id) = -1;
479
if
(
RTE_PER_LCORE
(_thread_id) == -1)
480
RTE_PER_LCORE
(_thread_id) =
rte_sys_gettid
();
481
return
RTE_PER_LCORE
(_thread_id);
482
}
483
490
enum
rte_iova_mode
rte_eal_iova_mode
(
void
);
491
501
const
char
* __rte_experimental
502
rte_eal_mbuf_user_pool_ops
(
void
);
503
511
__rte_deprecated
512
const
char
*
513
rte_eal_mbuf_default_mempool_ops
(
void
);
514
515
#ifdef __cplusplus
516
}
517
#endif
518
519
#endif
/* _RTE_EAL_H_ */
Generated by
1.8.1.2