Lines Matching refs:group
766 static int of_dpa_group_add(OfDpa *of_dpa, OfDpaGroup *group) in of_dpa_group_add() argument
768 g_hash_table_insert(of_dpa->group_tbl, &group->id, group); in of_dpa_group_add()
774 static int of_dpa_group_mod(OfDpa *of_dpa, OfDpaGroup *group)
776 OfDpaGroup *old_group = of_dpa_group_find(of_dpa, group->id);
788 static int of_dpa_group_del(OfDpa *of_dpa, OfDpaGroup *group) in of_dpa_group_del() argument
790 g_hash_table_remove(of_dpa->group_tbl, &group->id); in of_dpa_group_del()
798 OfDpaGroup *group = of_dpa_group_find(of_dpa, id);
800 if (!group) {
812 OfDpaGroup *group = g_new0(OfDpaGroup, 1); in of_dpa_group_alloc() local
814 group->id = id; in of_dpa_group_alloc()
816 return group; in of_dpa_group_alloc()
820 OfDpaGroup *group) in of_dpa_output_l2_interface() argument
824 if (group->l2_interface.pop_vlan) { in of_dpa_output_l2_interface()
835 if (group->l2_interface.out_pport == 0) { in of_dpa_output_l2_interface()
838 } else if (group->l2_interface.out_pport != fc->in_pport) { in of_dpa_output_l2_interface()
840 group->l2_interface.out_pport, in of_dpa_output_l2_interface()
846 OfDpaGroup *group) in of_dpa_output_l2_rewrite() argument
849 of_dpa_group_find(fc->of_dpa, group->l2_rewrite.group_id); in of_dpa_output_l2_rewrite()
855 of_dpa_flow_pkt_hdr_rewrite(fc, group->l2_rewrite.src_mac.a, in of_dpa_output_l2_rewrite()
856 group->l2_rewrite.dst_mac.a, in of_dpa_output_l2_rewrite()
857 group->l2_rewrite.vlan_id); in of_dpa_output_l2_rewrite()
862 OfDpaGroup *group) in of_dpa_output_l2_flood() argument
867 for (i = 0; i < group->l2_flood.group_count; i++) { in of_dpa_output_l2_flood()
869 l2_group = of_dpa_group_find(fc->of_dpa, group->l2_flood.group_ids[i]); in of_dpa_output_l2_flood()
884 static void of_dpa_output_l3_unicast(OfDpaFlowContext *fc, OfDpaGroup *group) in of_dpa_output_l3_unicast() argument
887 of_dpa_group_find(fc->of_dpa, group->l3_unicast.group_id); in of_dpa_output_l3_unicast()
893 of_dpa_flow_pkt_hdr_rewrite(fc, group->l3_unicast.src_mac.a, in of_dpa_output_l3_unicast()
894 group->l3_unicast.dst_mac.a, in of_dpa_output_l3_unicast()
895 group->l3_unicast.vlan_id); in of_dpa_output_l3_unicast()
903 OfDpaGroup *group; in of_dpa_eg() local
910 group = of_dpa_group_find(fc->of_dpa, group_id); in of_dpa_eg()
911 if (group) { in of_dpa_eg()
912 of_dpa_output_l2_interface(fc, group); in of_dpa_eg()
923 group = of_dpa_group_find(fc->of_dpa, set->write.group_id); in of_dpa_eg()
924 if (!group) { in of_dpa_eg()
928 switch (ROCKER_GROUP_TYPE_GET(group->id)) { in of_dpa_eg()
930 of_dpa_output_l2_interface(fc, group); in of_dpa_eg()
933 of_dpa_output_l2_rewrite(fc, group); in of_dpa_eg()
937 of_dpa_output_l2_flood(fc, group); in of_dpa_eg()
940 of_dpa_output_l3_unicast(fc, group); in of_dpa_eg()
1956 static int of_dpa_cmd_add_l2_interface(OfDpaGroup *group, in of_dpa_cmd_add_l2_interface() argument
1964 group->l2_interface.out_pport = in of_dpa_cmd_add_l2_interface()
1966 group->l2_interface.pop_vlan = in of_dpa_cmd_add_l2_interface()
1972 static int of_dpa_cmd_add_l2_rewrite(OfDpa *of_dpa, OfDpaGroup *group, in of_dpa_cmd_add_l2_rewrite() argument
1981 group->l2_rewrite.group_id = in of_dpa_cmd_add_l2_rewrite()
1984 l2_interface_group = of_dpa_group_find(of_dpa, group->l2_rewrite.group_id); in of_dpa_cmd_add_l2_rewrite()
1993 memcpy(group->l2_rewrite.src_mac.a, in of_dpa_cmd_add_l2_rewrite()
1995 sizeof(group->l2_rewrite.src_mac.a)); in of_dpa_cmd_add_l2_rewrite()
1999 memcpy(group->l2_rewrite.dst_mac.a, in of_dpa_cmd_add_l2_rewrite()
2001 sizeof(group->l2_rewrite.dst_mac.a)); in of_dpa_cmd_add_l2_rewrite()
2005 group->l2_rewrite.vlan_id = in of_dpa_cmd_add_l2_rewrite()
2008 (ntohs(group->l2_rewrite.vlan_id) & VLAN_VID_MASK)) { in of_dpa_cmd_add_l2_rewrite()
2017 static int of_dpa_cmd_add_l2_flood(OfDpa *of_dpa, OfDpaGroup *group, in of_dpa_cmd_add_l2_flood() argument
2030 group->l2_flood.group_count = in of_dpa_cmd_add_l2_flood()
2033 tlvs = g_new0(RockerTlv *, group->l2_flood.group_count + 1); in of_dpa_cmd_add_l2_flood()
2035 g_free(group->l2_flood.group_ids); in of_dpa_cmd_add_l2_flood()
2036 group->l2_flood.group_ids = in of_dpa_cmd_add_l2_flood()
2037 g_new0(uint32_t, group->l2_flood.group_count); in of_dpa_cmd_add_l2_flood()
2039 rocker_tlv_parse_nested(tlvs, group->l2_flood.group_count, in of_dpa_cmd_add_l2_flood()
2042 for (i = 0; i < group->l2_flood.group_count; i++) { in of_dpa_cmd_add_l2_flood()
2043 group->l2_flood.group_ids[i] = rocker_tlv_get_le32(tlvs[i + 1]); in of_dpa_cmd_add_l2_flood()
2050 for (i = 0; i < group->l2_flood.group_count; i++) { in of_dpa_cmd_add_l2_flood()
2051 l2_group = of_dpa_group_find(of_dpa, group->l2_flood.group_ids[i]); in of_dpa_cmd_add_l2_flood()
2058 ROCKER_GROUP_VLAN_GET(group->id))) { in of_dpa_cmd_add_l2_flood()
2061 group->l2_flood.group_ids[i], group->id); in of_dpa_cmd_add_l2_flood()
2071 group->l2_flood.group_count = 0; in of_dpa_cmd_add_l2_flood()
2072 g_free(group->l2_flood.group_ids); in of_dpa_cmd_add_l2_flood()
2078 static int of_dpa_cmd_add_l3_unicast(OfDpaGroup *group, RockerTlv **group_tlvs) in of_dpa_cmd_add_l3_unicast() argument
2084 group->l3_unicast.group_id = in of_dpa_cmd_add_l3_unicast()
2088 memcpy(group->l3_unicast.src_mac.a, in of_dpa_cmd_add_l3_unicast()
2090 sizeof(group->l3_unicast.src_mac.a)); in of_dpa_cmd_add_l3_unicast()
2094 memcpy(group->l3_unicast.dst_mac.a, in of_dpa_cmd_add_l3_unicast()
2096 sizeof(group->l3_unicast.dst_mac.a)); in of_dpa_cmd_add_l3_unicast()
2100 group->l3_unicast.vlan_id = in of_dpa_cmd_add_l3_unicast()
2105 group->l3_unicast.ttl_check = in of_dpa_cmd_add_l3_unicast()
2113 OfDpaGroup *group, RockerTlv **group_tlvs) in of_dpa_cmd_group_do() argument
2119 return of_dpa_cmd_add_l2_interface(group, group_tlvs); in of_dpa_cmd_group_do()
2121 return of_dpa_cmd_add_l2_rewrite(of_dpa, group, group_tlvs); in of_dpa_cmd_group_do()
2125 return of_dpa_cmd_add_l2_flood(of_dpa, group, group_tlvs); in of_dpa_cmd_group_do()
2127 return of_dpa_cmd_add_l3_unicast(group, group_tlvs); in of_dpa_cmd_group_do()
2136 OfDpaGroup *group = of_dpa_group_find(of_dpa, group_id); in of_dpa_cmd_group_add() local
2139 if (group) { in of_dpa_cmd_group_add()
2143 group = of_dpa_group_alloc(group_id); in of_dpa_cmd_group_add()
2145 err = of_dpa_cmd_group_do(of_dpa, group_id, group, group_tlvs); in of_dpa_cmd_group_add()
2150 err = of_dpa_group_add(of_dpa, group); in of_dpa_cmd_group_add()
2158 g_free(group); in of_dpa_cmd_group_add()
2165 OfDpaGroup *group = of_dpa_group_find(of_dpa, group_id); in of_dpa_cmd_group_mod() local
2167 if (!group) { in of_dpa_cmd_group_mod()
2171 return of_dpa_cmd_group_do(of_dpa, group_id, group, group_tlvs); in of_dpa_cmd_group_mod()
2176 OfDpaGroup *group = of_dpa_group_find(of_dpa, group_id); in of_dpa_cmd_group_del() local
2178 if (!group) { in of_dpa_cmd_group_del()
2182 return of_dpa_group_del(of_dpa, group); in of_dpa_cmd_group_del()
2462 struct of_dpa_group *group = value; in of_dpa_group_fill() local
2468 flow_context->type != ROCKER_GROUP_TYPE_GET(group->id)) { in of_dpa_group_fill()
2474 ngroup->id = group->id; in of_dpa_group_fill()
2476 ngroup->type = ROCKER_GROUP_TYPE_GET(group->id); in of_dpa_group_fill()
2481 ngroup->vlan_id = ROCKER_GROUP_VLAN_GET(group->id); in of_dpa_group_fill()
2483 ngroup->pport = ROCKER_GROUP_PORT_GET(group->id); in of_dpa_group_fill()
2485 ngroup->out_pport = group->l2_interface.out_pport; in of_dpa_group_fill()
2487 ngroup->pop_vlan = group->l2_interface.pop_vlan; in of_dpa_group_fill()
2491 ngroup->index = ROCKER_GROUP_INDEX_LONG_GET(group->id); in of_dpa_group_fill()
2493 ngroup->group_id = group->l2_rewrite.group_id; in of_dpa_group_fill()
2494 if (group->l2_rewrite.vlan_id) { in of_dpa_group_fill()
2496 ngroup->set_vlan_id = ntohs(group->l2_rewrite.vlan_id); in of_dpa_group_fill()
2498 if (memcmp(group->l2_rewrite.src_mac.a, zero_mac.a, ETH_ALEN)) { in of_dpa_group_fill()
2500 qemu_mac_strdup_printf(group->l2_rewrite.src_mac.a); in of_dpa_group_fill()
2502 if (memcmp(group->l2_rewrite.dst_mac.a, zero_mac.a, ETH_ALEN)) { in of_dpa_group_fill()
2504 qemu_mac_strdup_printf(group->l2_rewrite.dst_mac.a); in of_dpa_group_fill()
2510 ngroup->vlan_id = ROCKER_GROUP_VLAN_GET(group->id); in of_dpa_group_fill()
2512 ngroup->index = ROCKER_GROUP_INDEX_GET(group->id); in of_dpa_group_fill()
2513 for (i = 0; i < group->l2_flood.group_count; i++) { in of_dpa_group_fill()
2515 QAPI_LIST_PREPEND(ngroup->group_ids, group->l2_flood.group_ids[i]); in of_dpa_group_fill()
2520 ngroup->index = ROCKER_GROUP_INDEX_LONG_GET(group->id); in of_dpa_group_fill()
2522 ngroup->group_id = group->l3_unicast.group_id; in of_dpa_group_fill()
2523 if (group->l3_unicast.vlan_id) { in of_dpa_group_fill()
2525 ngroup->set_vlan_id = ntohs(group->l3_unicast.vlan_id); in of_dpa_group_fill()
2527 if (memcmp(group->l3_unicast.src_mac.a, zero_mac.a, ETH_ALEN)) { in of_dpa_group_fill()
2529 qemu_mac_strdup_printf(group->l3_unicast.src_mac.a); in of_dpa_group_fill()
2531 if (memcmp(group->l3_unicast.dst_mac.a, zero_mac.a, ETH_ALEN)) { in of_dpa_group_fill()
2533 qemu_mac_strdup_printf(group->l3_unicast.dst_mac.a); in of_dpa_group_fill()
2535 if (group->l3_unicast.ttl_check) { in of_dpa_group_fill()
2537 ngroup->ttl_check = group->l3_unicast.ttl_check; in of_dpa_group_fill()