freebsd-skq/sys/netgraph
Mark Murray d1b06863fb Huge cleanup of random(4) code.
* GENERAL
- Update copyright.
- Make kernel options for RANDOM_YARROW and RANDOM_DUMMY. Set
  neither to ON, which means we want Fortuna
- If there is no 'device random' in the kernel, there will be NO
  random(4) device in the kernel, and the KERN_ARND sysctl will
  return nothing. With RANDOM_DUMMY there will be a random(4) that
  always blocks.
- Repair kern.arandom (KERN_ARND sysctl). The old version went
  through arc4random(9) and was a bit weird.
- Adjust arc4random stirring a bit - the existing code looks a little
  suspect.
- Fix the nasty pre- and post-read overloading by providing explictit
  functions to do these tasks.
- Redo read_random(9) so as to duplicate random(4)'s read internals.
  This makes it a first-class citizen rather than a hack.
- Move stuff out of locked regions when it does not need to be
  there.
- Trim RANDOM_DEBUG printfs. Some are excess to requirement, some
  behind boot verbose.
- Use SYSINIT to sequence the startup.
- Fix init/deinit sysctl stuff.
- Make relevant sysctls also tunables.
- Add different harvesting "styles" to allow for different requirements
  (direct, queue, fast).
- Add harvesting of FFS atime events. This needs to be checked for
  weighing down the FS code.
- Add harvesting of slab allocator events. This needs to be checked for
  weighing down the allocator code.
- Fix the random(9) manpage.
- Loadable modules are not present for now. These will be re-engineered
  when the dust settles.
- Use macros for locks.
- Fix comments.

* src/share/man/...
- Update the man pages.

* src/etc/...
- The startup/shutdown work is done in D2924.

* src/UPDATING
- Add UPDATING announcement.

* src/sys/dev/random/build.sh
- Add copyright.
- Add libz for unit tests.

* src/sys/dev/random/dummy.c
- Remove; no longer needed. Functionality incorporated into randomdev.*.

* live_entropy_sources.c live_entropy_sources.h
- Remove; content moved.
- move content to randomdev.[ch] and optimise.

* src/sys/dev/random/random_adaptors.c src/sys/dev/random/random_adaptors.h
- Remove; plugability is no longer used. Compile-time algorithm
  selection is the way to go.

* src/sys/dev/random/random_harvestq.c src/sys/dev/random/random_harvestq.h
- Add early (re)boot-time randomness caching.

* src/sys/dev/random/randomdev_soft.c src/sys/dev/random/randomdev_soft.h
- Remove; no longer needed.

* src/sys/dev/random/uint128.h
- Provide a fake uint128_t; if a real one ever arrived, we can use
  that instead. All that is needed here is N=0, N++, N==0, and some
  localised trickery is used to manufacture a 128-bit 0ULLL.

* src/sys/dev/random/unit_test.c src/sys/dev/random/unit_test.h
- Improve unit tests; previously the testing human needed clairvoyance;
  now the test will do a basic check of compressibility. Clairvoyant
  talent is still a good idea.
- This is still a long way off a proper unit test.

* src/sys/dev/random/fortuna.c src/sys/dev/random/fortuna.h
- Improve messy union to just uint128_t.
- Remove unneeded 'static struct fortuna_start_cache'.
- Tighten up up arithmetic.
- Provide a method to allow eternal junk to be introduced; harden
  it against blatant by compress/hashing.
- Assert that locks are held correctly.
- Fix the nasty pre- and post-read overloading by providing explictit
  functions to do these tasks.
- Turn into self-sufficient module (no longer requires randomdev_soft.[ch])

* src/sys/dev/random/yarrow.c src/sys/dev/random/yarrow.h
- Improve messy union to just uint128_t.
- Remove unneeded 'staic struct start_cache'.
- Tighten up up arithmetic.
- Provide a method to allow eternal junk to be introduced; harden
  it against blatant by compress/hashing.
- Assert that locks are held correctly.
- Fix the nasty pre- and post-read overloading by providing explictit
  functions to do these tasks.
- Turn into self-sufficient module (no longer requires randomdev_soft.[ch])
- Fix some magic numbers elsewhere used as FAST and SLOW.

Differential Revision: https://reviews.freebsd.org/D2025
Reviewed by: vsevolod,delphij,rwatson,trasz,jmg
Approved by: so (delphij)
2015-06-30 17:00:45 +00:00
..
atm Change the callout to supply -1 to indicate we are not changing 2015-03-28 12:50:24 +00:00
bluetooth Forgot to add default event mask definition. 2015-04-18 06:16:33 +00:00
netflow CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than ten 2015-05-22 17:05:21 +00:00
netgraph.h CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than ten 2015-05-22 17:05:21 +00:00
ng_async.c
ng_async.h
ng_atmllc.c Mechanically substitute flags from historic mbuf allocator with 2012-12-05 08:04:20 +00:00
ng_atmllc.h
ng_base.c Revise default limit for maximum of netgraph data items. 2015-02-12 22:20:34 +00:00
ng_bpf.c
ng_bpf.h
ng_bridge.c NG_NODE_NAME(node) is always not NULL. Use correct macro. 2014-11-02 05:51:31 +00:00
ng_bridge.h
ng_car.c
ng_car.h
ng_cisco.c Remove AppleTalk support. 2014-03-14 06:29:43 +00:00
ng_cisco.h
ng_deflate.c Move zlib.c from net to libkern. 2015-04-22 14:38:58 +00:00
ng_deflate.h
ng_device.c Remove ifq_drops from struct ifqueue. Now queue drops are accounted in 2014-09-19 09:01:19 +00:00
ng_device.h
ng_echo.c
ng_echo.h
ng_eiface.c Mechanically convert to if_inc_counter(). 2014-09-19 05:03:11 +00:00
ng_eiface.h
ng_etf.c
ng_etf.h
ng_ether_echo.c
ng_ether_echo.h
ng_ether.c Remove struct arpcom. It is unused by most interface types, that allocate 2014-11-07 15:14:10 +00:00
ng_ether.h
ng_frame_relay.c Use macro ERROUT() to make code more laconic and follow style of other 2014-10-31 16:00:45 +00:00
ng_frame_relay.h
ng_gif_demux.c Mechanically substitute flags from historic mbuf allocator with 2012-12-05 08:04:20 +00:00
ng_gif_demux.h
ng_gif.c Mechanically substitute flags from historic mbuf allocator with 2012-12-05 08:04:20 +00:00
ng_gif.h
ng_hole.c
ng_hole.h
ng_hub.c Mechanically substitute flags from historic mbuf allocator with 2012-12-05 08:04:20 +00:00
ng_hub.h
ng_iface.c Huge cleanup of random(4) code. 2015-06-30 17:00:45 +00:00
ng_iface.h Remove AppleTalk support. 2014-03-14 06:29:43 +00:00
ng_ip_input.c
ng_ip_input.h
ng_ipfw.c Bump ipfw module version. 2014-10-09 16:12:01 +00:00
ng_ipfw.h
ng_ksocket.c Remove AppleTalk support. 2014-03-14 06:29:43 +00:00
ng_ksocket.h
ng_l2tp.c Fix circular math macro. 2014-01-03 12:06:54 +00:00
ng_l2tp.h
ng_lmi.c Mechanically substitute flags from historic mbuf allocator with 2012-12-05 08:04:20 +00:00
ng_lmi.h
ng_message.h
ng_mppc.c Pull in r267961 and r267973 again. Fix for issues reported will follow. 2014-06-28 03:56:17 +00:00
ng_mppc.h
ng_nat.c Add NGM_NAT_LIBALIAS_INFO command, that reports internal stats 2013-03-21 08:36:15 +00:00
ng_nat.h Add NGM_NAT_LIBALIAS_INFO command, that reports internal stats 2013-03-21 08:36:15 +00:00
ng_one2many.c Remove unsigned < 0 comparison. 2013-10-26 17:43:18 +00:00
ng_one2many.h
ng_parse.c Fix a bunch of -Wcast-qual warnings in netgraph's ng_parse.c, by using 2015-01-30 21:59:53 +00:00
ng_parse.h
ng_patch.c
ng_patch.h
ng_pipe.c Use M_WAITOK for the NGM_PIPE_SET_CFG control message. We expect it to 2014-05-28 13:15:14 +00:00
ng_pipe.h
ng_ppp.c Accidentially, ng_ppp changes leaked out with r271770. The proper 2014-09-18 14:43:23 +00:00
ng_ppp.h
ng_pppoe.c Add constant for PPP-Max-PayLoad tag. 2013-07-23 10:25:34 +00:00
ng_pppoe.h Add constant for PPP-Max-PayLoad tag. 2013-07-23 10:25:34 +00:00
ng_pptpgre.c Mechanically substitute flags from historic mbuf allocator with 2012-12-05 08:04:20 +00:00
ng_pptpgre.h
ng_pred1.c Mechanically substitute flags from historic mbuf allocator with 2012-12-05 08:04:20 +00:00
ng_pred1.h
ng_rfc1490.c Mechanically substitute flags from historic mbuf allocator with 2012-12-05 08:04:20 +00:00
ng_rfc1490.h
ng_sample.c
ng_sample.h
ng_socket.c Fix multiple incorrect SYSCTL arguments in the kernel: 2014-10-21 07:31:21 +00:00
ng_socket.h
ng_socketvar.h
ng_source.c Mechanically substitute flags from historic mbuf allocator with 2012-12-05 08:04:20 +00:00
ng_source.h
ng_split.c
ng_split.h
ng_sppp.c Mechanically convert to if_inc_counter(). 2014-09-19 05:03:11 +00:00
ng_sppp.h
ng_tag.c
ng_tag.h
ng_tcpmss.c
ng_tcpmss.h
ng_tee.c Mechanically substitute flags from historic mbuf allocator with 2012-12-05 08:04:20 +00:00
ng_tee.h
ng_tty.c Remove ifq_drops from struct ifqueue. Now queue drops are accounted in 2014-09-19 09:01:19 +00:00
ng_tty.h
ng_UI.c Mechanically substitute flags from historic mbuf allocator with 2012-12-05 08:04:20 +00:00
ng_UI.h
ng_vjc.c In order to reduce use of M_EXT outside of the mbuf allocator and 2015-01-06 12:59:37 +00:00
ng_vjc.h
ng_vlan.c Mechanically substitute flags from historic mbuf allocator with 2012-12-05 08:04:20 +00:00
ng_vlan.h
NOTES