Lines Matching +full:port +full:- +full:id
1 // SPDX-License-Identifier: GPL-2.0
22 int id; member
32 int id; member
37 struct mvpp2_port *port; member
54 /* Entries for per-port flows debug info */
60 struct mvpp2_dbgfs_flow_tbl_entry *entry = s->private; in mvpp2_dbgfs_flow_flt_hits_show()
62 u32 hits = mvpp2_cls_flow_hits(entry->priv, entry->id); in mvpp2_dbgfs_flow_flt_hits_show()
73 struct mvpp2_dbgfs_flow_entry *entry = s->private; in mvpp2_dbgfs_flow_dec_hits_show()
75 u32 hits = mvpp2_cls_lookup_hits(entry->priv, entry->flow); in mvpp2_dbgfs_flow_dec_hits_show()
86 struct mvpp2_dbgfs_flow_entry *entry = s->private; in mvpp2_dbgfs_flow_type_show()
90 f = mvpp2_cls_flow_get(entry->flow); in mvpp2_dbgfs_flow_type_show()
92 return -EINVAL; in mvpp2_dbgfs_flow_type_show()
94 switch (f->flow_type) { in mvpp2_dbgfs_flow_type_show()
126 const struct mvpp2_dbgfs_flow_entry *entry = s->private; in mvpp2_dbgfs_flow_id_show()
129 f = mvpp2_cls_flow_get(entry->flow); in mvpp2_dbgfs_flow_id_show()
131 return -EINVAL; in mvpp2_dbgfs_flow_id_show()
133 seq_printf(s, "%d\n", f->flow_id); in mvpp2_dbgfs_flow_id_show()
142 struct mvpp2_dbgfs_port_flow_entry *entry = s->private; in mvpp2_dbgfs_port_flow_hash_opt_show()
143 struct mvpp2_port *port = entry->port; in mvpp2_dbgfs_port_flow_hash_opt_show() local
149 f = mvpp2_cls_flow_get(entry->dbg_fe->flow); in mvpp2_dbgfs_port_flow_hash_opt_show()
151 return -EINVAL; in mvpp2_dbgfs_port_flow_hash_opt_show()
153 flow_index = MVPP2_CLS_FLT_HASH_ENTRY(entry->port->id, f->flow_id); in mvpp2_dbgfs_port_flow_hash_opt_show()
155 mvpp2_cls_flow_read(port->priv, flow_index, &fe); in mvpp2_dbgfs_port_flow_hash_opt_show()
168 struct mvpp2_dbgfs_port_flow_entry *entry = s->private; in mvpp2_dbgfs_port_flow_engine_show()
169 struct mvpp2_port *port = entry->port; in mvpp2_dbgfs_port_flow_engine_show() local
174 f = mvpp2_cls_flow_get(entry->dbg_fe->flow); in mvpp2_dbgfs_port_flow_engine_show()
176 return -EINVAL; in mvpp2_dbgfs_port_flow_engine_show()
178 flow_index = MVPP2_CLS_FLT_HASH_ENTRY(entry->port->id, f->flow_id); in mvpp2_dbgfs_port_flow_engine_show()
180 mvpp2_cls_flow_read(port->priv, flow_index, &fe); in mvpp2_dbgfs_port_flow_engine_show()
193 struct mvpp2_dbgfs_c2_entry *entry = s->private; in mvpp2_dbgfs_flow_c2_hits_show()
196 hits = mvpp2_cls_c2_hit_count(entry->priv, entry->id); in mvpp2_dbgfs_flow_c2_hits_show()
207 struct mvpp2_dbgfs_c2_entry *entry = s->private; in mvpp2_dbgfs_flow_c2_rxq_show()
211 mvpp2_cls_c2_read(entry->priv, entry->id, &c2); in mvpp2_dbgfs_flow_c2_rxq_show()
228 struct mvpp2_dbgfs_c2_entry *entry = s->private; in mvpp2_dbgfs_flow_c2_enable_show()
232 mvpp2_cls_c2_read(entry->priv, entry->id, &c2); in mvpp2_dbgfs_flow_c2_enable_show()
245 struct mvpp2_port *port = s->private; in mvpp2_dbgfs_port_vid_show() local
247 struct mvpp2 *priv = port->priv; in mvpp2_dbgfs_port_vid_show()
253 for (tid = MVPP2_PRS_VID_PORT_FIRST(port->id); in mvpp2_dbgfs_port_vid_show()
254 tid <= MVPP2_PRS_VID_PORT_LAST(port->id); tid++) { in mvpp2_dbgfs_port_vid_show()
259 if (!priv->prs_shadow[tid].valid) in mvpp2_dbgfs_port_vid_show()
262 if (!test_bit(port->id, &pmap)) in mvpp2_dbgfs_port_vid_show()
280 struct mvpp2_port *port = s->private; in mvpp2_dbgfs_port_parser_show() local
281 struct mvpp2 *priv = port->priv; in mvpp2_dbgfs_port_parser_show()
287 mvpp2_prs_init_from_hw(port->priv, &pe, i); in mvpp2_dbgfs_port_parser_show()
290 if (priv->prs_shadow[i].valid && test_bit(port->id, &pmap)) in mvpp2_dbgfs_port_parser_show()
301 struct mvpp2_port *port = s->private; in mvpp2_dbgfs_filter_show() local
302 struct mvpp2 *priv = port->priv; in mvpp2_dbgfs_filter_show()
311 if (!priv->prs_shadow[tid].valid || in mvpp2_dbgfs_filter_show()
312 priv->prs_shadow[tid].lu != MVPP2_PRS_LU_MAC || in mvpp2_dbgfs_filter_show()
313 priv->prs_shadow[tid].udf != MVPP2_PRS_UDF_MAC_DEF) in mvpp2_dbgfs_filter_show()
320 /* We only want entries active on this port */ in mvpp2_dbgfs_filter_show()
321 if (!test_bit(port->id, &pmap)) in mvpp2_dbgfs_filter_show()
339 struct mvpp2_dbgfs_prs_entry *entry = s->private; in mvpp2_dbgfs_prs_lu_show()
340 struct mvpp2 *priv = entry->priv; in mvpp2_dbgfs_prs_lu_show()
342 seq_printf(s, "%x\n", priv->prs_shadow[entry->tid].lu); in mvpp2_dbgfs_prs_lu_show()
351 struct mvpp2_dbgfs_prs_entry *entry = s->private; in mvpp2_dbgfs_prs_pmap_show()
355 mvpp2_prs_init_from_hw(entry->priv, &pe, entry->tid); in mvpp2_dbgfs_prs_pmap_show()
369 struct mvpp2_dbgfs_prs_entry *entry = s->private; in mvpp2_dbgfs_prs_ai_show()
373 mvpp2_prs_init_from_hw(entry->priv, &pe, entry->tid); in mvpp2_dbgfs_prs_ai_show()
387 struct mvpp2_dbgfs_prs_entry *entry = s->private; in mvpp2_dbgfs_prs_hdata_show()
392 mvpp2_prs_init_from_hw(entry->priv, &pe, entry->tid); in mvpp2_dbgfs_prs_hdata_show()
406 struct mvpp2_dbgfs_prs_entry *entry = s->private; in mvpp2_dbgfs_prs_sram_show()
409 mvpp2_prs_init_from_hw(entry->priv, &pe, entry->tid); in mvpp2_dbgfs_prs_sram_show()
420 struct mvpp2_dbgfs_prs_entry *entry = s->private; in mvpp2_dbgfs_prs_hits_show()
423 val = mvpp2_prs_hits(entry->priv, entry->tid); in mvpp2_dbgfs_prs_hits_show()
436 struct mvpp2_dbgfs_prs_entry *entry = s->private; in mvpp2_dbgfs_prs_valid_show()
437 struct mvpp2 *priv = entry->priv; in mvpp2_dbgfs_prs_valid_show()
438 int tid = entry->tid; in mvpp2_dbgfs_prs_valid_show()
440 seq_printf(s, "%d\n", priv->prs_shadow[tid].valid ? 1 : 0); in mvpp2_dbgfs_prs_valid_show()
448 struct mvpp2_port *port, in mvpp2_dbgfs_flow_port_init() argument
454 port_dir = debugfs_create_dir(port->dev->name, parent); in mvpp2_dbgfs_flow_port_init()
456 port_entry = &port->priv->dbgfs_entries->port_flow_entries[port->id]; in mvpp2_dbgfs_flow_port_init()
458 port_entry->port = port; in mvpp2_dbgfs_flow_port_init()
459 port_entry->dbg_fe = entry; in mvpp2_dbgfs_flow_port_init()
482 entry = &priv->dbgfs_entries->flow_entries[flow]; in mvpp2_dbgfs_flow_entry_init()
484 entry->flow = flow; in mvpp2_dbgfs_flow_entry_init()
485 entry->priv = priv; in mvpp2_dbgfs_flow_entry_init()
493 debugfs_create_file("id", 0444, flow_entry_dir, entry, in mvpp2_dbgfs_flow_entry_init()
496 /* Create entry for each port */ in mvpp2_dbgfs_flow_entry_init()
497 for (i = 0; i < priv->port_count; i++) { in mvpp2_dbgfs_flow_entry_init()
499 priv->port_list[i], entry); in mvpp2_dbgfs_flow_entry_init()
531 return -EINVAL; in mvpp2_dbgfs_prs_entry_init()
537 entry = &priv->dbgfs_entries->prs_entries[tid]; in mvpp2_dbgfs_prs_entry_init()
539 entry->tid = tid; in mvpp2_dbgfs_prs_entry_init()
540 entry->priv = priv; in mvpp2_dbgfs_prs_entry_init()
584 struct mvpp2 *priv, int id) in mvpp2_dbgfs_c2_entry_init() argument
590 if (id >= MVPP22_CLS_C2_N_ENTRIES) in mvpp2_dbgfs_c2_entry_init()
591 return -EINVAL; in mvpp2_dbgfs_c2_entry_init()
593 sprintf(c2_entry_name, "%03d", id); in mvpp2_dbgfs_c2_entry_init()
597 entry = &priv->dbgfs_entries->c2_entries[id]; in mvpp2_dbgfs_c2_entry_init()
599 entry->id = id; in mvpp2_dbgfs_c2_entry_init()
600 entry->priv = priv; in mvpp2_dbgfs_c2_entry_init()
615 struct mvpp2 *priv, int id) in mvpp2_dbgfs_flow_tbl_entry_init() argument
621 if (id >= MVPP2_CLS_FLOWS_TBL_SIZE) in mvpp2_dbgfs_flow_tbl_entry_init()
622 return -EINVAL; in mvpp2_dbgfs_flow_tbl_entry_init()
624 sprintf(flow_tbl_entry_name, "%03d", id); in mvpp2_dbgfs_flow_tbl_entry_init()
628 entry = &priv->dbgfs_entries->flt_entries[id]; in mvpp2_dbgfs_flow_tbl_entry_init()
630 entry->id = id; in mvpp2_dbgfs_flow_tbl_entry_init()
631 entry->priv = priv; in mvpp2_dbgfs_flow_tbl_entry_init()
666 struct mvpp2_port *port) in mvpp2_dbgfs_port_init() argument
670 port_dir = debugfs_create_dir(port->dev->name, parent); in mvpp2_dbgfs_port_init()
672 debugfs_create_file("parser_entries", 0444, port_dir, port, in mvpp2_dbgfs_port_init()
675 debugfs_create_file("mac_filter", 0444, port_dir, port, in mvpp2_dbgfs_port_init()
678 debugfs_create_file("vid_filter", 0444, port_dir, port, in mvpp2_dbgfs_port_init()
693 debugfs_remove_recursive(priv->dbgfs_dir); in mvpp2_dbgfs_cleanup()
695 kfree(priv->dbgfs_entries); in mvpp2_dbgfs_cleanup()
708 priv->dbgfs_dir = mvpp2_dir; in mvpp2_dbgfs_init()
709 priv->dbgfs_entries = kzalloc(sizeof(*priv->dbgfs_entries), GFP_KERNEL); in mvpp2_dbgfs_init()
710 if (!priv->dbgfs_entries) in mvpp2_dbgfs_init()
721 for (i = 0; i < priv->port_count; i++) { in mvpp2_dbgfs_init()
722 ret = mvpp2_dbgfs_port_init(mvpp2_dir, priv->port_list[i]); in mvpp2_dbgfs_init()