Lines Matching full:struct
15 struct mlxsw_sp_acl_tcam {
16 struct ida used_regions;
18 struct ida used_groups;
21 struct mutex lock; /* guards vregion list */
22 struct list_head vregion_list;
28 size_t mlxsw_sp_acl_tcam_priv_size(struct mlxsw_sp *mlxsw_sp);
29 int mlxsw_sp_acl_tcam_init(struct mlxsw_sp *mlxsw_sp,
30 struct mlxsw_sp_acl_tcam *tcam);
31 void mlxsw_sp_acl_tcam_fini(struct mlxsw_sp *mlxsw_sp,
32 struct mlxsw_sp_acl_tcam *tcam);
33 int mlxsw_sp_acl_tcam_priority_get(struct mlxsw_sp *mlxsw_sp,
34 struct mlxsw_sp_acl_rule_info *rulei,
37 struct mlxsw_sp_acl_profile_ops {
39 int (*ruleset_add)(struct mlxsw_sp *mlxsw_sp,
40 struct mlxsw_sp_acl_tcam *tcam, void *ruleset_priv,
41 struct mlxsw_afk_element_usage *tmplt_elusage,
43 void (*ruleset_del)(struct mlxsw_sp *mlxsw_sp, void *ruleset_priv);
44 int (*ruleset_bind)(struct mlxsw_sp *mlxsw_sp, void *ruleset_priv,
45 struct mlxsw_sp_port *mlxsw_sp_port,
47 void (*ruleset_unbind)(struct mlxsw_sp *mlxsw_sp, void *ruleset_priv,
48 struct mlxsw_sp_port *mlxsw_sp_port,
52 int (*rule_add)(struct mlxsw_sp *mlxsw_sp,
54 struct mlxsw_sp_acl_rule_info *rulei);
55 void (*rule_del)(struct mlxsw_sp *mlxsw_sp, void *rule_priv);
56 int (*rule_action_replace)(struct mlxsw_sp *mlxsw_sp, void *rule_priv,
57 struct mlxsw_sp_acl_rule_info *rulei);
58 int (*rule_activity_get)(struct mlxsw_sp *mlxsw_sp, void *rule_priv,
62 const struct mlxsw_sp_acl_profile_ops *
63 mlxsw_sp_acl_tcam_profile_ops(struct mlxsw_sp *mlxsw_sp,
74 struct mlxsw_sp_acl_tcam_group;
75 struct mlxsw_sp_acl_tcam_vregion;
77 struct mlxsw_sp_acl_tcam_region {
78 struct mlxsw_sp_acl_tcam_vregion *vregion;
79 struct mlxsw_sp_acl_tcam_group *group;
80 struct list_head list; /* Member of a TCAM group */
84 struct mlxsw_afk_key_info *key_info;
85 struct mlxsw_sp *mlxsw_sp;
90 struct mlxsw_sp_acl_ctcam_region {
91 struct parman *parman;
92 const struct mlxsw_sp_acl_ctcam_region_ops *ops;
93 struct mlxsw_sp_acl_tcam_region *region;
96 struct mlxsw_sp_acl_ctcam_chunk {
97 struct parman_prio parman_prio;
100 struct mlxsw_sp_acl_ctcam_entry {
101 struct parman_item parman_item;
104 struct mlxsw_sp_acl_ctcam_region_ops {
105 int (*entry_insert)(struct mlxsw_sp_acl_ctcam_region *cregion,
106 struct mlxsw_sp_acl_ctcam_entry *centry,
108 void (*entry_remove)(struct mlxsw_sp_acl_ctcam_region *cregion,
109 struct mlxsw_sp_acl_ctcam_entry *centry);
113 mlxsw_sp_acl_ctcam_region_init(struct mlxsw_sp *mlxsw_sp,
114 struct mlxsw_sp_acl_ctcam_region *cregion,
115 struct mlxsw_sp_acl_tcam_region *region,
116 const struct mlxsw_sp_acl_ctcam_region_ops *ops);
117 void mlxsw_sp_acl_ctcam_region_fini(struct mlxsw_sp_acl_ctcam_region *cregion);
118 void mlxsw_sp_acl_ctcam_chunk_init(struct mlxsw_sp_acl_ctcam_region *cregion,
119 struct mlxsw_sp_acl_ctcam_chunk *cchunk,
121 void mlxsw_sp_acl_ctcam_chunk_fini(struct mlxsw_sp_acl_ctcam_chunk *cchunk);
122 int mlxsw_sp_acl_ctcam_entry_add(struct mlxsw_sp *mlxsw_sp,
123 struct mlxsw_sp_acl_ctcam_region *cregion,
124 struct mlxsw_sp_acl_ctcam_chunk *cchunk,
125 struct mlxsw_sp_acl_ctcam_entry *centry,
126 struct mlxsw_sp_acl_rule_info *rulei,
128 void mlxsw_sp_acl_ctcam_entry_del(struct mlxsw_sp *mlxsw_sp,
129 struct mlxsw_sp_acl_ctcam_region *cregion,
130 struct mlxsw_sp_acl_ctcam_chunk *cchunk,
131 struct mlxsw_sp_acl_ctcam_entry *centry);
132 int mlxsw_sp_acl_ctcam_entry_action_replace(struct mlxsw_sp *mlxsw_sp,
133 struct mlxsw_sp_acl_ctcam_region *cregion,
134 struct mlxsw_sp_acl_ctcam_entry *centry,
135 struct mlxsw_sp_acl_rule_info *rulei);
137 mlxsw_sp_acl_ctcam_entry_offset(struct mlxsw_sp_acl_ctcam_entry *centry) in mlxsw_sp_acl_ctcam_entry_offset()
153 struct mlxsw_sp_acl_atcam {
154 struct mlxsw_sp_acl_erp_core *erp_core;
157 struct mlxsw_sp_acl_atcam_region {
158 struct rhashtable entries_ht; /* A-TCAM only */
159 struct list_head entries_list; /* A-TCAM only */
160 struct mlxsw_sp_acl_ctcam_region cregion;
161 const struct mlxsw_sp_acl_atcam_region_ops *ops;
162 struct mlxsw_sp_acl_tcam_region *region;
163 struct mlxsw_sp_acl_atcam *atcam;
165 struct mlxsw_sp_acl_erp_table *erp_table;
169 struct mlxsw_sp_acl_atcam_entry_ht_key {
176 struct mlxsw_sp_acl_atcam_chunk {
177 struct mlxsw_sp_acl_ctcam_chunk cchunk;
180 struct mlxsw_sp_acl_atcam_entry {
181 struct rhash_head ht_node;
182 struct list_head list; /* Member in entries_list */
183 struct mlxsw_sp_acl_atcam_entry_ht_key ht_key;
184 struct {
189 struct mlxsw_sp_acl_ctcam_entry centry;
190 struct mlxsw_sp_acl_atcam_lkey_id *lkey_id;
191 struct mlxsw_sp_acl_erp_mask *erp_mask;
194 static inline struct mlxsw_sp_acl_atcam_region *
195 mlxsw_sp_acl_tcam_cregion_aregion(struct mlxsw_sp_acl_ctcam_region *cregion) in mlxsw_sp_acl_tcam_cregion_aregion()
197 return container_of(cregion, struct mlxsw_sp_acl_atcam_region, cregion); in mlxsw_sp_acl_tcam_cregion_aregion()
200 static inline struct mlxsw_sp_acl_atcam_entry *
201 mlxsw_sp_acl_tcam_centry_aentry(struct mlxsw_sp_acl_ctcam_entry *centry) in mlxsw_sp_acl_tcam_centry_aentry()
203 return container_of(centry, struct mlxsw_sp_acl_atcam_entry, centry); in mlxsw_sp_acl_tcam_centry_aentry()
206 int mlxsw_sp_acl_atcam_region_associate(struct mlxsw_sp *mlxsw_sp,
209 mlxsw_sp_acl_atcam_region_init(struct mlxsw_sp *mlxsw_sp,
210 struct mlxsw_sp_acl_atcam *atcam,
211 struct mlxsw_sp_acl_atcam_region *aregion,
212 struct mlxsw_sp_acl_tcam_region *region,
214 const struct mlxsw_sp_acl_ctcam_region_ops *ops);
215 void mlxsw_sp_acl_atcam_region_fini(struct mlxsw_sp_acl_atcam_region *aregion);
216 void mlxsw_sp_acl_atcam_chunk_init(struct mlxsw_sp_acl_atcam_region *aregion,
217 struct mlxsw_sp_acl_atcam_chunk *achunk,
219 void mlxsw_sp_acl_atcam_chunk_fini(struct mlxsw_sp_acl_atcam_chunk *achunk);
220 int mlxsw_sp_acl_atcam_entry_add(struct mlxsw_sp *mlxsw_sp,
221 struct mlxsw_sp_acl_atcam_region *aregion,
222 struct mlxsw_sp_acl_atcam_chunk *achunk,
223 struct mlxsw_sp_acl_atcam_entry *aentry,
224 struct mlxsw_sp_acl_rule_info *rulei);
225 void mlxsw_sp_acl_atcam_entry_del(struct mlxsw_sp *mlxsw_sp,
226 struct mlxsw_sp_acl_atcam_region *aregion,
227 struct mlxsw_sp_acl_atcam_chunk *achunk,
228 struct mlxsw_sp_acl_atcam_entry *aentry);
229 int mlxsw_sp_acl_atcam_entry_action_replace(struct mlxsw_sp *mlxsw_sp,
230 struct mlxsw_sp_acl_atcam_region *aregion,
231 struct mlxsw_sp_acl_atcam_entry *aentry,
232 struct mlxsw_sp_acl_rule_info *rulei);
233 int mlxsw_sp_acl_atcam_init(struct mlxsw_sp *mlxsw_sp,
234 struct mlxsw_sp_acl_atcam *atcam);
235 void mlxsw_sp_acl_atcam_fini(struct mlxsw_sp *mlxsw_sp,
236 struct mlxsw_sp_acl_atcam *atcam);
238 mlxsw_sp_acl_atcam_rehash_hints_get(struct mlxsw_sp_acl_atcam_region *aregion);
241 struct mlxsw_sp_acl_erp_delta;
243 u16 mlxsw_sp_acl_erp_delta_start(const struct mlxsw_sp_acl_erp_delta *delta);
244 u8 mlxsw_sp_acl_erp_delta_mask(const struct mlxsw_sp_acl_erp_delta *delta);
245 u8 mlxsw_sp_acl_erp_delta_value(const struct mlxsw_sp_acl_erp_delta *delta,
247 void mlxsw_sp_acl_erp_delta_clear(const struct mlxsw_sp_acl_erp_delta *delta,
250 struct mlxsw_sp_acl_erp_mask;
253 mlxsw_sp_acl_erp_mask_is_ctcam(const struct mlxsw_sp_acl_erp_mask *erp_mask);
254 u8 mlxsw_sp_acl_erp_mask_erp_id(const struct mlxsw_sp_acl_erp_mask *erp_mask);
255 const struct mlxsw_sp_acl_erp_delta *
256 mlxsw_sp_acl_erp_delta(const struct mlxsw_sp_acl_erp_mask *erp_mask);
257 struct mlxsw_sp_acl_erp_mask *
258 mlxsw_sp_acl_erp_mask_get(struct mlxsw_sp_acl_atcam_region *aregion,
260 void mlxsw_sp_acl_erp_mask_put(struct mlxsw_sp_acl_atcam_region *aregion,
261 struct mlxsw_sp_acl_erp_mask *erp_mask);
262 int mlxsw_sp_acl_erp_bf_insert(struct mlxsw_sp *mlxsw_sp,
263 struct mlxsw_sp_acl_atcam_region *aregion,
264 struct mlxsw_sp_acl_erp_mask *erp_mask,
265 struct mlxsw_sp_acl_atcam_entry *aentry);
266 void mlxsw_sp_acl_erp_bf_remove(struct mlxsw_sp *mlxsw_sp,
267 struct mlxsw_sp_acl_atcam_region *aregion,
268 struct mlxsw_sp_acl_erp_mask *erp_mask,
269 struct mlxsw_sp_acl_atcam_entry *aentry);
271 mlxsw_sp_acl_erp_rehash_hints_get(struct mlxsw_sp_acl_atcam_region *aregion);
273 int mlxsw_sp_acl_erp_region_init(struct mlxsw_sp_acl_atcam_region *aregion,
275 void mlxsw_sp_acl_erp_region_fini(struct mlxsw_sp_acl_atcam_region *aregion);
276 int mlxsw_sp_acl_erps_init(struct mlxsw_sp *mlxsw_sp,
277 struct mlxsw_sp_acl_atcam *atcam);
278 void mlxsw_sp_acl_erps_fini(struct mlxsw_sp *mlxsw_sp,
279 struct mlxsw_sp_acl_atcam *atcam);
281 struct mlxsw_sp_acl_bf;
283 struct mlxsw_sp_acl_bf_ops {
284 unsigned int (*index_get)(struct mlxsw_sp_acl_bf *bf,
285 struct mlxsw_sp_acl_atcam_region *aregion,
286 struct mlxsw_sp_acl_atcam_entry *aentry);
290 mlxsw_sp_acl_bf_entry_add(struct mlxsw_sp *mlxsw_sp,
291 struct mlxsw_sp_acl_bf *bf,
292 struct mlxsw_sp_acl_atcam_region *aregion,
294 struct mlxsw_sp_acl_atcam_entry *aentry);
296 mlxsw_sp_acl_bf_entry_del(struct mlxsw_sp *mlxsw_sp,
297 struct mlxsw_sp_acl_bf *bf,
298 struct mlxsw_sp_acl_atcam_region *aregion,
300 struct mlxsw_sp_acl_atcam_entry *aentry);
301 struct mlxsw_sp_acl_bf *
302 mlxsw_sp_acl_bf_init(struct mlxsw_sp *mlxsw_sp, unsigned int num_erp_banks);
303 void mlxsw_sp_acl_bf_fini(struct mlxsw_sp_acl_bf *bf);