opnsense-src/sys/netgraph
Gleb Smirnoff b8a6e03fac Widen NET_EPOCH coverage.
When epoch(9) was introduced to network stack, it was basically
dropped in place of existing locking, which was mutexes and
rwlocks. For the sake of performance mutex covered areas were
as small as possible, so became epoch covered areas.

However, epoch doesn't introduce any contention, it just delays
memory reclaim. So, there is no point to minimise epoch covered
areas in sense of performance. Meanwhile entering/exiting epoch
also has non-zero CPU usage, so doing this less often is a win.

Not the least is also code maintainability. In the new paradigm
we can assume that at any stage of processing a packet, we are
inside network epoch. This makes coding both input and output
path way easier.

On output path we already enter epoch quite early - in the
ip_output(), in the ip6_output().

This patch does the same for the input path. All ISR processing,
network related callouts, other ways of packet injection to the
network stack shall be performed in net_epoch. Any leaf function
that walks network configuration now asserts epoch.

Tricky part is configuration code paths - ioctls, sysctls. They
also call into leaf functions, so some need to be changed.

This patch would introduce more epoch recursions (see EPOCH_TRACE)
than we had before. They will be cleaned up separately, as several
of them aren't trivial. Note, that unlike a lock recursion the
epoch recursion is safe and just wastes a bit of resources.

Reviewed by:	gallatin, hselasky, cy, adrian, kristof
Differential Revision:	https://reviews.freebsd.org/D19111
2019-10-07 22:40:05 +00:00
..
atm sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
bluetooth avoid holding PCB mutex during copyin/copyout() 2019-08-30 16:35:31 +00:00
netflow sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
netgraph.h sys/netgraph: spelling fixes in comments. 2016-04-29 21:25:05 +00:00
ng_async.c
ng_async.h
ng_atmllc.c Correct pseudo misspelling in sys/ comments 2018-02-23 18:15:50 +00:00
ng_atmllc.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
ng_base.c Remove extra M_ZERO from NG_MKRESPONSE() argument. 2018-08-20 14:35:54 +00:00
ng_bpf.c
ng_bpf.h
ng_bridge.c Fix build failure from r353026. Somehow module build allowed this. 2019-10-03 04:41:57 +00:00
ng_bridge.h - Remove the compile time limit for number of links a ng_bridge node 2019-10-03 02:32:55 +00:00
ng_car.c sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
ng_car.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
ng_checksum.c netgraph module for reconstructing checksums 2016-08-01 12:09:04 +00:00
ng_checksum.h netgraph module for reconstructing checksums 2016-08-01 12:09:04 +00:00
ng_cisco.c
ng_cisco.h
ng_deflate.c Convert ng_deflate to use new zlib. 2019-08-23 07:24:36 +00:00
ng_deflate.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
ng_device.c sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
ng_device.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
ng_echo.c
ng_echo.h
ng_eiface.c Use the new VNET_DEFINE_STATIC macro when we are defining static VNET 2018-07-24 16:35:52 +00:00
ng_eiface.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
ng_etf.c sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
ng_etf.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
ng_ether.c Widen NET_EPOCH coverage. 2019-10-07 22:40:05 +00:00
ng_ether.h
ng_ether_echo.c
ng_ether_echo.h
ng_frame_relay.c sys/netgraph: spelling fixes in comments. 2016-04-29 21:25:05 +00:00
ng_frame_relay.h
ng_gif.c Catch up two more places to the V_ifnet change to a CK_STAILQ. 2018-05-24 00:06:55 +00:00
ng_gif.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
ng_gif_demux.c sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
ng_gif_demux.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
ng_hole.c
ng_hole.h
ng_hub.c sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
ng_hub.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
ng_iface.c Widen NET_EPOCH coverage. 2019-10-07 22:40:05 +00:00
ng_iface.h Use if_tunnel_check_nesting() for ng_iface(4). 2018-08-03 22:55:58 +00:00
ng_ip_input.c Widen NET_EPOCH coverage. 2019-10-07 22:40:05 +00:00
ng_ip_input.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
ng_ipfw.c Remove 'dir' argument in ng_ipfw_input, since ip_fw_args now has this info. 2019-03-14 22:30:05 +00:00
ng_ipfw.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
ng_ksocket.c Check return value from soaccept(). 2017-06-14 16:13:20 +00:00
ng_ksocket.h
ng_l2tp.c Protect access to seq->xwin[] with the seq mutex. 2019-10-03 02:34:51 +00:00
ng_l2tp.h sys/netgraph: spelling fixes in comments. 2016-04-29 21:25:05 +00:00
ng_lmi.c sys/netgraph: spelling fixes in comments. 2016-04-29 21:25:05 +00:00
ng_lmi.h
ng_message.h
ng_mppc.c mppc - Finish pluging NETGRAPH_MPPC_COMPRESSION. 2017-01-20 00:02:11 +00:00
ng_mppc.h
ng_nat.c Allow ng_nat to be attached to a ethernet interface directly via ng_ether(4) 2018-12-17 16:00:35 +00:00
ng_nat.h Allow ng_nat to be attached to a ethernet interface directly via ng_ether(4) 2018-12-17 16:00:35 +00:00
ng_one2many.c sys/netgraph: spelling fixes in comments. 2016-04-29 21:25:05 +00:00
ng_one2many.h
ng_parse.c Revert r327828, r327949, r327953, r328016-r328026, r328041: 2018-01-21 15:42:36 +00:00
ng_parse.h
ng_patch.c sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
ng_patch.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
ng_pipe.c sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
ng_pipe.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
ng_ppp.c sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
ng_ppp.h
ng_pppoe.c ng_pppoe(8): add support for user-supplied Host-Uniq tag. 2018-02-14 21:17:44 +00:00
ng_pppoe.h ng_pppoe(8): add support for user-supplied Host-Uniq tag. 2018-02-14 21:17:44 +00:00
ng_pptpgre.c Make ng_pptpgre(8) netgraph node be able to restore order for packets 2018-11-04 19:10:44 +00:00
ng_pptpgre.h Make ng_pptpgre(8) netgraph node be able to restore order for packets 2018-11-04 19:10:44 +00:00
ng_pred1.c sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
ng_pred1.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
ng_rfc1490.c
ng_rfc1490.h
ng_sample.c sys/netgraph: spelling fixes in comments. 2016-04-29 21:25:05 +00:00
ng_sample.h
ng_socket.c sys: use our nitems() macro when param.h is available. 2016-04-21 19:40:10 +00:00
ng_socket.h
ng_socketvar.h
ng_source.c ng_source(4): correction after the change r340617 2018-11-27 04:05:38 +00:00
ng_source.h
ng_split.c sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
ng_split.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
ng_sppp.c
ng_sppp.h
ng_tag.c sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
ng_tag.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
ng_tcpmss.c sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
ng_tcpmss.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
ng_tee.c sys/netgraph: spelling fixes in comments. 2016-04-29 21:25:05 +00:00
ng_tee.h
ng_tty.c sys/netgraph: spelling fixes in comments. 2016-04-29 21:25:05 +00:00
ng_tty.h
ng_UI.c
ng_UI.h
ng_vjc.c sys/netgraph: spelling fixes in comments. 2016-04-29 21:25:05 +00:00
ng_vjc.h
ng_vlan.c sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
ng_vlan.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
NOTES