Lines Matching refs:ft

283 mac_flow_add(flow_tab_t *ft, flow_entry_t *flent)  in mac_flow_add()  argument
286 flow_ops_t *ops = &ft->ft_ops; in mac_flow_add()
291 ASSERT(MAC_PERIM_HELD((mac_handle_t)ft->ft_mip)); in mac_flow_add()
297 if ((mask & ft->ft_mask) == 0 || (mask & ~ft->ft_mask) != 0) in mac_flow_add()
303 if ((err = ops->fo_accept_fe(ft, flent)) != 0) { in mac_flow_add()
304 DTRACE_PROBE3(accept_failed, flow_tab_t *, ft, in mac_flow_add()
313 index = ops->fo_hash_fe(ft, flent); in mac_flow_add()
319 rw_enter(&ft->ft_lock, RW_WRITER); in mac_flow_add()
320 headp = &ft->ft_table[index]; in mac_flow_add()
330 if (ft->ft_ops.fo_match_fe(ft, *p, flent)) { in mac_flow_add()
331 rw_exit(&ft->ft_lock); in mac_flow_add()
332 DTRACE_PROBE3(dup_flow, flow_tab_t *, ft, in mac_flow_add()
341 err = ops->fo_insert_fe(ft, headp, flent); in mac_flow_add()
343 rw_exit(&ft->ft_lock); in mac_flow_add()
344 DTRACE_PROBE3(insert_failed, flow_tab_t *, ft, in mac_flow_add()
357 flent->fe_flow_tab = ft; in mac_flow_add()
359 ft->ft_flow_count++; in mac_flow_add()
360 rw_exit(&ft->ft_lock); in mac_flow_add()
370 flow_tab_t *ft = flent->fe_flow_tab; in mac_flow_rem_subflow() local
371 mac_client_impl_t *mcip = ft->ft_mcip; in mac_flow_rem_subflow()
372 mac_handle_t mh = (mac_handle_t)ft->ft_mip; in mac_flow_rem_subflow()
376 mac_flow_remove(ft, flent, B_FALSE); in mac_flow_rem_subflow()
382 if (FLOW_TAB_EMPTY(ft)) { in mac_flow_rem_subflow()
383 mac_flow_tab_destroy(ft); in mac_flow_rem_subflow()
405 flow_tab_t *ft; in mac_flow_add_subflow() local
418 ft = mcip->mci_subflow_tab; in mac_flow_add_subflow()
419 if (ft == NULL) { in mac_flow_add_subflow()
431 mcip->mci_mip, &ft); in mac_flow_add_subflow()
435 err = mac_flow_add(ft, flent); in mac_flow_add_subflow()
438 mac_flow_tab_destroy(ft); in mac_flow_add_subflow()
448 mac_flow_remove(ft, flent, B_FALSE); in mac_flow_add_subflow()
450 mac_flow_tab_destroy(ft); in mac_flow_add_subflow()
459 ft->ft_mcip = mcip; in mac_flow_add_subflow()
460 mcip->mci_subflow_tab = ft; in mac_flow_add_subflow()
471 mac_flow_remove(flow_tab_t *ft, flow_entry_t *flent, boolean_t temp) in mac_flow_remove() argument
475 ASSERT(MAC_PERIM_HELD((mac_handle_t)ft->ft_mip)); in mac_flow_remove()
479 rw_enter(&ft->ft_lock, RW_WRITER); in mac_flow_remove()
491 fp = &ft->ft_table[flent->fe_index]; in mac_flow_remove()
509 ft->ft_flow_count--; in mac_flow_remove()
510 rw_exit(&ft->ft_lock); in mac_flow_remove()
517 mac_flow_lookup(flow_tab_t *ft, mblk_t *mp, uint_t flags, flow_entry_t **flentp) in mac_flow_lookup() argument
521 flow_ops_t *ops = &ft->ft_ops; in mac_flow_lookup()
535 if ((err = (ops->fo_accept[i])(ft, &s)) != 0) { in mac_flow_lookup()
556 DTRACE_PROBE2(need_pullup, flow_tab_t *, ft, in mac_flow_lookup()
566 rw_enter(&ft->ft_lock, RW_READER); in mac_flow_lookup()
567 flent = ft->ft_table[ops->fo_hash(ft, &s)]; in mac_flow_lookup()
569 if (flent->fe_match(ft, flent, &s)) { in mac_flow_lookup()
574 rw_exit(&ft->ft_lock); in mac_flow_lookup()
578 rw_exit(&ft->ft_lock); in mac_flow_lookup()
587 mac_flow_walk_nolock(flow_tab_t *ft, int (*fn)(flow_entry_t *, void *), in mac_flow_walk_nolock() argument
593 if (ft == NULL) in mac_flow_walk_nolock()
596 for (i = 0; i < ft->ft_size; i++) { in mac_flow_walk_nolock()
597 for (flent = ft->ft_table[i]; flent != NULL; in mac_flow_walk_nolock()
605 VERIFY(cnt == ft->ft_flow_count); in mac_flow_walk_nolock()
613 mac_flow_walk(flow_tab_t *ft, int (*fn)(flow_entry_t *, void *), in mac_flow_walk() argument
618 if (ft == NULL) in mac_flow_walk()
621 rw_enter(&ft->ft_lock, RW_WRITER); in mac_flow_walk()
622 err = mac_flow_walk_nolock(ft, fn, arg); in mac_flow_walk()
623 rw_exit(&ft->ft_lock); in mac_flow_walk()
729 mac_flow_modify(flow_tab_t *ft, flow_entry_t *flent, mac_resource_props_t *mrp) in mac_flow_modify() argument
739 ASSERT(MAC_PERIM_HELD((mac_handle_t)ft->ft_mip)); in mac_flow_modify()
741 rw_enter(&ft->ft_lock, RW_WRITER); in mac_flow_modify()
745 rw_exit(&ft->ft_lock); in mac_flow_modify()
897 flow_tab_t *ft = flent->fe_flow_tab; in mac_flow_set_desc() local
901 if (ft == NULL) { in mac_flow_set_desc()
912 ASSERT(MAC_PERIM_HELD((mac_handle_t)ft->ft_mip)); in mac_flow_set_desc()
921 mac_flow_remove(ft, flent, B_TRUE); in mac_flow_set_desc()
928 if (mac_flow_add(ft, flent) != 0) { in mac_flow_set_desc()
934 err = mac_flow_add(ft, flent); in mac_flow_set_desc()
942 flow_tab_t *ft = flent->fe_flow_tab; in mac_flow_set_name() local
944 if (ft == NULL) { in mac_flow_set_name()
951 ASSERT(MAC_PERIM_HELD((mac_handle_t)ft->ft_mip)); in mac_flow_set_name()
986 flow_tab_t *ft; in mac_flow_tab_create() local
989 ft = kmem_cache_alloc(flow_tab_cache, KM_SLEEP); in mac_flow_tab_create()
990 bzero(ft, sizeof (*ft)); in mac_flow_tab_create()
992 ft->ft_table = kmem_zalloc(size * sizeof (flow_entry_t *), KM_SLEEP); in mac_flow_tab_create()
999 new_ops = &ft->ft_ops; in mac_flow_tab_create()
1001 ft->ft_mask = mask; in mac_flow_tab_create()
1002 ft->ft_size = size; in mac_flow_tab_create()
1003 ft->ft_mip = mip; in mac_flow_tab_create()
1016 *ftp = ft; in mac_flow_tab_create()
1030 mac_flow_tab_destroy(flow_tab_t *ft) in mac_flow_tab_destroy() argument
1032 if (ft == NULL) in mac_flow_tab_destroy()
1035 ASSERT(ft->ft_flow_count == 0); in mac_flow_tab_destroy()
1036 kmem_free(ft->ft_table, ft->ft_size * sizeof (flow_entry_t *)); in mac_flow_tab_destroy()
1037 bzero(ft, sizeof (*ft)); in mac_flow_tab_destroy()
1038 kmem_cache_free(flow_tab_cache, ft); in mac_flow_tab_destroy()
1627 flow_l2_match(flow_tab_t *ft, flow_entry_t *flent, flow_state_t *s) in flow_l2_match() argument
1642 flow_l2_hash(flow_tab_t *ft, flow_state_t *s) in flow_l2_hash() argument
1645 ft->ft_mip->mi_type->mt_addr_length, ft->ft_size)); in flow_l2_hash()
1654 flow_l2_accept(flow_tab_t *ft, flow_state_t *s) in flow_l2_accept() argument
1661 is_ether = (ft->ft_mip->mi_info.mi_nativemedia == DL_ETHER); in flow_l2_accept()
1662 if ((err = mac_header_info((mac_handle_t)ft->ft_mip, in flow_l2_accept()
1699 flow_ether_hash(flow_tab_t *ft, flow_state_t *s) in flow_ether_hash() argument
1706 return (HASH_ETHER_VID(l2->l2_daddr, l2->l2_vid, ft->ft_size)); in flow_ether_hash()
1710 flow_ether_hash_fe(flow_tab_t *ft, flow_entry_t *flent) in flow_ether_hash_fe() argument
1715 return (HASH_ETHER_VID(fd->fd_dst_mac, fd->fd_vid, ft->ft_size)); in flow_ether_hash_fe()
1720 flow_ether_accept(flow_tab_t *ft, flow_state_t *s) in flow_ether_accept() argument
1752 flow_l2_accept_fe(flow_tab_t *ft, flow_entry_t *flent) in flow_l2_accept_fe() argument
1767 if (ft->ft_mip->mi_info.mi_nativemedia != DL_ETHER) in flow_l2_accept_fe()
1782 flow_l2_hash_fe(flow_tab_t *ft, flow_entry_t *flent) in flow_l2_hash_fe() argument
1788 ft->ft_mip->mi_type->mt_addr_length, ft->ft_size)); in flow_l2_hash_fe()
1796 flow_l2_match_fe(flow_tab_t *ft, flow_entry_t *f1, flow_entry_t *f2) in flow_l2_match_fe() argument
1811 flow_generic_insert_fe(flow_tab_t *ft, flow_entry_t **headp, in flow_generic_insert_fe() argument
1814 ASSERT(MAC_PERIM_HELD((mac_handle_t)ft->ft_mip)); in flow_generic_insert_fe()
1829 flow_ip_dsfield_match(flow_tab_t *ft, flow_entry_t *flent, flow_state_t *s) in flow_ip_dsfield_match() argument
1860 flow_ip_v4_match(flow_tab_t *ft, flow_entry_t *flent, flow_state_t *s) in flow_ip_v4_match() argument
1878 flow_ip_v6_match(flow_tab_t *ft, flow_entry_t *flent, flow_state_t *s) in flow_ip_v6_match() argument
1895 flow_ip_proto_match(flow_tab_t *ft, flow_entry_t *flent, flow_state_t *s) in flow_ip_proto_match() argument
1904 flow_ip_hash(flow_tab_t *ft, flow_state_t *s) in flow_ip_hash() argument
1907 flow_mask_t mask = ft->ft_mask; in flow_ip_hash()
1922 ASSERT(ft->ft_size >= 2); in flow_ip_hash()
1927 flow_ip_proto_hash(flow_tab_t *ft, flow_state_t *s) in flow_ip_proto_hash() argument
1931 return (l3info->l3_protocol % ft->ft_size); in flow_ip_proto_hash()
1936 flow_ip_accept(flow_tab_t *ft, flow_state_t *s) in flow_ip_accept() argument
1992 flow_ip_proto_accept_fe(flow_tab_t *ft, flow_entry_t *flent) in flow_ip_proto_accept_fe() argument
2011 flow_ip_accept_fe(flow_tab_t *ft, flow_entry_t *flent) in flow_ip_accept_fe() argument
2074 flow_ip_proto_hash_fe(flow_tab_t *ft, flow_entry_t *flent) in flow_ip_proto_hash_fe() argument
2078 return (fd->fd_protocol % ft->ft_size); in flow_ip_proto_hash_fe()
2082 flow_ip_hash_fe(flow_tab_t *ft, flow_entry_t *flent) in flow_ip_hash_fe() argument
2095 ASSERT(ft->ft_size >= 2); in flow_ip_hash_fe()
2101 flow_ip_proto_match_fe(flow_tab_t *ft, flow_entry_t *f1, flow_entry_t *f2) in flow_ip_proto_match_fe() argument
2110 flow_ip_match_fe(flow_tab_t *ft, flow_entry_t *f1, flow_entry_t *f2) in flow_ip_match_fe() argument
2181 flow_ip_insert_fe(flow_tab_t *ft, flow_entry_t **headp, in flow_ip_insert_fe() argument
2189 ASSERT(MAC_PERIM_HELD((mac_handle_t)ft->ft_mip)); in flow_ip_insert_fe()
2250 flow_transport_lport_match(flow_tab_t *ft, flow_entry_t *flent, flow_state_t *s) in flow_transport_lport_match() argument
2262 flow_transport_rport_match(flow_tab_t *ft, flow_entry_t *flent, flow_state_t *s) in flow_transport_rport_match() argument
2279 flow_transport_hash(flow_tab_t *ft, flow_state_t *s) in flow_transport_hash() argument
2286 if ((ft->ft_mask & FLOW_ULP_PORT_LOCAL) != 0) { in flow_transport_hash()
2295 return ((l4info->l4_hash_port ^ (proto << 4)) % ft->ft_size); in flow_transport_hash()
2307 flow_transport_accept(flow_tab_t *ft, flow_state_t *s) in flow_transport_accept() argument
2373 flow_transport_accept_fe(flow_tab_t *ft, flow_entry_t *flent) in flow_transport_accept_fe() argument
2416 flow_transport_hash_fe(flow_tab_t *ft, flow_entry_t *flent) in flow_transport_hash_fe() argument
2424 return ((port ^ (fd->fd_protocol << 4)) % ft->ft_size); in flow_transport_hash_fe()
2429 flow_transport_match_fe(flow_tab_t *ft, flow_entry_t *f1, flow_entry_t *f2) in flow_transport_match_fe() argument