Page MenuHomeFreeBSD

Use epoch(9) for rtentries to simplify control plane operations.
ClosedPublic

Authored by melifaro on May 16 2020, 7:56 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 14 2024, 8:50 AM
Unknown Object (File)
Mar 14 2024, 8:50 AM
Unknown Object (File)
Mar 14 2024, 8:50 AM
Unknown Object (File)
Mar 14 2024, 8:50 AM
Unknown Object (File)
Mar 10 2024, 10:55 PM
Unknown Object (File)
Jan 7 2024, 9:14 PM
Unknown Object (File)
Jan 3 2024, 3:42 PM
Unknown Object (File)
Jan 3 2024, 3:42 PM
Subscribers

Details

Summary

Currently the only reason of refcounting rtentries is the need to report the rtable operation details immediately after the execution.
Delaying rtentry reclamation allows to stop refcounting and simplify the code.

Additionally, this change allows to reimplement rib_lookup_info(), which is used by some of the customers to get the matching prefix along with nexthops, in more efficient way.

The change keeps per-vnet rtzone uma zone. It adds nh_vnet field to nhop_priv to be able to reliably set curvnet even during vnet teardown.

Rest of the reference conuting code will be removed in the D24867 .

Test Plan
divert:ipdivert_ip_input_local_success  ->  passed  [2.045s]
divert:ipdivert_ip_output_remote_success  ->  passed  [0.802s]
fibs_test:arpresolve_checks_interface_fib  ->  skipped: Required configuration property 'fibs' not defined  [0.002s]
fibs_test:default_route_with_multiple_fibs_on_same_subnet  ->  skipped: Required configuration property 'fibs' not defined  [0.002s]
fibs_test:default_route_with_multiple_fibs_on_same_subnet_inet6  ->  skipped: Required configuration property 'fibs' not defined  [0.003s]
fibs_test:loopback_and_network_routes_on_nondefault_fib  ->  skipped: Required configuration property 'fibs' not defined  [0.003s]
fibs_test:loopback_and_network_routes_on_nondefault_fib_inet6  ->  skipped: Required configuration property 'fibs' not defined  [0.002s]
fibs_test:same_ip_multiple_ifaces  ->  skipped: Required configuration property 'fibs' not defined  [0.002s]
fibs_test:same_ip_multiple_ifaces_fib0  ->  skipped: Required configuration property 'fibs' not defined  [0.001s]
fibs_test:same_ip_multiple_ifaces_inet6  ->  skipped: Required configuration property 'fibs' not defined  [0.003s]
fibs_test:slaac_on_nondefault_fib6  ->  skipped: Required configuration property 'allow_sysctl_side_effects' not defined  [0.003s]
fibs_test:subnet_route_with_multiple_fibs_on_same_subnet  ->  skipped: Required configuration property 'fibs' not defined  [0.003s]
fibs_test:subnet_route_with_multiple_fibs_on_same_subnet_inet6  ->  skipped: Required configuration property 'fibs' not defined  [0.003s]
fibs_test:udp_dontroute  ->  skipped: Required configuration property 'fibs' not defined  [0.004s]
fibs_test:udp_dontroute6  ->  skipped: Required configuration property 'fibs' not defined  [0.002s]
forward:fwd_ip_icmp_gw_fast_success  ->  passed  [1.318s]
forward:fwd_ip_icmp_gw_slow_success  ->  passed  [0.938s]
forward:fwd_ip_icmp_iface_fast_success  ->  passed  [0.826s]
forward:fwd_ip_icmp_iface_slow_success  ->  passed  [0.814s]
ip_reass_test:ip_reass__large_fragment  ->  passed  [0.016s]
ip_reass_test:ip_reass__multiple_last_fragments  ->  passed  [0.032s]
ip_reass_test:ip_reass__zero_length_fragment  ->  passed  [0.017s]
output:output_raw_flowid_mpath_success  ->  skipped: This test requires ROUTE_MPATH enabled  [0.020s]
output:output_raw_success  ->  passed  [0.083s]
output:output_tcp_flowid_mpath_success  ->  skipped: This test requires ROUTE_MPATH enabled  [0.019s]
output:output_tcp_setup_success  ->  passed  [0.138s]
output:output_udp_flowid_mpath_success  ->  skipped: This test requires ROUTE_MPATH enabled  [0.023s]
output:output_udp_setup_success  ->  passed  [1.264s]
redirect:valid_redirect  ->  passed  [0.792s]
so_reuseport_lb_test:basic_ipv4  ->  passed  [0.622s]
so_reuseport_lb_test:basic_ipv6  ->  passed  [0.691s]
socket_afinet:socket_afinet  ->  passed  [0.003s]
socket_afinet:socket_afinet_bind_ok  ->  passed  [0.002s]
socket_afinet:socket_afinet_bind_zero  ->  skipped: doesn't work when mac_portacl(4) loaded (bug238781)  [0.002s]

Results file id is usr_tests_sys_netinet.20200516-195811-478330
Results saved to /home/melifaro/.kyua/store/results.usr_tests_sys_netinet.20200516-195811-478330.db

34/34 passed (0 failed)
divert:ipdivert_ip6_output_remote_success  ->  passed  [2.742s]
forward6:fwd_ip6_gu_icmp_gw_gu_fast_success  ->  passed  [2.483s]
forward6:fwd_ip6_gu_icmp_gw_gu_slow_success  ->  passed  [2.615s]
forward6:fwd_ip6_gu_icmp_gw_ll_fast_success  ->  passed  [2.794s]
forward6:fwd_ip6_gu_icmp_gw_ll_slow_success  ->  passed  [2.303s]
forward6:fwd_ip6_gu_icmp_iface_fast_success  ->  passed  [2.567s]
forward6:fwd_ip6_gu_icmp_iface_slow_success  ->  passed  [2.179s]
mld:mldraw01  ->  passed  [3.906s]
output6:output6_raw_flowid_mpath_success  ->  skipped: This test requires ROUTE_MPATH enabled  [0.020s]
output6:output6_raw_success  ->  passed  [1.571s]
output6:output6_tcp_flowid_mpath_success  ->  skipped: This test requires ROUTE_MPATH enabled  [0.029s]
output6:output6_tcp_setup_success  ->  passed  [2.009s]
output6:output6_udp_flowid_mpath_success  ->  skipped: This test requires ROUTE_MPATH enabled  [0.030s]
output6:output6_udp_setup_success  ->  passed  [3.051s]
redirect:valid_redirect  ->  passed  [2.795s]
scapyi386:scapyi386  ->  passed  [3.870s]

Results file id is usr_tests_sys_netinet6.20200516-195825-335954
Results saved to /root/.kyua/store/results.usr_tests_sys_netinet6.20200516-195825-335954.db

16/16 passed (0 failed)
test_rtsock_l3:rtm_add_v4_gu_ifa_ordered_success  ->  passed  [0.007s]
test_rtsock_l3:rtm_add_v4_gw_direct_success  ->  passed  [0.009s]
test_rtsock_l3:rtm_add_v4_temporal1_success  ->  passed  [0.016s]
test_rtsock_l3:rtm_add_v6_gu_gw_gu_direct_success  ->  passed  [0.011s]
test_rtsock_l3:rtm_add_v6_gu_ifa_hostroute_success  ->  passed  [0.008s]
test_rtsock_l3:rtm_add_v6_gu_ifa_ordered_success  ->  passed  [0.009s]
test_rtsock_l3:rtm_add_v6_gu_ifa_prefixroute_success  ->  passed  [0.007s]
test_rtsock_l3:rtm_add_v6_temporal1_success  ->  passed  [0.015s]
test_rtsock_l3:rtm_del_v4_gu_ifa_prefixroute_success  ->  passed  [0.017s]
test_rtsock_l3:rtm_del_v4_prefix_nogw_success  ->  passed  [0.010s]
test_rtsock_l3:rtm_del_v6_gu_ifa_hostroute_success  ->  passed  [0.017s]
test_rtsock_l3:rtm_del_v6_gu_ifa_prefixroute_success  ->  passed  [0.012s]
test_rtsock_l3:rtm_del_v6_gu_prefix_nogw_success  ->  passed  [0.008s]
test_rtsock_l3:rtm_get_v4_empty_dst_failure  ->  passed  [0.004s]
test_rtsock_l3:rtm_get_v4_exact_success  ->  passed  [0.006s]
test_rtsock_l3:rtm_get_v4_hostbits_failure  ->  passed  [0.009s]
test_rtsock_l3:rtm_get_v4_lpm_success  ->  passed  [0.012s]
test_rtsock_lladdr:rtm_add_v4_gu_lle_success  ->  passed  [0.008s]
test_rtsock_lladdr:rtm_add_v6_gu_lle_success  ->  passed  [0.004s]
test_rtsock_lladdr:rtm_add_v6_ll_lle_success  ->  passed  [0.010s]
test_rtsock_lladdr:rtm_del_v4_gu_lle_success  ->  passed  [0.010s]
test_rtsock_lladdr:rtm_del_v6_gu_lle_success  ->  passed  [0.006s]
test_rtsock_lladdr:rtm_del_v6_ll_lle_success  ->  passed  [0.005s]

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

melifaro edited the test plan for this revision. (Show Details)

Fix bootp_subr.c change.
Remove now-unused rtfree_func().

This revision was not accepted when it landed; it landed in state Needs Review.May 23 2020, 10:21 AM
This revision was automatically updated to reflect the committed changes.