| rte_fbarray.h(3) | Library Functions Manual | rte_fbarray.h(3) |
rte_fbarray.h
#include <stdio.h>
#include <rte_rwlock.h>
int rte_fbarray_init (struct rte_fbarray *arr, const char
*name, unsigned int len, unsigned int elt_sz)
int rte_fbarray_attach (struct rte_fbarray *arr)
int rte_fbarray_destroy (struct rte_fbarray *arr)
int rte_fbarray_detach (struct rte_fbarray *arr)
void * rte_fbarray_get (const struct rte_fbarray *arr, unsigned int
idx)
int rte_fbarray_find_idx (const struct rte_fbarray *arr, const void
*elt)
int rte_fbarray_set_used (struct rte_fbarray *arr, unsigned int idx)
int rte_fbarray_set_free (struct rte_fbarray *arr, unsigned int idx)
int rte_fbarray_is_used (struct rte_fbarray *arr, unsigned int idx)
int rte_fbarray_find_next_free (struct rte_fbarray *arr, unsigned int
start)
int rte_fbarray_find_next_used (struct rte_fbarray *arr, unsigned int
start)
int rte_fbarray_find_next_n_free (struct rte_fbarray *arr, unsigned int
start, unsigned int n)
int rte_fbarray_find_next_n_used (struct rte_fbarray *arr, unsigned int
start, unsigned int n)
int rte_fbarray_find_contig_free (struct rte_fbarray *arr, unsigned int
start)
int rte_fbarray_find_contig_used (struct rte_fbarray *arr, unsigned int
start)
int rte_fbarray_find_prev_free (struct rte_fbarray *arr, unsigned int
start)
int rte_fbarray_find_prev_used (struct rte_fbarray *arr, unsigned int
start)
int rte_fbarray_find_prev_n_free (struct rte_fbarray *arr, unsigned int
start, unsigned int n)
int rte_fbarray_find_prev_n_used (struct rte_fbarray *arr, unsigned int
start, unsigned int n)
int rte_fbarray_find_rev_contig_free (struct rte_fbarray *arr, unsigned
int start)
int rte_fbarray_find_rev_contig_used (struct rte_fbarray *arr, unsigned
int start)
int rte_fbarray_find_biggest_free (struct rte_fbarray *arr, unsigned
int start)
int rte_fbarray_find_biggest_used (struct rte_fbarray *arr, unsigned
int start)
int rte_fbarray_find_rev_biggest_free (struct rte_fbarray *arr,
unsigned int start)
int rte_fbarray_find_rev_biggest_used (struct rte_fbarray *arr,
unsigned int start)
void rte_fbarray_dump_metadata (struct rte_fbarray *arr, FILE *f)
File-backed shared indexed array for DPDK.
Basic workflow is expected to be the following: 1) Allocate array either using rte_fbarray_init() or rte_fbarray_attach() (depending on whether it's shared between multiple DPDK processes) 2) find free spots using rte_fbarray_find_next_free() 3) get pointer to data in the free spot using rte_fbarray_get(), and copy data into the pointer (element size is fixed) 4) mark entry as used using rte_fbarray_set_used()
Calls to rte_fbarray_init() and rte_fbarray_destroy() will have consequences for all processes, while calls to rte_fbarray_attach() and rte_fbarray_detach() will only have consequences within a single process. Therefore, it is safe to call rte_fbarray_attach() or rte_fbarray_detach() while another process is using rte_fbarray, provided no other thread within the same process will try to use rte_fbarray before attaching or after detaching. It is not safe to call rte_fbarray_init() or rte_fbarray_destroy() while another thread or another process is using rte_fbarray.
Definition in file rte_fbarray.h.
Set up rte_fbarray structure and allocate underlying resources.
Call this function to correctly set up rte_fbarray and allocate underlying files that will be backing the data in the current process. Note that in order to use and share rte_fbarray between multiple processes, data pointed to by arr pointer must itself be allocated in shared memory.
Parameters
Returns
Attach to a file backing an already allocated and correctly set up rte_fbarray structure.
Call this function to attach to file that will be backing the data in the current process. The structure must have been previously correctly set up with a call to rte_fbarray_init(). Calls to rte_fbarray_attach() are usually meant to be performed in a multiprocessing scenario, with data pointed to by arr pointer allocated in shared memory.
Parameters
Returns
Deallocate resources for an already allocated and correctly set up rte_fbarray structure, and remove the underlying file.
Call this function to deallocate all resources associated with an rte_fbarray structure within the current process. This will also zero-fill data pointed to by arr pointer and remove the underlying file backing the data, so it is expected that by the time this function is called, all other processes have detached from this rte_fbarray.
Parameters
Returns
Deallocate resources for an already allocated and correctly set up rte_fbarray structure.
Call this function to deallocate all resources associated with an rte_fbarray structure within current process.
Parameters
Returns
Get pointer to element residing at specified index.
Parameters
Returns
Find index of a specified element within the array.
Parameters
Returns
Mark specified element as used.
Parameters
Returns
Mark specified element as free.
Parameters
Returns
Check whether element at specified index is marked as used.
Parameters
Returns
Find index of next free element, starting at specified index.
Parameters
Returns
Find index of next used element, starting at specified index.
Parameters
Returns
Find index of next chunk of n free elements, starting at specified index.
Parameters
Returns
Find index of next chunk of n used elements, starting at specified index.
Parameters
Returns
Find how many more free entries there are, starting at specified index.
Parameters
Returns
Find how many more used entries there are, starting at specified index.
Parameters
Returns
Find index of previous free element, starting at specified index.
Parameters
Returns
Find index of previous used element, starting at specified index.
Parameters
Returns
Find lowest start index of chunk of n free elements, down from specified index.
Parameters
Returns
Find lowest start index of chunk of n used elements, down from specified index.
Parameters
Returns
Find how many more free entries there are before specified index (like rte_fbarray_find_contig_free but going in reverse).
Parameters
Returns
Find how many more used entries there are before specified index (like rte_fbarray_find_contig_used but going in reverse).
Parameters
Returns
Find index of biggest chunk of free elements, starting at specified index.
Parameters
Returns
Find index of biggest chunk of used elements, starting at specified index.
Parameters
Returns
Find index of biggest chunk of free elements before a specified index (like rte_fbarray_find_biggest_free, but going in reverse).
Parameters
Returns
Find index of biggest chunk of used elements before a specified index (like rte_fbarray_find_biggest_used, but going in reverse).
Parameters
Returns
Dump rte_fbarray metadata.
Parameters
Generated automatically by Doxygen for DPDK from the source code.
| Version 24.11.3 | DPDK |