Lines Matching refs:span_entry
63 mlxsw_sp_span_entry_phys_configure(struct mlxsw_sp_span_entry *span_entry, in mlxsw_sp_span_entry_phys_configure() argument
70 int pa_id = span_entry->id; in mlxsw_sp_span_entry_phys_configure()
80 mlxsw_sp_span_entry_deconfigure_common(struct mlxsw_sp_span_entry *span_entry, in mlxsw_sp_span_entry_deconfigure_common() argument
83 struct mlxsw_sp_port *dest_port = span_entry->parms.dest_port; in mlxsw_sp_span_entry_deconfigure_common()
87 int pa_id = span_entry->id; in mlxsw_sp_span_entry_deconfigure_common()
94 mlxsw_sp_span_entry_phys_deconfigure(struct mlxsw_sp_span_entry *span_entry) in mlxsw_sp_span_entry_phys_deconfigure() argument
96 mlxsw_sp_span_entry_deconfigure_common(span_entry, in mlxsw_sp_span_entry_phys_deconfigure()
358 mlxsw_sp_span_entry_gretap4_configure(struct mlxsw_sp_span_entry *span_entry, in mlxsw_sp_span_entry_gretap4_configure() argument
365 int pa_id = span_entry->id; in mlxsw_sp_span_entry_gretap4_configure()
383 mlxsw_sp_span_entry_gretap4_deconfigure(struct mlxsw_sp_span_entry *span_entry) in mlxsw_sp_span_entry_gretap4_deconfigure() argument
385 mlxsw_sp_span_entry_deconfigure_common(span_entry, in mlxsw_sp_span_entry_gretap4_deconfigure()
459 mlxsw_sp_span_entry_gretap6_configure(struct mlxsw_sp_span_entry *span_entry, in mlxsw_sp_span_entry_gretap6_configure() argument
466 int pa_id = span_entry->id; in mlxsw_sp_span_entry_gretap6_configure()
483 mlxsw_sp_span_entry_gretap6_deconfigure(struct mlxsw_sp_span_entry *span_entry) in mlxsw_sp_span_entry_gretap6_deconfigure() argument
485 mlxsw_sp_span_entry_deconfigure_common(span_entry, in mlxsw_sp_span_entry_gretap6_deconfigure()
522 mlxsw_sp_span_entry_vlan_configure(struct mlxsw_sp_span_entry *span_entry, in mlxsw_sp_span_entry_vlan_configure() argument
529 int pa_id = span_entry->id; in mlxsw_sp_span_entry_vlan_configure()
539 mlxsw_sp_span_entry_vlan_deconfigure(struct mlxsw_sp_span_entry *span_entry) in mlxsw_sp_span_entry_vlan_deconfigure() argument
541 mlxsw_sp_span_entry_deconfigure_common(span_entry, in mlxsw_sp_span_entry_vlan_deconfigure()
573 mlxsw_sp_span_entry_nop_configure(struct mlxsw_sp_span_entry *span_entry, in mlxsw_sp_span_entry_nop_configure() argument
580 mlxsw_sp_span_entry_nop_deconfigure(struct mlxsw_sp_span_entry *span_entry) in mlxsw_sp_span_entry_nop_deconfigure() argument
592 struct mlxsw_sp_span_entry *span_entry, in mlxsw_sp_span_entry_configure() argument
597 … netdev_err(span_entry->to_dev, "Cannot mirror to %s, which belongs to a different mlxsw instance", in mlxsw_sp_span_entry_configure()
600 } else if (span_entry->ops->configure(span_entry, sparms)) { in mlxsw_sp_span_entry_configure()
601 netdev_err(span_entry->to_dev, "Failed to offload mirror to %s", in mlxsw_sp_span_entry_configure()
607 span_entry->parms = sparms; in mlxsw_sp_span_entry_configure()
611 mlxsw_sp_span_entry_deconfigure(struct mlxsw_sp_span_entry *span_entry) in mlxsw_sp_span_entry_deconfigure() argument
613 if (span_entry->parms.dest_port) in mlxsw_sp_span_entry_deconfigure()
614 span_entry->ops->deconfigure(span_entry); in mlxsw_sp_span_entry_deconfigure()
623 struct mlxsw_sp_span_entry *span_entry = NULL; in mlxsw_sp_span_entry_create() local
629 span_entry = &mlxsw_sp->span.entries[i]; in mlxsw_sp_span_entry_create()
633 if (!span_entry) in mlxsw_sp_span_entry_create()
636 span_entry->ops = ops; in mlxsw_sp_span_entry_create()
637 span_entry->ref_count = 1; in mlxsw_sp_span_entry_create()
638 span_entry->to_dev = to_dev; in mlxsw_sp_span_entry_create()
639 mlxsw_sp_span_entry_configure(mlxsw_sp, span_entry, sparms); in mlxsw_sp_span_entry_create()
641 return span_entry; in mlxsw_sp_span_entry_create()
644 static void mlxsw_sp_span_entry_destroy(struct mlxsw_sp_span_entry *span_entry) in mlxsw_sp_span_entry_destroy() argument
646 mlxsw_sp_span_entry_deconfigure(span_entry); in mlxsw_sp_span_entry_destroy()
665 struct mlxsw_sp_span_entry *span_entry) in mlxsw_sp_span_entry_invalidate() argument
667 mlxsw_sp_span_entry_deconfigure(span_entry); in mlxsw_sp_span_entry_invalidate()
668 span_entry->ops = &mlxsw_sp_span_entry_ops_nop; in mlxsw_sp_span_entry_invalidate()
691 struct mlxsw_sp_span_entry *span_entry; in mlxsw_sp_span_entry_get() local
693 span_entry = mlxsw_sp_span_entry_find_by_port(mlxsw_sp, to_dev); in mlxsw_sp_span_entry_get()
694 if (span_entry) { in mlxsw_sp_span_entry_get()
696 span_entry->ref_count++; in mlxsw_sp_span_entry_get()
697 return span_entry; in mlxsw_sp_span_entry_get()
704 struct mlxsw_sp_span_entry *span_entry) in mlxsw_sp_span_entry_put() argument
706 WARN_ON(!span_entry->ref_count); in mlxsw_sp_span_entry_put()
707 if (--span_entry->ref_count == 0) in mlxsw_sp_span_entry_put()
708 mlxsw_sp_span_entry_destroy(span_entry); in mlxsw_sp_span_entry_put()
760 mlxsw_sp_span_entry_bound_port_find(struct mlxsw_sp_span_entry *span_entry, in mlxsw_sp_span_entry_bound_port_find() argument
767 list_for_each_entry(p, &span_entry->bound_ports_list, list) in mlxsw_sp_span_entry_bound_port_find()
777 struct mlxsw_sp_span_entry *span_entry, in mlxsw_sp_span_inspected_port_bind() argument
783 int pa_id = span_entry->id; in mlxsw_sp_span_inspected_port_bind()
793 struct mlxsw_sp_span_entry *span_entry, in mlxsw_sp_span_inspected_port_add() argument
830 err = mlxsw_sp_span_inspected_port_bind(port, span_entry, type, in mlxsw_sp_span_inspected_port_add()
844 list_add_tail(&inspected_port->list, &span_entry->bound_ports_list); in mlxsw_sp_span_inspected_port_add()
850 mlxsw_sp_span_inspected_port_bind(port, span_entry, type, in mlxsw_sp_span_inspected_port_add()
862 struct mlxsw_sp_span_entry *span_entry, in mlxsw_sp_span_inspected_port_del() argument
870 inspected_port = mlxsw_sp_span_entry_bound_port_find(span_entry, type, in mlxsw_sp_span_inspected_port_del()
876 mlxsw_sp_span_inspected_port_bind(port, span_entry, type, in mlxsw_sp_span_inspected_port_del()
884 mlxsw_sp_span_entry_put(mlxsw_sp, span_entry); in mlxsw_sp_span_inspected_port_del()
911 struct mlxsw_sp_span_entry *span_entry; in mlxsw_sp_span_mirror_add() local
924 span_entry = mlxsw_sp_span_entry_get(mlxsw_sp, to_dev, ops, sparms); in mlxsw_sp_span_mirror_add()
925 if (!span_entry) in mlxsw_sp_span_mirror_add()
929 span_entry->id); in mlxsw_sp_span_mirror_add()
931 err = mlxsw_sp_span_inspected_port_add(from, span_entry, type, bind); in mlxsw_sp_span_mirror_add()
935 *p_span_id = span_entry->id; in mlxsw_sp_span_mirror_add()
939 mlxsw_sp_span_entry_put(mlxsw_sp, span_entry); in mlxsw_sp_span_mirror_add()
946 struct mlxsw_sp_span_entry *span_entry; in mlxsw_sp_span_mirror_del() local
948 span_entry = mlxsw_sp_span_entry_find_by_id(from->mlxsw_sp, span_id); in mlxsw_sp_span_mirror_del()
949 if (!span_entry) { in mlxsw_sp_span_mirror_del()
955 span_entry->id); in mlxsw_sp_span_mirror_del()
956 mlxsw_sp_span_inspected_port_del(from, span_entry, type, bind); in mlxsw_sp_span_mirror_del()