Lines Matching refs:trap

30 	struct devlink_trap trap;  member
643 .trap = MLXSW_SP_TRAP_DROP(SMAC_MC, L2_DROPS),
649 .trap = MLXSW_SP_TRAP_DROP(VLAN_TAG_MISMATCH, L2_DROPS),
656 .trap = MLXSW_SP_TRAP_DROP(INGRESS_VLAN_FILTER, L2_DROPS),
662 .trap = MLXSW_SP_TRAP_DROP(INGRESS_STP_FILTER, L2_DROPS),
668 .trap = MLXSW_SP_TRAP_DROP(EMPTY_TX_LIST, L2_DROPS),
675 .trap = MLXSW_SP_TRAP_DROP(PORT_LOOPBACK_FILTER, L2_DROPS),
681 .trap = MLXSW_SP_TRAP_DROP(BLACKHOLE_ROUTE, L3_DROPS),
687 .trap = MLXSW_SP_TRAP_DROP(NON_IP_PACKET, L3_DROPS),
694 .trap = MLXSW_SP_TRAP_DROP(UC_DIP_MC_DMAC, L3_DROPS),
701 .trap = MLXSW_SP_TRAP_DROP(DIP_LB, L3_DROPS),
707 .trap = MLXSW_SP_TRAP_DROP(SIP_MC, L3_DROPS),
713 .trap = MLXSW_SP_TRAP_DROP(SIP_LB, L3_DROPS),
719 .trap = MLXSW_SP_TRAP_DROP(CORRUPTED_IP_HDR, L3_DROPS),
726 .trap = MLXSW_SP_TRAP_DROP(IPV4_SIP_BC, L3_DROPS),
733 .trap = MLXSW_SP_TRAP_DROP(IPV6_MC_DIP_RESERVED_SCOPE,
741 .trap = MLXSW_SP_TRAP_DROP(IPV6_MC_DIP_INTERFACE_LOCAL_SCOPE,
749 .trap = MLXSW_SP_TRAP_EXCEPTION(MTU_ERROR, L3_EXCEPTIONS),
756 .trap = MLXSW_SP_TRAP_EXCEPTION(TTL_ERROR, L3_EXCEPTIONS),
763 .trap = MLXSW_SP_TRAP_EXCEPTION(RPF, L3_EXCEPTIONS),
769 .trap = MLXSW_SP_TRAP_EXCEPTION(REJECT_ROUTE, L3_EXCEPTIONS),
776 .trap = MLXSW_SP_TRAP_EXCEPTION(UNRESOLVED_NEIGH,
788 .trap = MLXSW_SP_TRAP_EXCEPTION(IPV4_LPM_UNICAST_MISS,
797 .trap = MLXSW_SP_TRAP_EXCEPTION(IPV6_LPM_UNICAST_MISS,
806 .trap = MLXSW_SP_TRAP_DRIVER_DROP(IRIF_DISABLED, L3_DROPS),
812 .trap = MLXSW_SP_TRAP_DRIVER_DROP(ERIF_DISABLED, L3_DROPS),
818 .trap = MLXSW_SP_TRAP_DROP(NON_ROUTABLE, L3_DROPS),
824 .trap = MLXSW_SP_TRAP_EXCEPTION(DECAP_ERROR, TUNNEL_DROPS),
836 .trap = MLXSW_SP_TRAP_DROP(OVERLAY_SMAC_MC, TUNNEL_DROPS),
842 .trap = MLXSW_SP_TRAP_DROP_EXT(INGRESS_FLOW_ACTION_DROP,
851 .trap = MLXSW_SP_TRAP_DROP_EXT(EGRESS_FLOW_ACTION_DROP,
860 .trap = MLXSW_SP_TRAP_CONTROL(STP, STP, TRAP),
866 .trap = MLXSW_SP_TRAP_CONTROL(LACP, LACP, TRAP),
872 .trap = MLXSW_SP_TRAP_CONTROL(LLDP, LLDP, TRAP),
879 .trap = MLXSW_SP_TRAP_CONTROL(IGMP_QUERY, MC_SNOOPING, MIRROR),
886 .trap = MLXSW_SP_TRAP_CONTROL(IGMP_V1_REPORT, MC_SNOOPING,
894 .trap = MLXSW_SP_TRAP_CONTROL(IGMP_V2_REPORT, MC_SNOOPING,
902 .trap = MLXSW_SP_TRAP_CONTROL(IGMP_V3_REPORT, MC_SNOOPING,
910 .trap = MLXSW_SP_TRAP_CONTROL(IGMP_V2_LEAVE, MC_SNOOPING,
918 .trap = MLXSW_SP_TRAP_CONTROL(MLD_QUERY, MC_SNOOPING, MIRROR),
925 .trap = MLXSW_SP_TRAP_CONTROL(MLD_V1_REPORT, MC_SNOOPING,
933 .trap = MLXSW_SP_TRAP_CONTROL(MLD_V2_REPORT, MC_SNOOPING,
941 .trap = MLXSW_SP_TRAP_CONTROL(MLD_V1_DONE, MC_SNOOPING,
949 .trap = MLXSW_SP_TRAP_CONTROL(IPV4_DHCP, DHCP, TRAP),
955 .trap = MLXSW_SP_TRAP_CONTROL(IPV6_DHCP, DHCP, TRAP),
961 .trap = MLXSW_SP_TRAP_CONTROL(ARP_REQUEST, NEIGH_DISCOVERY,
969 .trap = MLXSW_SP_TRAP_CONTROL(ARP_RESPONSE, NEIGH_DISCOVERY,
977 .trap = MLXSW_SP_TRAP_CONTROL(ARP_OVERLAY, NEIGH_DISCOVERY,
985 .trap = MLXSW_SP_TRAP_CONTROL(IPV6_NEIGH_SOLICIT,
993 .trap = MLXSW_SP_TRAP_CONTROL(IPV6_NEIGH_ADVERT,
1001 .trap = MLXSW_SP_TRAP_CONTROL(IPV4_BFD, BFD, TRAP),
1007 .trap = MLXSW_SP_TRAP_CONTROL(IPV6_BFD, BFD, TRAP),
1013 .trap = MLXSW_SP_TRAP_CONTROL(IPV4_OSPF, OSPF, TRAP),
1019 .trap = MLXSW_SP_TRAP_CONTROL(IPV6_OSPF, OSPF, TRAP),
1025 .trap = MLXSW_SP_TRAP_CONTROL(IPV4_BGP, BGP, TRAP),
1031 .trap = MLXSW_SP_TRAP_CONTROL(IPV6_BGP, BGP, TRAP),
1037 .trap = MLXSW_SP_TRAP_CONTROL(IPV4_VRRP, VRRP, TRAP),
1043 .trap = MLXSW_SP_TRAP_CONTROL(IPV6_VRRP, VRRP, TRAP),
1049 .trap = MLXSW_SP_TRAP_CONTROL(IPV4_PIM, PIM, TRAP),
1055 .trap = MLXSW_SP_TRAP_CONTROL(IPV6_PIM, PIM, TRAP),
1061 .trap = MLXSW_SP_TRAP_CONTROL(UC_LB, UC_LB, MIRROR),
1068 .trap = MLXSW_SP_TRAP_CONTROL(LOCAL_ROUTE, LOCAL_DELIVERY,
1075 .trap = MLXSW_SP_TRAP_CONTROL(EXTERNAL_ROUTE, EXTERNAL_DELIVERY,
1083 .trap = MLXSW_SP_TRAP_CONTROL(IPV6_UC_DIP_LINK_LOCAL_SCOPE,
1091 .trap = MLXSW_SP_TRAP_CONTROL(IPV4_ROUTER_ALERT, LOCAL_DELIVERY,
1103 .trap = MLXSW_SP_TRAP_CONTROL(IPV6_ROUTER_ALERT, LOCAL_DELIVERY,
1111 .trap = MLXSW_SP_TRAP_CONTROL(IPV6_DIP_ALL_NODES, IPV6, TRAP),
1118 .trap = MLXSW_SP_TRAP_CONTROL(IPV6_DIP_ALL_ROUTERS, IPV6, TRAP),
1125 .trap = MLXSW_SP_TRAP_CONTROL(IPV6_ROUTER_SOLICIT, IPV6, TRAP),
1132 .trap = MLXSW_SP_TRAP_CONTROL(IPV6_ROUTER_ADVERT, IPV6, TRAP),
1139 .trap = MLXSW_SP_TRAP_CONTROL(IPV6_REDIRECT, IPV6, TRAP),
1146 .trap = MLXSW_SP_TRAP_CONTROL(PTP_EVENT, PTP_EVENT, TRAP),
1153 .trap = MLXSW_SP_TRAP_CONTROL(PTP_GENERAL, PTP_GENERAL, TRAP),
1159 .trap = MLXSW_SP_TRAP_CONTROL(FLOW_ACTION_TRAP, ACL_TRAP, TRAP),
1166 .trap = MLXSW_SP_TRAP_DROP(BLACKHOLE_NEXTHOP, L3_DROPS),
1172 .trap = MLXSW_SP_TRAP_CONTROL(EAPOL, EAPOL, TRAP),
1178 .trap = MLXSW_SP_TRAP_DROP(LOCKED_PORT, L2_DROPS),
1193 struct mlxsw_sp_trap *trap = mlxsw_sp->trap; in mlxsw_sp_trap_policer_item_lookup() local
1196 for (i = 0; i < trap->policers_count; i++) { in mlxsw_sp_trap_policer_item_lookup()
1197 if (trap->policer_items_arr[i].policer.id == id) in mlxsw_sp_trap_policer_item_lookup()
1198 return &trap->policer_items_arr[i]; in mlxsw_sp_trap_policer_item_lookup()
1207 struct mlxsw_sp_trap *trap = mlxsw_sp->trap; in mlxsw_sp_trap_group_item_lookup() local
1210 for (i = 0; i < trap->groups_count; i++) { in mlxsw_sp_trap_group_item_lookup()
1211 if (trap->group_items_arr[i].group.id == id) in mlxsw_sp_trap_group_item_lookup()
1212 return &trap->group_items_arr[i]; in mlxsw_sp_trap_group_item_lookup()
1221 struct mlxsw_sp_trap *trap = mlxsw_sp->trap; in mlxsw_sp_trap_item_lookup() local
1224 for (i = 0; i < trap->traps_count; i++) { in mlxsw_sp_trap_item_lookup()
1225 if (trap->trap_items_arr[i].trap.id == id) in mlxsw_sp_trap_item_lookup()
1226 return &trap->trap_items_arr[i]; in mlxsw_sp_trap_item_lookup()
1234 struct mlxsw_sp_trap *trap = mlxsw_sp->trap; in mlxsw_sp_trap_cpu_policers_set() local
1241 hw_id = find_first_zero_bit(trap->policers_usage, trap->max_policers); in mlxsw_sp_trap_cpu_policers_set()
1242 if (WARN_ON(hw_id == trap->max_policers)) in mlxsw_sp_trap_cpu_policers_set()
1245 __set_bit(hw_id, trap->policers_usage); in mlxsw_sp_trap_cpu_policers_set()
1246 trap->thin_policer_hw_id = hw_id; in mlxsw_sp_trap_cpu_policers_set()
1257 mlxsw_sp->trap->thin_policer_hw_id, 0, 1); in mlxsw_sp_trap_dummy_group_init()
1265 struct mlxsw_sp_trap *trap = mlxsw_sp->trap; in mlxsw_sp_trap_policer_items_arr_init() local
1270 for_each_clear_bit(i, trap->policers_usage, trap->max_policers) in mlxsw_sp_trap_policer_items_arr_init()
1278 trap->policer_items_arr = kcalloc(free_policers, elem_size, GFP_KERNEL); in mlxsw_sp_trap_policer_items_arr_init()
1279 if (!trap->policer_items_arr) in mlxsw_sp_trap_policer_items_arr_init()
1282 trap->policers_count = free_policers; in mlxsw_sp_trap_policer_items_arr_init()
1285 memcpy(trap->policer_items_arr, mlxsw_sp_trap_policer_items_arr, in mlxsw_sp_trap_policer_items_arr_init()
1292 for (i = arr_size; i < trap->policers_count; i++) { in mlxsw_sp_trap_policer_items_arr_init()
1299 trap->policer_items_arr[i] = *policer_item; in mlxsw_sp_trap_policer_items_arr_init()
1300 trap->policer_items_arr[i].policer.id = ++last_id; in mlxsw_sp_trap_policer_items_arr_init()
1301 trap->policer_items_arr[i].policer.init_rate = 1; in mlxsw_sp_trap_policer_items_arr_init()
1302 trap->policer_items_arr[i].policer.init_burst = 16; in mlxsw_sp_trap_policer_items_arr_init()
1310 kfree(mlxsw_sp->trap->policer_items_arr); in mlxsw_sp_trap_policer_items_arr_fini()
1317 struct mlxsw_sp_trap *trap = mlxsw_sp->trap; in mlxsw_sp_trap_policers_init() local
1324 for (i = 0; i < trap->policers_count; i++) { in mlxsw_sp_trap_policers_init()
1325 policer_item = &trap->policer_items_arr[i]; in mlxsw_sp_trap_policers_init()
1336 policer_item = &trap->policer_items_arr[i]; in mlxsw_sp_trap_policers_init()
1348 struct mlxsw_sp_trap *trap = mlxsw_sp->trap; in mlxsw_sp_trap_policers_fini() local
1351 for (i = trap->policers_count - 1; i >= 0; i--) { in mlxsw_sp_trap_policers_fini()
1352 policer_item = &trap->policer_items_arr[i]; in mlxsw_sp_trap_policers_fini()
1364 struct mlxsw_sp_trap *trap = mlxsw_sp->trap; in mlxsw_sp_trap_group_items_arr_init() local
1377 trap->group_items_arr = kcalloc(groups_count, elem_size, GFP_KERNEL); in mlxsw_sp_trap_group_items_arr_init()
1378 if (!trap->group_items_arr) in mlxsw_sp_trap_group_items_arr_init()
1381 memcpy(trap->group_items_arr, mlxsw_sp_trap_group_items_arr, in mlxsw_sp_trap_group_items_arr_init()
1383 memcpy(trap->group_items_arr + common_groups_count, in mlxsw_sp_trap_group_items_arr_init()
1386 trap->groups_count = groups_count; in mlxsw_sp_trap_group_items_arr_init()
1393 kfree(mlxsw_sp->trap->group_items_arr); in mlxsw_sp_trap_group_items_arr_fini()
1400 struct mlxsw_sp_trap *trap = mlxsw_sp->trap; in mlxsw_sp_trap_groups_init() local
1407 for (i = 0; i < trap->groups_count; i++) { in mlxsw_sp_trap_groups_init()
1408 group_item = &trap->group_items_arr[i]; in mlxsw_sp_trap_groups_init()
1418 group_item = &trap->group_items_arr[i]; in mlxsw_sp_trap_groups_init()
1428 struct mlxsw_sp_trap *trap = mlxsw_sp->trap; in mlxsw_sp_trap_groups_fini() local
1431 for (i = trap->groups_count - 1; i >= 0; i--) { in mlxsw_sp_trap_groups_fini()
1434 group_item = &trap->group_items_arr[i]; in mlxsw_sp_trap_groups_fini()
1451 struct mlxsw_sp_trap *trap = mlxsw_sp->trap; in mlxsw_sp_trap_items_arr_init() local
1464 trap->trap_items_arr = kcalloc(traps_count, elem_size, GFP_KERNEL); in mlxsw_sp_trap_items_arr_init()
1465 if (!trap->trap_items_arr) in mlxsw_sp_trap_items_arr_init()
1468 memcpy(trap->trap_items_arr, mlxsw_sp_trap_items_arr, in mlxsw_sp_trap_items_arr_init()
1470 memcpy(trap->trap_items_arr + common_traps_count, in mlxsw_sp_trap_items_arr_init()
1473 trap->traps_count = traps_count; in mlxsw_sp_trap_items_arr_init()
1480 kfree(mlxsw_sp->trap->trap_items_arr); in mlxsw_sp_trap_items_arr_fini()
1486 struct mlxsw_sp_trap *trap = mlxsw_sp->trap; in mlxsw_sp_traps_init() local
1494 for (i = 0; i < trap->traps_count; i++) { in mlxsw_sp_traps_init()
1495 trap_item = &trap->trap_items_arr[i]; in mlxsw_sp_traps_init()
1496 err = devl_traps_register(devlink, &trap_item->trap, 1, in mlxsw_sp_traps_init()
1506 trap_item = &trap->trap_items_arr[i]; in mlxsw_sp_traps_init()
1507 devl_traps_unregister(devlink, &trap_item->trap, 1); in mlxsw_sp_traps_init()
1516 struct mlxsw_sp_trap *trap = mlxsw_sp->trap; in mlxsw_sp_traps_fini() local
1519 for (i = trap->traps_count - 1; i >= 0; i--) { in mlxsw_sp_traps_fini()
1522 trap_item = &trap->trap_items_arr[i]; in mlxsw_sp_traps_fini()
1523 devl_traps_unregister(devlink, &trap_item->trap, 1); in mlxsw_sp_traps_fini()
1569 const struct devlink_trap *trap, void *trap_ctx) in mlxsw_sp_trap_init() argument
1575 trap_item = mlxsw_sp_trap_item_lookup(mlxsw_sp, trap->id); in mlxsw_sp_trap_init()
1595 const struct devlink_trap *trap, void *trap_ctx) in mlxsw_sp_trap_fini() argument
1601 trap_item = mlxsw_sp_trap_item_lookup(mlxsw_sp, trap->id); in mlxsw_sp_trap_fini()
1616 const struct devlink_trap *trap, in mlxsw_sp_trap_action_set() argument
1624 trap_item = mlxsw_sp_trap_item_lookup(mlxsw_sp, trap->id); in mlxsw_sp_trap_action_set()
1716 struct mlxsw_sp_trap *trap = mlxsw_sp->trap; in mlxsw_sp_trap_policer_item_init() local
1723 hw_id = find_first_zero_bit(trap->policers_usage, trap->max_policers); in mlxsw_sp_trap_policer_item_init()
1724 if (WARN_ON(hw_id == trap->max_policers)) in mlxsw_sp_trap_policer_item_init()
1727 __set_bit(hw_id, trap->policers_usage); in mlxsw_sp_trap_policer_item_init()
1737 __clear_bit(policer_item->hw_id, mlxsw_sp->trap->policers_usage); in mlxsw_sp_trap_policer_item_fini()
1893 .trap = MLXSW_SP_TRAP_CONTROL(FLOW_ACTION_SAMPLE, ACL_SAMPLE,
1947 .trap = MLXSW_SP_TRAP_BUFFER_DROP(EARLY_DROP),
1954 .trap = MLXSW_SP_TRAP_CONTROL(FLOW_ACTION_SAMPLE, ACL_SAMPLE,