Buffer event metadata and operations.
◆ ODP_BUFFER_INVALID
◆ odp_buffer_t
◆ odp_buffer_from_event()
◆ odp_buffer_from_event_multi()
Convert multiple buffer events to buffer handles.
All events must be of type ODP_EVENT_BUFFER.
- Parameters
-
| [out] | buf | Buffer handle array for output |
| ev | Array of event handles to convert |
| num | Number of buffers and events |
- Examples
- odp_bench_buffer.c.
◆ odp_buffer_to_event()
◆ odp_buffer_to_event_multi()
Convert multiple buffer handles to events.
- Parameters
-
| buf | Array of buffer handles to convert |
| [out] | ev | Event handle array for output |
| num | Number of buffers and events |
- Examples
- odp_bench_buffer.c.
◆ odp_buffer_addr()
◆ odp_buffer_from_addr()
Convert buffer start address to handle.
Converts a buffer start address (from a previous odp_buffer_addr() call) to a buffer handle. This allows an application to save memory as it can store only buffer addresses (instead of addresses and handles) and convert those to handles when needed.
This call can be used only for buffers of an external memory pool (see odp_pool_ext_create()).
- Parameters
-
| pool | Pool the buffer originates from |
| addr | Buffer start address |
- Returns
- Buffer handle on success
- Return values
-
| ODP_BUFFER_INVALID | on failure |
◆ odp_buffer_size()
◆ odp_buffer_user_area()
Buffer user area.
Returns pointer to the user area associated with the buffer. Size of the area is fixed and defined in buffer pool parameters.
- Parameters
-
- Returns
- Pointer to the user area of the buffer
- Return values
-
| NULL | The buffer does not have user area |
- Examples
- odp_bench_buffer.c, and odp_pool_latency.c.
◆ odp_buffer_is_valid()
Check that buffer is valid.
This function can be used for debugging purposes to check if a buffer handle represents a valid buffer. The level of error checks depends on the implementation. The call should not crash if the buffer handle is corrupted.
- Parameters
-
- Return values
-
| 1 | Buffer handle represents a valid buffer. |
| 0 | Buffer handle does not represent a valid buffer. |
- Examples
- odp_bench_buffer.c, and odp_sched_latency.c.
◆ odp_buffer_pool()
Buffer pool of the buffer.
- Parameters
-
- Returns
- Handle of buffer pool buffer belongs to
- Examples
- odp_bench_buffer.c.
◆ odp_buffer_alloc()
Buffer alloc.
Allocates a buffer from the pool. Returns ODP_BUFFER_INVALID when a buffer can not be allocated.
- Parameters
-
- Returns
- Handle of allocated buffer
- Return values
-
| ODP_BUFFER_INVALID | Buffer could not be allocated |
- Examples
- ipsec_api/odp_ipsec.c, ipsec_crypto/odp_ipsec.c, odp_bench_buffer.c, odp_bench_packet.c, odp_bench_queue.c, odp_debug.c, odp_dmafwd.c, odp_pool_perf.c, odp_queue_perf.c, odp_sched_latency.c, and odp_sched_perf.c.
◆ odp_buffer_alloc_multi()
◆ odp_buffer_free()
◆ odp_buffer_free_multi()
| void odp_buffer_free_multi |
( |
const odp_buffer_t |
buf[], |
|
|
int |
num |
|
) |
| |
◆ odp_buffer_print()
Print buffer debug information.
Print implementation specific debug information about the buffer to the ODP log.
- Parameters
-
- Examples
- odp_debug.c.
◆ odp_buffer_to_u64()
Get printable value for an odp_buffer_t.
- Parameters
-
| hdl | odp_buffer_t handle to be printed |
- Returns
- uint64_t value that can be used to print/display this handle
- Note
- This routine is intended to be used for diagnostic purposes to enable applications to generate a printable value that represents an odp_buffer_t handle.