1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2019-2021 Broadcom
6 #ifndef _TF_TCAM_SHARED_H_
7 #define _TF_TCAM_SHARED_H_
13 * @page tcam_shared TCAM SHARED
15 * @ref tf_tcam_shared_bind
17 * @ref tf_tcam_shared_unbind
19 * @ref tf_tcam_shared_alloc
21 * @ref tf_tcam_shared_free
23 * @ref tf_tcam_shared_set
25 * @ref tf_tcam_shared_get
27 * @ref tf_tcam_shared_move_p4
29 * @ref tf_tcam_shared_move_p58
31 * @ref tf_tcam_shared_clear
35 * Initializes the TCAM shared module with the requested DBs. Must be
36 * invoked as the first thing before any of the access functions.
39 * Pointer to the truflow handle
42 * Pointer to parameters
45 * - (0) if successful.
46 * - (-EINVAL) on failure.
48 int tf_tcam_shared_bind(struct tf *tfp,
49 struct tf_tcam_cfg_parms *parms);
52 * Cleans up the private DBs and releases all the data.
55 * Pointer to the truflow handle
58 * Pointer to parameters
61 * - (0) if successful.
62 * - (-EINVAL) on failure.
64 int tf_tcam_shared_unbind(struct tf *tfp);
67 * Allocates the requested tcam type from the internal RM DB.
70 * Pointer to the truflow handle
73 * Pointer to parameters
76 * - (0) if successful.
77 * - (-EINVAL) on failure.
79 int tf_tcam_shared_alloc(struct tf *tfp,
80 struct tf_tcam_alloc_parms *parms);
83 * Free's the requested table type and returns it to the DB.
86 * Pointer to the truflow handle
89 * Pointer to parameters
92 * - (0) if successful.
93 * - (-EINVAL) on failure.
95 int tf_tcam_shared_free(struct tf *tfp,
96 struct tf_tcam_free_parms *parms);
99 * Configures the requested element by sending a firmware request which
100 * then installs it into the device internal structures.
103 * Pointer to the truflow handle
106 * Pointer to parameters
109 * - (0) if successful.
110 * - (-EINVAL) on failure.
112 int tf_tcam_shared_set(struct tf *tfp,
113 struct tf_tcam_set_parms *parms);
116 * Retrieves the requested element by sending a firmware request to get
120 * Pointer to the truflow handle
123 * Pointer to parameters
126 * - (0) if successful.
127 * - (-EINVAL) on failure.
129 int tf_tcam_shared_get(struct tf *tfp,
130 struct tf_tcam_get_parms *parms);
134 * Moves entries from the WC_TCAM_HI to the WC_TCAM_LO shared pools
138 * Pointer to the truflow handle
141 * Pointer to parameters
144 * - (0) if successful.
145 * - (-EINVAL) on failure.
147 int tf_tcam_shared_move_p4(struct tf *tfp,
148 struct tf_move_tcam_shared_entries_parms *parms);
151 * Moves entries from the WC_TCAM_HI to the WC_TCAM_LO shared pools
152 * for the P58 device.
155 * Pointer to the truflow handle
158 * Pointer to parameters
161 * - (0) if successful.
162 * - (-EINVAL) on failure.
164 int tf_tcam_shared_move_p58(struct tf *tfp,
165 struct tf_move_tcam_shared_entries_parms *parms);
168 * Allocates and clears the entire WC_TCAM_HI or WC_TCAM_LO shared pools
171 * Pointer to the truflow handle
174 * Pointer to parameters
177 * - (0) if successful.
178 * - (-EINVAL) on failure.
180 int tf_tcam_shared_clear(struct tf *tfp,
181 struct tf_clear_tcam_shared_entries_parms *parms);
183 #endif /* _TF_TCAM_SHARED_H */