Lines Matching full:struct

14 struct mlxsw_sp_acl_tcam {
20 struct mutex lock; /* guards vregion list */
21 struct list_head vregion_list;
27 size_t mlxsw_sp_acl_tcam_priv_size(struct mlxsw_sp *mlxsw_sp);
28 int mlxsw_sp_acl_tcam_init(struct mlxsw_sp *mlxsw_sp,
29 struct mlxsw_sp_acl_tcam *tcam);
30 void mlxsw_sp_acl_tcam_fini(struct mlxsw_sp *mlxsw_sp,
31 struct mlxsw_sp_acl_tcam *tcam);
32 int mlxsw_sp_acl_tcam_priority_get(struct mlxsw_sp *mlxsw_sp,
33 struct mlxsw_sp_acl_rule_info *rulei,
36 struct mlxsw_sp_acl_profile_ops {
38 int (*ruleset_add)(struct mlxsw_sp *mlxsw_sp,
39 struct mlxsw_sp_acl_tcam *tcam, void *ruleset_priv,
40 struct mlxsw_afk_element_usage *tmplt_elusage,
42 void (*ruleset_del)(struct mlxsw_sp *mlxsw_sp, void *ruleset_priv);
43 int (*ruleset_bind)(struct mlxsw_sp *mlxsw_sp, void *ruleset_priv,
44 struct mlxsw_sp_port *mlxsw_sp_port,
46 void (*ruleset_unbind)(struct mlxsw_sp *mlxsw_sp, void *ruleset_priv,
47 struct mlxsw_sp_port *mlxsw_sp_port,
51 int (*rule_add)(struct mlxsw_sp *mlxsw_sp,
53 struct mlxsw_sp_acl_rule_info *rulei);
54 void (*rule_del)(struct mlxsw_sp *mlxsw_sp, void *rule_priv);
55 int (*rule_action_replace)(struct mlxsw_sp *mlxsw_sp, void *rule_priv,
56 struct mlxsw_sp_acl_rule_info *rulei);
57 int (*rule_activity_get)(struct mlxsw_sp *mlxsw_sp, void *rule_priv,
61 const struct mlxsw_sp_acl_profile_ops *
62 mlxsw_sp_acl_tcam_profile_ops(struct mlxsw_sp *mlxsw_sp,
73 struct mlxsw_sp_acl_tcam_group;
74 struct mlxsw_sp_acl_tcam_vregion;
76 struct mlxsw_sp_acl_tcam_region {
77 struct mlxsw_sp_acl_tcam_vregion *vregion;
78 struct mlxsw_sp_acl_tcam_group *group;
79 struct list_head list; /* Member of a TCAM group */
83 struct mlxsw_afk_key_info *key_info;
84 struct mlxsw_sp *mlxsw_sp;
89 struct mlxsw_sp_acl_ctcam_region {
90 struct parman *parman;
91 const struct mlxsw_sp_acl_ctcam_region_ops *ops;
92 struct mlxsw_sp_acl_tcam_region *region;
95 struct mlxsw_sp_acl_ctcam_chunk {
96 struct parman_prio parman_prio;
99 struct mlxsw_sp_acl_ctcam_entry {
100 struct parman_item parman_item;
103 struct mlxsw_sp_acl_ctcam_region_ops {
104 int (*entry_insert)(struct mlxsw_sp_acl_ctcam_region *cregion,
105 struct mlxsw_sp_acl_ctcam_entry *centry,
107 void (*entry_remove)(struct mlxsw_sp_acl_ctcam_region *cregion,
108 struct mlxsw_sp_acl_ctcam_entry *centry);
112 mlxsw_sp_acl_ctcam_region_init(struct mlxsw_sp *mlxsw_sp,
113 struct mlxsw_sp_acl_ctcam_region *cregion,
114 struct mlxsw_sp_acl_tcam_region *region,
115 const struct mlxsw_sp_acl_ctcam_region_ops *ops);
116 void mlxsw_sp_acl_ctcam_region_fini(struct mlxsw_sp_acl_ctcam_region *cregion);
117 void mlxsw_sp_acl_ctcam_chunk_init(struct mlxsw_sp_acl_ctcam_region *cregion,
118 struct mlxsw_sp_acl_ctcam_chunk *cchunk,
120 void mlxsw_sp_acl_ctcam_chunk_fini(struct mlxsw_sp_acl_ctcam_chunk *cchunk);
121 int mlxsw_sp_acl_ctcam_entry_add(struct mlxsw_sp *mlxsw_sp,
122 struct mlxsw_sp_acl_ctcam_region *cregion,
123 struct mlxsw_sp_acl_ctcam_chunk *cchunk,
124 struct mlxsw_sp_acl_ctcam_entry *centry,
125 struct mlxsw_sp_acl_rule_info *rulei,
127 void mlxsw_sp_acl_ctcam_entry_del(struct mlxsw_sp *mlxsw_sp,
128 struct mlxsw_sp_acl_ctcam_region *cregion,
129 struct mlxsw_sp_acl_ctcam_chunk *cchunk,
130 struct mlxsw_sp_acl_ctcam_entry *centry);
131 int mlxsw_sp_acl_ctcam_entry_action_replace(struct mlxsw_sp *mlxsw_sp,
132 struct mlxsw_sp_acl_ctcam_region *cregion,
133 struct mlxsw_sp_acl_ctcam_entry *centry,
134 struct mlxsw_sp_acl_rule_info *rulei);
136 mlxsw_sp_acl_ctcam_entry_offset(struct mlxsw_sp_acl_ctcam_entry *centry) in mlxsw_sp_acl_ctcam_entry_offset()
152 struct mlxsw_sp_acl_atcam {
153 struct mlxsw_sp_acl_erp_core *erp_core;
156 struct mlxsw_sp_acl_atcam_region {
157 struct rhashtable entries_ht; /* A-TCAM only */
158 struct list_head entries_list; /* A-TCAM only */
159 struct mlxsw_sp_acl_ctcam_region cregion;
160 const struct mlxsw_sp_acl_atcam_region_ops *ops;
161 struct mlxsw_sp_acl_tcam_region *region;
162 struct mlxsw_sp_acl_atcam *atcam;
164 struct mlxsw_sp_acl_erp_table *erp_table;
168 struct mlxsw_sp_acl_atcam_entry_ht_key {
175 struct mlxsw_sp_acl_atcam_chunk {
176 struct mlxsw_sp_acl_ctcam_chunk cchunk;
179 struct mlxsw_sp_acl_atcam_entry {
180 struct rhash_head ht_node;
181 struct list_head list; /* Member in entries_list */
182 struct mlxsw_sp_acl_atcam_entry_ht_key ht_key;
186 struct {
191 struct mlxsw_sp_acl_ctcam_entry centry;
192 struct mlxsw_sp_acl_atcam_lkey_id *lkey_id;
193 struct mlxsw_sp_acl_erp_mask *erp_mask;
196 static inline struct mlxsw_sp_acl_atcam_region *
197 mlxsw_sp_acl_tcam_cregion_aregion(struct mlxsw_sp_acl_ctcam_region *cregion) in mlxsw_sp_acl_tcam_cregion_aregion()
199 return container_of(cregion, struct mlxsw_sp_acl_atcam_region, cregion); in mlxsw_sp_acl_tcam_cregion_aregion()
202 static inline struct mlxsw_sp_acl_atcam_entry *
203 mlxsw_sp_acl_tcam_centry_aentry(struct mlxsw_sp_acl_ctcam_entry *centry) in mlxsw_sp_acl_tcam_centry_aentry()
205 return container_of(centry, struct mlxsw_sp_acl_atcam_entry, centry); in mlxsw_sp_acl_tcam_centry_aentry()
208 int mlxsw_sp_acl_atcam_region_associate(struct mlxsw_sp *mlxsw_sp,
211 mlxsw_sp_acl_atcam_region_init(struct mlxsw_sp *mlxsw_sp,
212 struct mlxsw_sp_acl_atcam *atcam,
213 struct mlxsw_sp_acl_atcam_region *aregion,
214 struct mlxsw_sp_acl_tcam_region *region,
216 const struct mlxsw_sp_acl_ctcam_region_ops *ops);
217 void mlxsw_sp_acl_atcam_region_fini(struct mlxsw_sp_acl_atcam_region *aregion);
218 void mlxsw_sp_acl_atcam_chunk_init(struct mlxsw_sp_acl_atcam_region *aregion,
219 struct mlxsw_sp_acl_atcam_chunk *achunk,
221 void mlxsw_sp_acl_atcam_chunk_fini(struct mlxsw_sp_acl_atcam_chunk *achunk);
222 int mlxsw_sp_acl_atcam_entry_add(struct mlxsw_sp *mlxsw_sp,
223 struct mlxsw_sp_acl_atcam_region *aregion,
224 struct mlxsw_sp_acl_atcam_chunk *achunk,
225 struct mlxsw_sp_acl_atcam_entry *aentry,
226 struct mlxsw_sp_acl_rule_info *rulei);
227 void mlxsw_sp_acl_atcam_entry_del(struct mlxsw_sp *mlxsw_sp,
228 struct mlxsw_sp_acl_atcam_region *aregion,
229 struct mlxsw_sp_acl_atcam_chunk *achunk,
230 struct mlxsw_sp_acl_atcam_entry *aentry);
231 int mlxsw_sp_acl_atcam_entry_action_replace(struct mlxsw_sp *mlxsw_sp,
232 struct mlxsw_sp_acl_atcam_region *aregion,
233 struct mlxsw_sp_acl_atcam_entry *aentry,
234 struct mlxsw_sp_acl_rule_info *rulei);
235 int mlxsw_sp_acl_atcam_init(struct mlxsw_sp *mlxsw_sp,
236 struct mlxsw_sp_acl_atcam *atcam);
237 void mlxsw_sp_acl_atcam_fini(struct mlxsw_sp *mlxsw_sp,
238 struct mlxsw_sp_acl_atcam *atcam);
240 mlxsw_sp_acl_atcam_rehash_hints_get(struct mlxsw_sp_acl_atcam_region *aregion);
243 struct mlxsw_sp_acl_erp_delta;
245 u16 mlxsw_sp_acl_erp_delta_start(const struct mlxsw_sp_acl_erp_delta *delta);
246 u8 mlxsw_sp_acl_erp_delta_mask(const struct mlxsw_sp_acl_erp_delta *delta);
247 u8 mlxsw_sp_acl_erp_delta_value(const struct mlxsw_sp_acl_erp_delta *delta,
249 void mlxsw_sp_acl_erp_delta_clear(const struct mlxsw_sp_acl_erp_delta *delta,
252 struct mlxsw_sp_acl_erp_mask;
255 mlxsw_sp_acl_erp_mask_is_ctcam(const struct mlxsw_sp_acl_erp_mask *erp_mask);
256 u8 mlxsw_sp_acl_erp_mask_erp_id(const struct mlxsw_sp_acl_erp_mask *erp_mask);
257 const struct mlxsw_sp_acl_erp_delta *
258 mlxsw_sp_acl_erp_delta(const struct mlxsw_sp_acl_erp_mask *erp_mask);
259 struct mlxsw_sp_acl_erp_mask *
260 mlxsw_sp_acl_erp_mask_get(struct mlxsw_sp_acl_atcam_region *aregion,
262 void mlxsw_sp_acl_erp_mask_put(struct mlxsw_sp_acl_atcam_region *aregion,
263 struct mlxsw_sp_acl_erp_mask *erp_mask);
264 int mlxsw_sp_acl_erp_bf_insert(struct mlxsw_sp *mlxsw_sp,
265 struct mlxsw_sp_acl_atcam_region *aregion,
266 struct mlxsw_sp_acl_erp_mask *erp_mask,
267 struct mlxsw_sp_acl_atcam_entry *aentry);
268 void mlxsw_sp_acl_erp_bf_remove(struct mlxsw_sp *mlxsw_sp,
269 struct mlxsw_sp_acl_atcam_region *aregion,
270 struct mlxsw_sp_acl_erp_mask *erp_mask,
271 struct mlxsw_sp_acl_atcam_entry *aentry);
273 mlxsw_sp_acl_erp_rehash_hints_get(struct mlxsw_sp_acl_atcam_region *aregion);
275 int mlxsw_sp_acl_erp_region_init(struct mlxsw_sp_acl_atcam_region *aregion,
277 void mlxsw_sp_acl_erp_region_fini(struct mlxsw_sp_acl_atcam_region *aregion);
278 int mlxsw_sp_acl_erps_init(struct mlxsw_sp *mlxsw_sp,
279 struct mlxsw_sp_acl_atcam *atcam);
280 void mlxsw_sp_acl_erps_fini(struct mlxsw_sp *mlxsw_sp,
281 struct mlxsw_sp_acl_atcam *atcam);
283 struct mlxsw_sp_acl_bf;
285 struct mlxsw_sp_acl_bf_ops {
286 unsigned int (*index_get)(struct mlxsw_sp_acl_bf *bf,
287 struct mlxsw_sp_acl_atcam_region *aregion,
288 struct mlxsw_sp_acl_atcam_entry *aentry);
292 mlxsw_sp_acl_bf_entry_add(struct mlxsw_sp *mlxsw_sp,
293 struct mlxsw_sp_acl_bf *bf,
294 struct mlxsw_sp_acl_atcam_region *aregion,
296 struct mlxsw_sp_acl_atcam_entry *aentry);
298 mlxsw_sp_acl_bf_entry_del(struct mlxsw_sp *mlxsw_sp,
299 struct mlxsw_sp_acl_bf *bf,
300 struct mlxsw_sp_acl_atcam_region *aregion,
302 struct mlxsw_sp_acl_atcam_entry *aentry);
303 struct mlxsw_sp_acl_bf *
304 mlxsw_sp_acl_bf_init(struct mlxsw_sp *mlxsw_sp, unsigned int num_erp_banks);
305 void mlxsw_sp_acl_bf_fini(struct mlxsw_sp_acl_bf *bf);