1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright (c) 2020 Arm Limited
5 #ifndef _RTE_RCU_QSBR_PVT_H_
6 #define _RTE_RCU_QSBR_PVT_H_
9 * This file is private to the RCU library. It should not be included
10 * by the user of this library.
14 #include <rte_ring_elem.h>
16 #include "rte_rcu_qsbr.h"
18 /* Defer queue structure.
19 * This structure holds the defer queue. The defer queue is used to
20 * hold the deleted entries from the data structure that are not
23 struct rte_rcu_qsbr_dq {
24 struct rte_rcu_qsbr *v; /**< RCU QSBR variable used by this queue.*/
25 struct rte_ring *r; /**< RCU QSBR defer queue. */
27 /**< Number of elements in the defer queue */
29 /**< Size (in bytes) of data, including the token, stored on the
32 uint32_t trigger_reclaim_limit;
33 /**< Trigger automatic reclamation after the defer queue
34 * has at least these many resources waiting.
36 uint32_t max_reclaim_size;
37 /**< Reclaim at the max these many resources during auto
40 rte_rcu_qsbr_free_resource_t free_fn;
41 /**< Function to call to free the resource. */
43 /**< Pointer passed to the free function. Typically, this is the
44 * pointer to the data structure to which the resource to free
49 /* Internal structure to represent the element on the defer queue.
50 * Use alias as a character array is type casted to a variable
51 * of this structure type.
54 uint64_t token; /**< Token */
55 uint8_t elem[0]; /**< Pointer to user element */
56 } __attribute__((__may_alias__)) __rte_rcu_qsbr_dq_elem_t;
58 #endif /* _RTE_RCU_QSBR_PVT_H_ */