eal: remove sys/queue.h from public headers
[dpdk.git] / drivers / net / bnxt / tf_core / tf_tcam_shared.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2019-2021 Broadcom
3  * All rights reserved.
4  */
5
6 #ifndef _TF_TCAM_SHARED_H_
7 #define _TF_TCAM_SHARED_H_
8
9 #include "tf_core.h"
10 #include "tf_tcam.h"
11
12 /**
13  * @page tcam_shared TCAM SHARED
14  *
15  * @ref tf_tcam_shared_bind
16  *
17  * @ref tf_tcam_shared_unbind
18  *
19  * @ref tf_tcam_shared_alloc
20  *
21  * @ref tf_tcam_shared_free
22  *
23  * @ref tf_tcam_shared_set
24  *
25  * @ref tf_tcam_shared_get
26  *
27  * @ref tf_tcam_shared_move_p4
28  *
29  * @ref tf_tcam_shared_move_p58
30  *
31  * @ref tf_tcam_shared_clear
32  */
33
34 /**
35  * Initializes the TCAM shared module with the requested DBs. Must be
36  * invoked as the first thing before any of the access functions.
37  *
38  * [in] tfp
39  *   Pointer to the truflow handle
40  *
41  * [in] parms
42  *   Pointer to parameters
43  *
44  * Returns
45  *   - (0) if successful.
46  *   - (-EINVAL) on failure.
47  */
48 int tf_tcam_shared_bind(struct tf *tfp,
49                         struct tf_tcam_cfg_parms *parms);
50
51 /**
52  * Cleans up the private DBs and releases all the data.
53  *
54  * [in] tfp
55  *   Pointer to the truflow handle
56  *
57  * [in] parms
58  *   Pointer to parameters
59  *
60  * Returns
61  *   - (0) if successful.
62  *   - (-EINVAL) on failure.
63  */
64 int tf_tcam_shared_unbind(struct tf *tfp);
65
66 /**
67  * Allocates the requested tcam type from the internal RM DB.
68  *
69  * [in] tfp
70  *   Pointer to the truflow handle
71  *
72  * [in] parms
73  *   Pointer to parameters
74  *
75  * Returns
76  *   - (0) if successful.
77  *   - (-EINVAL) on failure.
78  */
79 int tf_tcam_shared_alloc(struct tf *tfp,
80                          struct tf_tcam_alloc_parms *parms);
81
82 /**
83  * Free's the requested table type and returns it to the DB.
84  *
85  * [in] tfp
86  *   Pointer to the truflow handle
87  *
88  * [in] parms
89  *   Pointer to parameters
90  *
91  * Returns
92  *   - (0) if successful.
93  *   - (-EINVAL) on failure.
94  */
95 int tf_tcam_shared_free(struct tf *tfp,
96                         struct tf_tcam_free_parms *parms);
97
98 /**
99  * Configures the requested element by sending a firmware request which
100  * then installs it into the device internal structures.
101  *
102  * [in] tfp
103  *   Pointer to the truflow handle
104  *
105  * [in] parms
106  *   Pointer to parameters
107  *
108  * Returns
109  *   - (0) if successful.
110  *   - (-EINVAL) on failure.
111  */
112 int tf_tcam_shared_set(struct tf *tfp,
113                        struct tf_tcam_set_parms *parms);
114
115 /**
116  * Retrieves the requested element by sending a firmware request to get
117  * the element.
118  *
119  * [in] tfp
120  *   Pointer to the truflow handle
121  *
122  * [in] parms
123  *   Pointer to parameters
124  *
125  * Returns
126  *   - (0) if successful.
127  *   - (-EINVAL) on failure.
128  */
129 int tf_tcam_shared_get(struct tf *tfp,
130                        struct tf_tcam_get_parms *parms);
131
132
133 /**
134  * Moves entries from the WC_TCAM_HI to the WC_TCAM_LO shared pools
135  * for the P4 device.
136  *
137  * [in] tfp
138  *   Pointer to the truflow handle
139  *
140  * [in] parms
141  *   Pointer to parameters
142  *
143  * Returns
144  *   - (0) if successful.
145  *   - (-EINVAL) on failure.
146  */
147 int tf_tcam_shared_move_p4(struct tf *tfp,
148                            struct tf_move_tcam_shared_entries_parms *parms);
149
150 /**
151  * Moves entries from the WC_TCAM_HI to the WC_TCAM_LO shared pools
152  * for the P58 device.
153  *
154  * [in] tfp
155  *   Pointer to the truflow handle
156  *
157  * [in] parms
158  *   Pointer to parameters
159  *
160  * Returns
161  *   - (0) if successful.
162  *   - (-EINVAL) on failure.
163  */
164 int tf_tcam_shared_move_p58(struct tf *tfp,
165                             struct tf_move_tcam_shared_entries_parms *parms);
166
167 /**
168  * Allocates and clears the entire WC_TCAM_HI or WC_TCAM_LO shared pools
169  *
170  * [in] tfp
171  *   Pointer to the truflow handle
172  *
173  * [in] parms
174  *   Pointer to parameters
175  *
176  * Returns
177  *   - (0) if successful.
178  *   - (-EINVAL) on failure.
179  */
180 int tf_tcam_shared_clear(struct tf *tfp,
181                          struct tf_clear_tcam_shared_entries_parms *parms);
182
183 #endif /* _TF_TCAM_SHARED_H */