DPDK 22.11.7
rte_fbarray.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2017-2018 Intel Corporation
3 */
4
5#ifndef RTE_FBARRAY_H
6#define RTE_FBARRAY_H
7
33#ifdef __cplusplus
34extern "C" {
35#endif
36
37#include <stdio.h>
38
39#include <rte_rwlock.h>
40
41#define RTE_FBARRAY_NAME_LEN 64
42
43struct rte_fbarray {
44 char name[RTE_FBARRAY_NAME_LEN];
45 unsigned int count;
46 unsigned int len;
47 unsigned int elt_sz;
48 void *data;
49 rte_rwlock_t rwlock;
50};
51
76int
77rte_fbarray_init(struct rte_fbarray *arr, const char *name, unsigned int len,
78 unsigned int elt_sz);
79
80
98int
99rte_fbarray_attach(struct rte_fbarray *arr);
100
101
119int
120rte_fbarray_destroy(struct rte_fbarray *arr);
121
122
137int
138rte_fbarray_detach(struct rte_fbarray *arr);
139
140
154void *
155rte_fbarray_get(const struct rte_fbarray *arr, unsigned int idx);
156
157
171int
172rte_fbarray_find_idx(const struct rte_fbarray *arr, const void *elt);
173
174
188int
189rte_fbarray_set_used(struct rte_fbarray *arr, unsigned int idx);
190
191
205int
206rte_fbarray_set_free(struct rte_fbarray *arr, unsigned int idx);
207
208
223int
224rte_fbarray_is_used(struct rte_fbarray *arr, unsigned int idx);
225
226
240int
241rte_fbarray_find_next_free(struct rte_fbarray *arr, unsigned int start);
242
243
257int
258rte_fbarray_find_next_used(struct rte_fbarray *arr, unsigned int start);
259
260
277int
278rte_fbarray_find_next_n_free(struct rte_fbarray *arr, unsigned int start,
279 unsigned int n);
280
281
298int
299rte_fbarray_find_next_n_used(struct rte_fbarray *arr, unsigned int start,
300 unsigned int n);
301
302
316int
317rte_fbarray_find_contig_free(struct rte_fbarray *arr,
318 unsigned int start);
319
320
334int
335rte_fbarray_find_contig_used(struct rte_fbarray *arr, unsigned int start);
336
350int
351rte_fbarray_find_prev_free(struct rte_fbarray *arr, unsigned int start);
352
353
367int
368rte_fbarray_find_prev_used(struct rte_fbarray *arr, unsigned int start);
369
370
388int
389rte_fbarray_find_prev_n_free(struct rte_fbarray *arr, unsigned int start,
390 unsigned int n);
391
392
410int
411rte_fbarray_find_prev_n_used(struct rte_fbarray *arr, unsigned int start,
412 unsigned int n);
413
414
429int
430rte_fbarray_find_rev_contig_free(struct rte_fbarray *arr,
431 unsigned int start);
432
433
448int
449rte_fbarray_find_rev_contig_used(struct rte_fbarray *arr, unsigned int start);
450
451
465int
466rte_fbarray_find_biggest_free(struct rte_fbarray *arr, unsigned int start);
467
468
482int
483rte_fbarray_find_biggest_used(struct rte_fbarray *arr, unsigned int start);
484
485
500int
501rte_fbarray_find_rev_biggest_free(struct rte_fbarray *arr, unsigned int start);
502
503
518int
519rte_fbarray_find_rev_biggest_used(struct rte_fbarray *arr, unsigned int start);
520
521
531void
532rte_fbarray_dump_metadata(struct rte_fbarray *arr, FILE *f);
533
534#ifdef __cplusplus
535}
536#endif
537
538#endif /* RTE_FBARRAY_H */
int rte_fbarray_detach(struct rte_fbarray *arr)
int rte_fbarray_find_contig_free(struct rte_fbarray *arr, unsigned int start)
void * rte_fbarray_get(const struct rte_fbarray *arr, unsigned int idx)
int rte_fbarray_destroy(struct rte_fbarray *arr)
int rte_fbarray_init(struct rte_fbarray *arr, const char *name, unsigned int len, unsigned int elt_sz)
int rte_fbarray_set_used(struct rte_fbarray *arr, unsigned int idx)
int rte_fbarray_find_next_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_set_free(struct rte_fbarray *arr, unsigned int idx)
int rte_fbarray_find_next_used(struct rte_fbarray *arr, unsigned int start)
int rte_fbarray_find_next_free(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_contig_free(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_next_n_used(struct rte_fbarray *arr, unsigned int start, unsigned int n)
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)
void rte_fbarray_dump_metadata(struct rte_fbarray *arr, FILE *f)
int rte_fbarray_find_prev_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_biggest_used(struct rte_fbarray *arr, unsigned int start)
int rte_fbarray_find_contig_used(struct rte_fbarray *arr, unsigned int start)
int rte_fbarray_is_used(struct rte_fbarray *arr, unsigned int idx)
int rte_fbarray_find_rev_biggest_used(struct rte_fbarray *arr, unsigned int start)
int rte_fbarray_find_idx(const struct rte_fbarray *arr, const void *elt)
int rte_fbarray_attach(struct rte_fbarray *arr)