Andrew Gallatin d2e6258258 Avoid unneeded call to arc4random() in syncache_add()
Don't call arc4random() unconditionally to initialize sc_iss, and
then when syncookies are enabled, just overwrite it with the
return value from from syncookie_generate(). Instead, only call
arc4random() to initialize sc_iss when syncookies are not
enabled.

Note that on a system under a syn flood attack, arc4random()
becomes quite expensive, and the chacha_poly crypto that it calls
is one of the more expensive things happening on the
system. Removing this unneeded arc4random() call reduces CPU from
about 40% to about 35% in my test scenario (Broadwell Xeon, 6Mpps
syn flood attack).

Reviewed by:	rrs, tuxen, bz
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D21591
2019-09-11 18:48:26 +00:00
..
2019-08-02 22:43:09 +00:00
2019-08-02 07:41:36 +00:00
2018-05-29 12:32:08 +00:00
2019-08-08 11:43:09 +00:00
2018-07-01 08:37:07 +00:00
2019-04-22 19:36:19 +00:00
2018-07-01 08:37:07 +00:00
2019-08-08 08:23:27 +00:00
2018-09-18 10:53:07 +00:00
2019-09-01 10:39:16 +00:00
2019-08-31 13:13:40 +00:00
2019-08-02 07:41:36 +00:00
2018-05-19 05:56:21 +00:00
2019-09-06 18:33:39 +00:00
2018-07-31 22:56:03 +00:00