Lines Matching refs:mall_entry

16 	struct mlxsw_sp_mall_entry *mall_entry;  in mlxsw_sp_mall_entry_find()  local
18 list_for_each_entry(mall_entry, &block->mall.list, list) in mlxsw_sp_mall_entry_find()
19 if (mall_entry->cookie == cookie) in mlxsw_sp_mall_entry_find()
20 return mall_entry; in mlxsw_sp_mall_entry_find()
27 struct mlxsw_sp_mall_entry *mall_entry, in mlxsw_sp_mall_port_mirror_add() argument
36 if (!mall_entry->mirror.to_dev) { in mlxsw_sp_mall_port_mirror_add()
41 agent_parms.to_dev = mall_entry->mirror.to_dev; in mlxsw_sp_mall_port_mirror_add()
42 err = mlxsw_sp_span_agent_get(mlxsw_sp, &mall_entry->mirror.span_id, in mlxsw_sp_mall_port_mirror_add()
50 mall_entry->ingress); in mlxsw_sp_mall_port_mirror_add()
56 trigger = mall_entry->ingress ? MLXSW_SP_SPAN_TRIGGER_INGRESS : in mlxsw_sp_mall_port_mirror_add()
58 parms.span_id = mall_entry->mirror.span_id; in mlxsw_sp_mall_port_mirror_add()
70 mlxsw_sp_span_analyzed_port_put(mlxsw_sp_port, mall_entry->ingress); in mlxsw_sp_mall_port_mirror_add()
72 mlxsw_sp_span_agent_put(mlxsw_sp, mall_entry->mirror.span_id); in mlxsw_sp_mall_port_mirror_add()
78 struct mlxsw_sp_mall_entry *mall_entry) in mlxsw_sp_mall_port_mirror_del() argument
84 trigger = mall_entry->ingress ? MLXSW_SP_SPAN_TRIGGER_INGRESS : in mlxsw_sp_mall_port_mirror_del()
86 parms.span_id = mall_entry->mirror.span_id; in mlxsw_sp_mall_port_mirror_del()
88 mlxsw_sp_span_analyzed_port_put(mlxsw_sp_port, mall_entry->ingress); in mlxsw_sp_mall_port_mirror_del()
89 mlxsw_sp_span_agent_put(mlxsw_sp, mall_entry->mirror.span_id); in mlxsw_sp_mall_port_mirror_del()
104 struct mlxsw_sp_mall_entry *mall_entry, in mlxsw_sp_mall_port_sample_add() argument
111 if (mall_entry->ingress) in mlxsw_sp_mall_port_sample_add()
117 &mall_entry->sample.params, in mlxsw_sp_mall_port_sample_add()
123 mall_entry, extack); in mlxsw_sp_mall_port_sample_add()
135 struct mlxsw_sp_mall_entry *mall_entry) in mlxsw_sp_mall_port_sample_del() argument
140 if (mall_entry->ingress) in mlxsw_sp_mall_port_sample_del()
146 mlxsw_sp->mall_ops->sample_del(mlxsw_sp, mlxsw_sp_port, mall_entry); in mlxsw_sp_mall_port_sample_del()
152 struct mlxsw_sp_mall_entry *mall_entry, in mlxsw_sp_mall_port_rule_add() argument
155 switch (mall_entry->type) { in mlxsw_sp_mall_port_rule_add()
157 return mlxsw_sp_mall_port_mirror_add(mlxsw_sp_port, mall_entry, in mlxsw_sp_mall_port_rule_add()
160 return mlxsw_sp_mall_port_sample_add(mlxsw_sp_port, mall_entry, in mlxsw_sp_mall_port_rule_add()
170 struct mlxsw_sp_mall_entry *mall_entry) in mlxsw_sp_mall_port_rule_del() argument
172 switch (mall_entry->type) { in mlxsw_sp_mall_port_rule_del()
174 mlxsw_sp_mall_port_mirror_del(mlxsw_sp_port, mall_entry); in mlxsw_sp_mall_port_rule_del()
177 mlxsw_sp_mall_port_sample_del(mlxsw_sp_port, mall_entry); in mlxsw_sp_mall_port_rule_del()
186 struct mlxsw_sp_mall_entry *mall_entry; in mlxsw_sp_mall_prio_update() local
192 list_for_each_entry(mall_entry, &block->mall.list, list) { in mlxsw_sp_mall_prio_update()
193 if (mall_entry->priority < block->mall.min_prio) in mlxsw_sp_mall_prio_update()
194 block->mall.min_prio = mall_entry->priority; in mlxsw_sp_mall_prio_update()
195 if (mall_entry->priority > block->mall.max_prio) in mlxsw_sp_mall_prio_update()
196 block->mall.max_prio = mall_entry->priority; in mlxsw_sp_mall_prio_update()
205 struct mlxsw_sp_mall_entry *mall_entry; in mlxsw_sp_mall_replace() local
246 mall_entry = kzalloc(sizeof(*mall_entry), GFP_KERNEL); in mlxsw_sp_mall_replace()
247 if (!mall_entry) in mlxsw_sp_mall_replace()
249 mall_entry->cookie = f->cookie; in mlxsw_sp_mall_replace()
250 mall_entry->priority = f->common.prio; in mlxsw_sp_mall_replace()
251 mall_entry->ingress = mlxsw_sp_flow_block_is_ingress_bound(block); in mlxsw_sp_mall_replace()
253 if (flower_prio_valid && mall_entry->ingress && in mlxsw_sp_mall_replace()
254 mall_entry->priority >= flower_min_prio) { in mlxsw_sp_mall_replace()
259 if (flower_prio_valid && !mall_entry->ingress && in mlxsw_sp_mall_replace()
260 mall_entry->priority <= flower_max_prio) { in mlxsw_sp_mall_replace()
270 mall_entry->type = MLXSW_SP_MALL_ACTION_TYPE_MIRROR; in mlxsw_sp_mall_replace()
271 mall_entry->mirror.to_dev = act->dev; in mlxsw_sp_mall_replace()
274 mall_entry->type = MLXSW_SP_MALL_ACTION_TYPE_SAMPLE; in mlxsw_sp_mall_replace()
275 mall_entry->sample.params.psample_group = act->sample.psample_group; in mlxsw_sp_mall_replace()
276 mall_entry->sample.params.truncate = act->sample.truncate; in mlxsw_sp_mall_replace()
277 mall_entry->sample.params.trunc_size = act->sample.trunc_size; in mlxsw_sp_mall_replace()
278 mall_entry->sample.params.rate = act->sample.rate; in mlxsw_sp_mall_replace()
287 mall_entry, f->common.extack); in mlxsw_sp_mall_replace()
293 if (mall_entry->ingress) in mlxsw_sp_mall_replace()
297 list_add_tail(&mall_entry->list, &block->mall.list); in mlxsw_sp_mall_replace()
304 mlxsw_sp_mall_port_rule_del(binding->mlxsw_sp_port, mall_entry); in mlxsw_sp_mall_replace()
306 kfree(mall_entry); in mlxsw_sp_mall_replace()
314 struct mlxsw_sp_mall_entry *mall_entry; in mlxsw_sp_mall_destroy() local
316 mall_entry = mlxsw_sp_mall_entry_find(block, f->cookie); in mlxsw_sp_mall_destroy()
317 if (!mall_entry) { in mlxsw_sp_mall_destroy()
322 list_del(&mall_entry->list); in mlxsw_sp_mall_destroy()
323 if (mall_entry->ingress) in mlxsw_sp_mall_destroy()
329 mlxsw_sp_mall_port_rule_del(binding->mlxsw_sp_port, mall_entry); in mlxsw_sp_mall_destroy()
330 kfree_rcu(mall_entry, rcu); /* sample RX packets may be in-flight */ in mlxsw_sp_mall_destroy()
338 struct mlxsw_sp_mall_entry *mall_entry; in mlxsw_sp_mall_port_bind() local
341 list_for_each_entry(mall_entry, &block->mall.list, list) { in mlxsw_sp_mall_port_bind()
342 err = mlxsw_sp_mall_port_rule_add(mlxsw_sp_port, mall_entry, in mlxsw_sp_mall_port_bind()
350 list_for_each_entry_continue_reverse(mall_entry, &block->mall.list, in mlxsw_sp_mall_port_bind()
352 mlxsw_sp_mall_port_rule_del(mlxsw_sp_port, mall_entry); in mlxsw_sp_mall_port_bind()
359 struct mlxsw_sp_mall_entry *mall_entry; in mlxsw_sp_mall_port_unbind() local
361 list_for_each_entry(mall_entry, &block->mall.list, list) in mlxsw_sp_mall_port_unbind()
362 mlxsw_sp_mall_port_rule_del(mlxsw_sp_port, mall_entry); in mlxsw_sp_mall_port_unbind()
381 struct mlxsw_sp_mall_entry *mall_entry, in mlxsw_sp1_mall_sample_add() argument
384 u32 rate = mall_entry->sample.params.rate; in mlxsw_sp1_mall_sample_add()
386 if (!mall_entry->ingress) { in mlxsw_sp1_mall_sample_add()
401 struct mlxsw_sp_mall_entry *mall_entry) in mlxsw_sp1_mall_sample_del() argument
413 struct mlxsw_sp_mall_entry *mall_entry, in mlxsw_sp2_mall_sample_add() argument
421 u32 rate = mall_entry->sample.params.rate; in mlxsw_sp2_mall_sample_add()
425 err = mlxsw_sp_span_agent_get(mlxsw_sp, &mall_entry->sample.span_id, in mlxsw_sp2_mall_sample_add()
433 mall_entry->ingress); in mlxsw_sp2_mall_sample_add()
439 span_trigger = mall_entry->ingress ? MLXSW_SP_SPAN_TRIGGER_INGRESS : in mlxsw_sp2_mall_sample_add()
441 trigger_parms.span_id = mall_entry->sample.span_id; in mlxsw_sp2_mall_sample_add()
453 mlxsw_sp_span_analyzed_port_put(mlxsw_sp_port, mall_entry->ingress); in mlxsw_sp2_mall_sample_add()
455 mlxsw_sp_span_agent_put(mlxsw_sp, mall_entry->sample.span_id); in mlxsw_sp2_mall_sample_add()
461 struct mlxsw_sp_mall_entry *mall_entry) in mlxsw_sp2_mall_sample_del() argument
466 span_trigger = mall_entry->ingress ? MLXSW_SP_SPAN_TRIGGER_INGRESS : in mlxsw_sp2_mall_sample_del()
468 trigger_parms.span_id = mall_entry->sample.span_id; in mlxsw_sp2_mall_sample_del()
471 mlxsw_sp_span_analyzed_port_put(mlxsw_sp_port, mall_entry->ingress); in mlxsw_sp2_mall_sample_del()
472 mlxsw_sp_span_agent_put(mlxsw_sp, mall_entry->sample.span_id); in mlxsw_sp2_mall_sample_del()