Lines Matching refs:tid
47 int tid) in mvpp2_prs_init_from_hw() argument
51 if (tid > MVPP2_PRS_TCAM_SRAM_SIZE - 1) in mvpp2_prs_init_from_hw()
55 pe->index = tid; in mvpp2_prs_init_from_hw()
367 int tid; in mvpp2_prs_flow_find() local
370 for (tid = MVPP2_PRS_TCAM_SRAM_SIZE - 1; tid >= 0; tid--) { in mvpp2_prs_flow_find()
373 if (!priv->prs_shadow[tid].valid || in mvpp2_prs_flow_find()
374 priv->prs_shadow[tid].lu != MVPP2_PRS_LU_FLOWS) in mvpp2_prs_flow_find()
377 mvpp2_prs_init_from_hw(priv, &pe, tid); in mvpp2_prs_flow_find()
382 return tid; in mvpp2_prs_flow_find()
392 int tid; in mvpp2_prs_tcam_first_free() local
397 for (tid = start; tid <= end; tid++) { in mvpp2_prs_tcam_first_free()
398 if (!priv->prs_shadow[tid].valid) in mvpp2_prs_tcam_first_free()
399 return tid; in mvpp2_prs_tcam_first_free()
478 int tid; in mvpp2_prs_mac_promisc_set() local
482 tid = MVPP2_PE_MAC_UC_PROMISCUOUS; in mvpp2_prs_mac_promisc_set()
486 tid = MVPP2_PE_MAC_MC_PROMISCUOUS; in mvpp2_prs_mac_promisc_set()
491 if (priv->prs_shadow[tid].valid) { in mvpp2_prs_mac_promisc_set()
492 mvpp2_prs_init_from_hw(priv, &pe, tid); in mvpp2_prs_mac_promisc_set()
496 pe.index = tid; in mvpp2_prs_mac_promisc_set()
530 int tid, shift; in mvpp2_prs_dsa_tag_set() local
533 tid = tagged ? MVPP2_PE_EDSA_TAGGED : MVPP2_PE_EDSA_UNTAGGED; in mvpp2_prs_dsa_tag_set()
536 tid = tagged ? MVPP2_PE_DSA_TAGGED : MVPP2_PE_DSA_UNTAGGED; in mvpp2_prs_dsa_tag_set()
540 if (priv->prs_shadow[tid].valid) { in mvpp2_prs_dsa_tag_set()
542 mvpp2_prs_init_from_hw(priv, &pe, tid); in mvpp2_prs_dsa_tag_set()
547 pe.index = tid; in mvpp2_prs_dsa_tag_set()
597 int tid, shift, port_mask; in mvpp2_prs_dsa_tag_ethertype_set() local
600 tid = tagged ? MVPP2_PE_ETYPE_EDSA_TAGGED : in mvpp2_prs_dsa_tag_ethertype_set()
605 tid = tagged ? MVPP2_PE_ETYPE_DSA_TAGGED : in mvpp2_prs_dsa_tag_ethertype_set()
611 if (priv->prs_shadow[tid].valid) { in mvpp2_prs_dsa_tag_ethertype_set()
613 mvpp2_prs_init_from_hw(priv, &pe, tid); in mvpp2_prs_dsa_tag_ethertype_set()
618 pe.index = tid; in mvpp2_prs_dsa_tag_ethertype_set()
664 int tid; in mvpp2_prs_vlan_find() local
667 for (tid = MVPP2_PE_FIRST_FREE_TID; in mvpp2_prs_vlan_find()
668 tid <= MVPP2_PE_LAST_FREE_TID; tid++) { in mvpp2_prs_vlan_find()
672 if (!priv->prs_shadow[tid].valid || in mvpp2_prs_vlan_find()
673 priv->prs_shadow[tid].lu != MVPP2_PRS_LU_VLAN) in mvpp2_prs_vlan_find()
676 mvpp2_prs_init_from_hw(priv, &pe, tid); in mvpp2_prs_vlan_find()
695 return tid; in mvpp2_prs_vlan_find()
706 int tid_aux, tid; in mvpp2_prs_vlan_add() local
711 tid = mvpp2_prs_vlan_find(priv, tpid, ai); in mvpp2_prs_vlan_add()
713 if (tid < 0) { in mvpp2_prs_vlan_add()
715 tid = mvpp2_prs_tcam_first_free(priv, MVPP2_PE_LAST_FREE_TID, in mvpp2_prs_vlan_add()
717 if (tid < 0) in mvpp2_prs_vlan_add()
718 return tid; in mvpp2_prs_vlan_add()
736 if (tid <= tid_aux) in mvpp2_prs_vlan_add()
740 pe.index = tid; in mvpp2_prs_vlan_add()
763 mvpp2_prs_init_from_hw(priv, &pe, tid); in mvpp2_prs_vlan_add()
791 int tid; in mvpp2_prs_double_vlan_find() local
794 for (tid = MVPP2_PE_FIRST_FREE_TID; in mvpp2_prs_double_vlan_find()
795 tid <= MVPP2_PE_LAST_FREE_TID; tid++) { in mvpp2_prs_double_vlan_find()
799 if (!priv->prs_shadow[tid].valid || in mvpp2_prs_double_vlan_find()
800 priv->prs_shadow[tid].lu != MVPP2_PRS_LU_VLAN) in mvpp2_prs_double_vlan_find()
803 mvpp2_prs_init_from_hw(priv, &pe, tid); in mvpp2_prs_double_vlan_find()
813 return tid; in mvpp2_prs_double_vlan_find()
824 int tid_aux, tid, ai, ret = 0; in mvpp2_prs_double_vlan_add() local
829 tid = mvpp2_prs_double_vlan_find(priv, tpid1, tpid2); in mvpp2_prs_double_vlan_add()
831 if (tid < 0) { in mvpp2_prs_double_vlan_add()
833 tid = mvpp2_prs_tcam_first_free(priv, MVPP2_PE_FIRST_FREE_TID, in mvpp2_prs_double_vlan_add()
835 if (tid < 0) in mvpp2_prs_double_vlan_add()
836 return tid; in mvpp2_prs_double_vlan_add()
860 if (tid >= tid_aux) in mvpp2_prs_double_vlan_add()
865 pe.index = tid; in mvpp2_prs_double_vlan_add()
883 mvpp2_prs_init_from_hw(priv, &pe, tid); in mvpp2_prs_double_vlan_add()
898 int tid; in mvpp2_prs_ip4_proto() local
905 tid = mvpp2_prs_tcam_first_free(priv, MVPP2_PE_FIRST_FREE_TID, in mvpp2_prs_ip4_proto()
907 if (tid < 0) in mvpp2_prs_ip4_proto()
908 return tid; in mvpp2_prs_ip4_proto()
912 pe.index = tid; in mvpp2_prs_ip4_proto()
940 tid = mvpp2_prs_tcam_first_free(priv, MVPP2_PE_FIRST_FREE_TID, in mvpp2_prs_ip4_proto()
942 if (tid < 0) in mvpp2_prs_ip4_proto()
943 return tid; in mvpp2_prs_ip4_proto()
945 pe.index = tid; in mvpp2_prs_ip4_proto()
968 int mask, tid; in mvpp2_prs_ip4_cast() local
970 tid = mvpp2_prs_tcam_first_free(priv, MVPP2_PE_FIRST_FREE_TID, in mvpp2_prs_ip4_cast()
972 if (tid < 0) in mvpp2_prs_ip4_cast()
973 return tid; in mvpp2_prs_ip4_cast()
977 pe.index = tid; in mvpp2_prs_ip4_cast()
1025 int tid; in mvpp2_prs_ip6_proto() local
1031 tid = mvpp2_prs_tcam_first_free(priv, MVPP2_PE_FIRST_FREE_TID, in mvpp2_prs_ip6_proto()
1033 if (tid < 0) in mvpp2_prs_ip6_proto()
1034 return tid; in mvpp2_prs_ip6_proto()
1038 pe.index = tid; in mvpp2_prs_ip6_proto()
1065 int tid; in mvpp2_prs_ip6_cast() local
1070 tid = mvpp2_prs_tcam_first_free(priv, MVPP2_PE_FIRST_FREE_TID, in mvpp2_prs_ip6_cast()
1072 if (tid < 0) in mvpp2_prs_ip6_cast()
1073 return tid; in mvpp2_prs_ip6_cast()
1077 pe.index = tid; in mvpp2_prs_ip6_cast()
1334 int tid, ihl; in mvpp2_prs_etype_init() local
1337 tid = mvpp2_prs_tcam_first_free(priv, MVPP2_PE_FIRST_FREE_TID, in mvpp2_prs_etype_init()
1339 if (tid < 0) in mvpp2_prs_etype_init()
1340 return tid; in mvpp2_prs_etype_init()
1344 pe.index = tid; in mvpp2_prs_etype_init()
1363 tid = mvpp2_prs_tcam_first_free(priv, MVPP2_PE_FIRST_FREE_TID, in mvpp2_prs_etype_init()
1365 if (tid < 0) in mvpp2_prs_etype_init()
1366 return tid; in mvpp2_prs_etype_init()
1370 pe.index = tid; in mvpp2_prs_etype_init()
1393 tid = mvpp2_prs_tcam_first_free(priv, MVPP2_PE_FIRST_FREE_TID, in mvpp2_prs_etype_init()
1395 if (tid < 0) in mvpp2_prs_etype_init()
1396 return tid; in mvpp2_prs_etype_init()
1400 pe.index = tid; in mvpp2_prs_etype_init()
1428 tid = mvpp2_prs_tcam_first_free(priv, MVPP2_PE_FIRST_FREE_TID, in mvpp2_prs_etype_init()
1430 if (tid < 0) in mvpp2_prs_etype_init()
1431 return tid; in mvpp2_prs_etype_init()
1435 pe.index = tid; in mvpp2_prs_etype_init()
1465 tid = mvpp2_prs_tcam_first_free(priv, MVPP2_PE_FIRST_FREE_TID, in mvpp2_prs_etype_init()
1467 if (tid < 0) in mvpp2_prs_etype_init()
1468 return tid; in mvpp2_prs_etype_init()
1472 pe.index = tid; in mvpp2_prs_etype_init()
1610 int tid, ihl; in mvpp2_prs_pppoe_init() local
1614 tid = mvpp2_prs_tcam_first_free(priv, MVPP2_PE_FIRST_FREE_TID, in mvpp2_prs_pppoe_init()
1616 if (tid < 0) in mvpp2_prs_pppoe_init()
1617 return tid; in mvpp2_prs_pppoe_init()
1621 pe.index = tid; in mvpp2_prs_pppoe_init()
1651 tid = mvpp2_prs_tcam_first_free(priv, MVPP2_PE_FIRST_FREE_TID, in mvpp2_prs_pppoe_init()
1653 if (tid < 0) in mvpp2_prs_pppoe_init()
1654 return tid; in mvpp2_prs_pppoe_init()
1658 pe.index = tid; in mvpp2_prs_pppoe_init()
1679 tid = mvpp2_prs_tcam_first_free(priv, MVPP2_PE_FIRST_FREE_TID, in mvpp2_prs_pppoe_init()
1681 if (tid < 0) in mvpp2_prs_pppoe_init()
1682 return tid; in mvpp2_prs_pppoe_init()
1686 pe.index = tid; in mvpp2_prs_pppoe_init()
1798 int tid, err; in mvpp2_prs_ip6_init() local
1835 tid = mvpp2_prs_tcam_first_free(priv, MVPP2_PE_FIRST_FREE_TID, in mvpp2_prs_ip6_init()
1837 if (tid < 0) in mvpp2_prs_ip6_init()
1838 return tid; in mvpp2_prs_ip6_init()
1842 pe.index = tid; in mvpp2_prs_ip6_init()
1935 int tid; in mvpp2_prs_vid_range_find() local
1938 for (tid = MVPP2_PRS_VID_PORT_FIRST(port->id); in mvpp2_prs_vid_range_find()
1939 tid <= MVPP2_PRS_VID_PORT_LAST(port->id); tid++) { in mvpp2_prs_vid_range_find()
1940 if (!port->priv->prs_shadow[tid].valid || in mvpp2_prs_vid_range_find()
1941 port->priv->prs_shadow[tid].lu != MVPP2_PRS_LU_VID) in mvpp2_prs_vid_range_find()
1944 mvpp2_prs_init_from_hw(port->priv, &pe, tid); in mvpp2_prs_vid_range_find()
1955 return tid; in mvpp2_prs_vid_range_find()
1969 int tid; in mvpp2_prs_vid_entry_add() local
1974 tid = mvpp2_prs_vid_range_find(port, vid, mask); in mvpp2_prs_vid_entry_add()
1983 if (tid < 0) { in mvpp2_prs_vid_entry_add()
1986 tid = mvpp2_prs_tcam_first_free(priv, vid_start, in mvpp2_prs_vid_entry_add()
1991 if (tid < 0) in mvpp2_prs_vid_entry_add()
1992 return tid; in mvpp2_prs_vid_entry_add()
1995 pe.index = tid; in mvpp2_prs_vid_entry_add()
2000 mvpp2_prs_init_from_hw(priv, &pe, tid); in mvpp2_prs_vid_entry_add()
2029 int tid; in mvpp2_prs_vid_entry_remove() local
2032 tid = mvpp2_prs_vid_range_find(port, vid, 0xfff); in mvpp2_prs_vid_entry_remove()
2035 if (tid < 0) in mvpp2_prs_vid_entry_remove()
2038 mvpp2_prs_hw_inv(priv, tid); in mvpp2_prs_vid_entry_remove()
2039 priv->prs_shadow[tid].valid = false; in mvpp2_prs_vid_entry_remove()
2046 int tid; in mvpp2_prs_vid_remove_all() local
2048 for (tid = MVPP2_PRS_VID_PORT_FIRST(port->id); in mvpp2_prs_vid_remove_all()
2049 tid <= MVPP2_PRS_VID_PORT_LAST(port->id); tid++) { in mvpp2_prs_vid_remove_all()
2050 if (priv->prs_shadow[tid].valid) { in mvpp2_prs_vid_remove_all()
2051 mvpp2_prs_hw_inv(priv, tid); in mvpp2_prs_vid_remove_all()
2052 priv->prs_shadow[tid].valid = false; in mvpp2_prs_vid_remove_all()
2060 unsigned int tid = MVPP2_PRS_VID_PORT_DFLT(port->id); in mvpp2_prs_vid_disable_filtering() local
2064 mvpp2_prs_hw_inv(priv, tid); in mvpp2_prs_vid_disable_filtering()
2066 priv->prs_shadow[tid].valid = false; in mvpp2_prs_vid_disable_filtering()
2072 unsigned int tid = MVPP2_PRS_VID_PORT_DFLT(port->id); in mvpp2_prs_vid_enable_filtering() local
2077 if (priv->prs_shadow[tid].valid) in mvpp2_prs_vid_enable_filtering()
2082 pe.index = tid; in mvpp2_prs_vid_enable_filtering()
2208 int tid; in mvpp2_prs_mac_da_range_find() local
2211 for (tid = MVPP2_PE_MAC_RANGE_START; in mvpp2_prs_mac_da_range_find()
2212 tid <= MVPP2_PE_MAC_RANGE_END; tid++) { in mvpp2_prs_mac_da_range_find()
2215 if (!priv->prs_shadow[tid].valid || in mvpp2_prs_mac_da_range_find()
2216 (priv->prs_shadow[tid].lu != MVPP2_PRS_LU_MAC) || in mvpp2_prs_mac_da_range_find()
2217 (priv->prs_shadow[tid].udf != udf_type)) in mvpp2_prs_mac_da_range_find()
2220 mvpp2_prs_init_from_hw(priv, &pe, tid); in mvpp2_prs_mac_da_range_find()
2225 return tid; in mvpp2_prs_mac_da_range_find()
2238 int tid; in mvpp2_prs_mac_da_accept() local
2243 tid = mvpp2_prs_mac_da_range_find(priv, BIT(port->id), da, mask, in mvpp2_prs_mac_da_accept()
2247 if (tid < 0) { in mvpp2_prs_mac_da_accept()
2253 tid = mvpp2_prs_tcam_first_free(priv, in mvpp2_prs_mac_da_accept()
2256 if (tid < 0) in mvpp2_prs_mac_da_accept()
2257 return tid; in mvpp2_prs_mac_da_accept()
2259 pe.index = tid; in mvpp2_prs_mac_da_accept()
2264 mvpp2_prs_init_from_hw(priv, &pe, tid); in mvpp2_prs_mac_da_accept()
2346 int index, tid; in mvpp2_prs_mac_del_all() local
2348 for (tid = MVPP2_PE_MAC_RANGE_START; in mvpp2_prs_mac_del_all()
2349 tid <= MVPP2_PE_MAC_RANGE_END; tid++) { in mvpp2_prs_mac_del_all()
2352 if (!priv->prs_shadow[tid].valid || in mvpp2_prs_mac_del_all()
2353 (priv->prs_shadow[tid].lu != MVPP2_PRS_LU_MAC) || in mvpp2_prs_mac_del_all()
2354 (priv->prs_shadow[tid].udf != MVPP2_PRS_UDF_MAC_DEF)) in mvpp2_prs_mac_del_all()
2357 mvpp2_prs_init_from_hw(priv, &pe, tid); in mvpp2_prs_mac_del_all()
2436 int tid, i; in mvpp2_prs_add_flow() local
2440 tid = mvpp2_prs_tcam_first_free(priv, in mvpp2_prs_add_flow()
2443 if (tid < 0) in mvpp2_prs_add_flow()
2444 return tid; in mvpp2_prs_add_flow()
2446 pe.index = tid; in mvpp2_prs_add_flow()
2471 int tid; in mvpp2_prs_def_flow() local
2475 tid = mvpp2_prs_flow_find(port->priv, port->id); in mvpp2_prs_def_flow()
2478 if (tid < 0) { in mvpp2_prs_def_flow()
2480 tid = mvpp2_prs_tcam_first_free(port->priv, in mvpp2_prs_def_flow()
2483 if (tid < 0) in mvpp2_prs_def_flow()
2484 return tid; in mvpp2_prs_def_flow()
2486 pe.index = tid; in mvpp2_prs_def_flow()
2495 mvpp2_prs_init_from_hw(port->priv, &pe, tid); in mvpp2_prs_def_flow()