aboutsummaryrefslogtreecommitdiff
path: root/include/odp/api/config.h
blob: c9879d6d8b27014f269e77d3e135149f573034db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
/* Copyright (c) 2013, Linaro Limited
 * All rights reserved.
 *
 * SPDX-License-Identifier:     BSD-3-Clause
 */


/**
 * @file
 *
 * ODP configuration
 */

#ifndef ODP_API_CONFIG_H_
#define ODP_API_CONFIG_H_

#ifdef __cplusplus
extern "C" {
#endif

/** @defgroup odp_config ODP CONFIG
 *  Platform-specific configuration limits.
 *
 * @note The API calls defined for ODP configuration limits are the
 * normative means of accessing platform-specific configuration limits.
 * Platforms MAY in addition include \#defines for these limits for
 * internal use in dimensioning arrays, however there is no guarantee
 * that applications using such \#defines will be portable across all
 * ODP implementations. Applications SHOULD expect that over time such
 * \#defines will be deprecated and removed.
 *  @{
 */

/**
 * Maximum number of pools
 * @return The maximum number of pools supported by this platform
 */
int odp_config_pools(void);

/**
 * Maximum number of queues
 * @return The maximum number of queues supported by this platform
 */
int odp_config_queues(void);

/**
 * Maximum number of ordered locks per queue
 * @return The maximum number of ordered locks per queue supported by
 * this platform.
 */
int odp_config_max_ordered_locks_per_queue(void);

/**
 * Number of scheduling priorities
 * @return The number of scheduling priorities supported by this platform
 */
int odp_config_sched_prios(void);

/**
 * Number of scheduling groups
 * @return Number of scheduling groups supported by this platofmr
 */
int odp_config_sched_grps(void);

/**
 * Maximum number of packet IO resources
 * @return The maximum number of packet I/O resources supported by this
 * platform
 */
int odp_config_pktio_entries(void);

/**
 * Minimum buffer alignment
 *
 * @return The minimum buffer alignment supported by this platform
 * @note Requests for values below this will be rounded up to this value.
 */
int odp_config_buffer_align_min(void);

/**
 * Maximum buffer alignment
 *
 * This defines the maximum supported buffer alignment. Requests for values
 * above this will fail.
 *
 * @return The maximum buffer alignment supported by this platform.
 */
int odp_config_buffer_align_max(void);

/**
 * Default packet headroom
 *
 * This defines the minimum number of headroom bytes that newly created packets
 * have by default. The default apply to both ODP packet input and user
 * allocated packets. Implementations may reserve a larger than minimum headroom
 * size e.g. due to HW or a protocol specific alignment requirement.
 *
 * @return Default packet headroom in bytes
 */
int odp_config_packet_headroom(void);

/**
 * Default packet tailroom
 *
 * This defines the minimum number of tailroom bytes that newly created packets
 * have by default. The default apply to both ODP packet input and user
 * allocated packets. Implementations are free to add to this as desired
 * without restriction.
 *
 * @return The default packet tailroom in bytes
 */
int odp_config_packet_tailroom(void);

/**
 * Minimum packet segment length
 *
 * This defines the minimum packet segment buffer length in bytes. The user
 * defined segment length (seg_len in odp_pool_param_t) will be rounded up into
 * this value.
 *
 * @return The minimum packet seg_len supported by this platform
 */
int odp_config_packet_seg_len_min(void);

/**
 * Maximum packet segment length
 *
 * This defines the maximum packet segment buffer length in bytes. The user
 * defined segment length (seg_len in odp_pool_param_t) must not be larger than
 * this.
 *
 * @return The maximum packet seg_len supported by this platform
 */
int odp_config_packet_seg_len_max(void);

/**
 * Maximum packet buffer length
 *
 * This defines the maximum number of bytes that can be stored into a packet
 * (maximum return value of odp_packet_buf_len()). Attempts to allocate
 * (including default head- and tailrooms) or extend packets to sizes larger
 * than this limit will fail.
 *
 * @return The maximum packet buffer length supported by this platform
 */
int odp_config_packet_buf_len_max(void);

/** Maximum number of shared memory blocks.
 *
 * This the the number of separate SHM areas that can be reserved concurrently
 *
 * @return The maximum number of shm areas supported by this platform
 */
int odp_config_shm_blocks(void);

/**
 * @}
 */

#ifdef __cplusplus
}
#endif

#endif