DPDK 21.11.9
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_compat.h>
40#include <rte_rwlock.h>
41
42#define RTE_FBARRAY_NAME_LEN 64
43
44struct rte_fbarray {
45 char name[RTE_FBARRAY_NAME_LEN];
46 unsigned int count;
47 unsigned int len;
48 unsigned int elt_sz;
49 void *data;
50 rte_rwlock_t rwlock;
51};
52
77int
78rte_fbarray_init(struct rte_fbarray *arr, const char *name, unsigned int len,
79 unsigned int elt_sz);
80
81
99int
100rte_fbarray_attach(struct rte_fbarray *arr);
101
102
120int
121rte_fbarray_destroy(struct rte_fbarray *arr);
122
123
138int
139rte_fbarray_detach(struct rte_fbarray *arr);
140
141
155void *
156rte_fbarray_get(const struct rte_fbarray *arr, unsigned int idx);
157
158
172int
173rte_fbarray_find_idx(const struct rte_fbarray *arr, const void *elt);
174
175
189int
190rte_fbarray_set_used(struct rte_fbarray *arr, unsigned int idx);
191
192
206int
207rte_fbarray_set_free(struct rte_fbarray *arr, unsigned int idx);
208
209
224int
225rte_fbarray_is_used(struct rte_fbarray *arr, unsigned int idx);
226
227
241int
242rte_fbarray_find_next_free(struct rte_fbarray *arr, unsigned int start);
243
244
258int
259rte_fbarray_find_next_used(struct rte_fbarray *arr, unsigned int start);
260
261
278int
279rte_fbarray_find_next_n_free(struct rte_fbarray *arr, unsigned int start,
280 unsigned int n);
281
282
299int
300rte_fbarray_find_next_n_used(struct rte_fbarray *arr, unsigned int start,
301 unsigned int n);
302
303
317int
318rte_fbarray_find_contig_free(struct rte_fbarray *arr,
319 unsigned int start);
320
321
335int
336rte_fbarray_find_contig_used(struct rte_fbarray *arr, unsigned int start);
337
351int
352rte_fbarray_find_prev_free(struct rte_fbarray *arr, unsigned int start);
353
354
368int
369rte_fbarray_find_prev_used(struct rte_fbarray *arr, unsigned int start);
370
371
389int
390rte_fbarray_find_prev_n_free(struct rte_fbarray *arr, unsigned int start,
391 unsigned int n);
392
393
411int
412rte_fbarray_find_prev_n_used(struct rte_fbarray *arr, unsigned int start,
413 unsigned int n);
414
415
430int
431rte_fbarray_find_rev_contig_free(struct rte_fbarray *arr,
432 unsigned int start);
433
434
449int
450rte_fbarray_find_rev_contig_used(struct rte_fbarray *arr, unsigned int start);
451
452
466int
467rte_fbarray_find_biggest_free(struct rte_fbarray *arr, unsigned int start);
468
469
483int
484rte_fbarray_find_biggest_used(struct rte_fbarray *arr, unsigned int start);
485
486
501int
502rte_fbarray_find_rev_biggest_free(struct rte_fbarray *arr, unsigned int start);
503
504
519int
520rte_fbarray_find_rev_biggest_used(struct rte_fbarray *arr, unsigned int start);
521
522
532void
533rte_fbarray_dump_metadata(struct rte_fbarray *arr, FILE *f);
534
535#ifdef __cplusplus
536}
537#endif
538
539#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)