Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
mpipe_buffer_pool Struct Reference

Buffer pool structure. More...

#include <mpipe_buffer.h>

Data Fields

struct mpipe_buffer_pool_config req_config
 What this pool requires of its own accord, before any negotiation: the owner's hardware minimum, the application's request.
struct mpipe_buffer_pool_config config
 What the negotiation settled on, and what mpipe_buffer_pool::start allocates against.
struct net_buf_pool * nb_pool
 net_buf pool associated with the buffer pool
int(* configure )(struct mpipe_buffer_pool *pool, const struct mpipe_structure *config)
 Configure the pool with the given caps structure.
int(* set_config )(struct mpipe_buffer_pool *pool, const struct mpipe_buffer_pool_config *cfg)
 Apply a negotiated pool config.
int(* start )(struct mpipe_buffer_pool *pool)
 Start the pool and allocate resources.
int(* stop )(struct mpipe_buffer_pool *pool)
 Stop the pool and free resources.
int(* acquire_buffer )(struct mpipe_buffer_pool *pool, struct net_buf **buf)
 Acquire a buffer from the pool.
int(* release_buffer )(struct mpipe_buffer_pool *pool, struct net_buf *buf)
 Release a buffer back to the pool, automatically called when buffer refcount reaches 0.
bool started
 Flag indicating if the pool has been started.

Detailed Description

Buffer pool structure.

Field Documentation

◆ acquire_buffer

int(* mpipe_buffer_pool::acquire_buffer) (struct mpipe_buffer_pool *pool, struct net_buf **buf)

Acquire a buffer from the pool.

◆ config

struct mpipe_buffer_pool_config mpipe_buffer_pool::config

What the negotiation settled on, and what mpipe_buffer_pool::start allocates against.

Starts each run as a copy of req_config - mpipe_buffer_pool_stop restores it - so a run never inherits the demands of the one before it.

◆ configure

int(* mpipe_buffer_pool::configure) (struct mpipe_buffer_pool *pool, const struct mpipe_structure *config)

Configure the pool with the given caps structure.

◆ nb_pool

struct net_buf_pool* mpipe_buffer_pool::nb_pool

net_buf pool associated with the buffer pool

◆ release_buffer

int(* mpipe_buffer_pool::release_buffer) (struct mpipe_buffer_pool *pool, struct net_buf *buf)

Release a buffer back to the pool, automatically called when buffer refcount reaches 0.

◆ req_config

struct mpipe_buffer_pool_config mpipe_buffer_pool::req_config

What this pool requires of its own accord, before any negotiation: the owner's hardware minimum, the application's request.

Written once at setup with mpipe_buffer_pool_set_req_config and never by a negotiation, so it stays the floor every run starts from.

◆ set_config

int(* mpipe_buffer_pool::set_config) (struct mpipe_buffer_pool *pool, const struct mpipe_buffer_pool_config *cfg)

Apply a negotiated pool config.

The implementation validates cfg against what the pool can provide, writes the accepted values into mpipe_buffer_pool::config itself, and returns a negative errno to refuse (e.g. -ENOTSUP for an alignment the backing allocator cannot honor, -ENOSPC for a buffer count beyond the pool capacity).

◆ start

int(* mpipe_buffer_pool::start) (struct mpipe_buffer_pool *pool)

Start the pool and allocate resources.

◆ started

bool mpipe_buffer_pool::started

Flag indicating if the pool has been started.

◆ stop

int(* mpipe_buffer_pool::stop) (struct mpipe_buffer_pool *pool)

Stop the pool and free resources.


The documentation for this struct was generated from the following file: