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.
18 #include <rte_ring_elem.h>
20 #include "rte_rcu_qsbr.h"
22 /* Defer queue structure.
23 * This structure holds the defer queue. The defer queue is used to
24 * hold the deleted entries from the data structure that are not
27 struct rte_rcu_qsbr_dq {
28 struct rte_rcu_qsbr *v; /**< RCU QSBR variable used by this queue.*/
29 struct rte_ring *r; /**< RCU QSBR defer queue. */
31 /**< Number of elements in the defer queue */
33 /**< Size (in bytes) of data, including the token, stored on the
36 uint32_t trigger_reclaim_limit;
37 /**< Trigger automatic reclamation after the defer queue
38 * has at least these many resources waiting.
40 uint32_t max_reclaim_size;
41 /**< Reclaim at the max these many resources during auto
44 rte_rcu_qsbr_free_resource_t free_fn;
45 /**< Function to call to free the resource. */
47 /**< Pointer passed to the free function. Typically, this is the
48 * pointer to the data structure to which the resource to free
53 /* Internal structure to represent the element on the defer queue.
54 * Use alias as a character array is type casted to a variable
55 * of this structure type.
58 uint64_t token; /**< Token */
59 uint8_t elem[0]; /**< Pointer to user element */
60 } __attribute__((__may_alias__)) __rte_rcu_qsbr_dq_elem_t;
66 #endif /* _RTE_RCU_QSBR_PVT_H_ */