Date: Thu, 31 Dec 2020 21:15:02 +0100 From: Franco Fichtner <franco@lastsummer.de> To: Shawn Webb <shawn.webb@hardenedbsd.org> Cc: Allan Jude <allanjude@freebsd.org>, FreeBSD Current <freebsd-current@freebsd.org> Subject: Re: Enabling AESNI by default Message-ID: <7DF6338B-9DDF-4F3C-B217-DADD72D16898@lastsummer.de> In-Reply-To: <20201231200702.22gvepvlzfwncalz@mutt-hbsd> References: <5d56280e-a8dd-b28d-7039-f8fe0bc0cd6f@freebsd.org> <20201231200702.22gvepvlzfwncalz@mutt-hbsd>
next in thread | previous in thread | raw e-mail | index | archive | help
h= ttps://cgit.freebsd.org/src/commit/sys/crypto/aesni?h=3Dstable/12&id=3D95b= 37a4ed741fd116809d0f2cb295c4e9977f5b6 may have subtly broken a number of IPsec installations by stalling = active connections after certain amounts of traffic transferred. We're still trying to confirm, but it looks like this had an overall impact on 12.0 and 12.1 except that only one person in OPNsense traced it back to = aesni.ko to our knowledge to effective work around an apparent issue there. If that is not the actual fix, the problem still exists in 12.2 and = onward ;) https://github.com/opnsense/core/issues/4415 To answer the question: I guess so, yes, enable for all to have proper = errata and increased "test" coverage... Cheers, Franco > On 31. Dec 2020, at 9:07 PM, Shawn Webb <shawn.webb@hardenedbsd.org> = wrote: >=20 > On Thu, Dec 31, 2020 at 02:51:06PM -0500, Allan Jude wrote: >> We've had the AESNI module for quite a few years now, and it has not >> caused any problems. >>=20 >> I am wondering if there are any objections to including it in = GENERIC, >> so that users get the benefit without having to have the "tribal >> knowledge" that 'to accelerate kernel crypto (GELI, ZFS, IPSEC, etc), >> you need to load aesni.ko' >>=20 >> Userspace crypto that uses openssl or similar libraries is already >> taking advantage of these CPU instructions if they are available, by >> excluding this feature from GENERIC we are just causing the "out of = the >> box" experience to by very very slow for crypto. >>=20 >> For example, writing 1MB blocks to a GELI encrypted swap-backed md(4) >> device: >>=20 >> with 8 jobs on a 10 core Intel Xeon CPU E5-2630 v4 @ 2.20GHz >>=20 >> fio --filename=3D/dev/md0.eli --device=3D1 --name=3Dgeli --rw=3Dwrite = --bs=3D1m >> --numjobs=3D8 --iodepth=3D16 --end_fsync=3D1 --ioengine=3Dpvsync >> --group_reporting --fallocate=3Dnone --runtime=3D60 --time_based >>=20 >>=20 >> stock: >> write: IOPS=3D530, BW=3D530MiB/s (556MB/s) (31.1GiB/60012msec) >>=20 >> with aesni.ko loaded: >> write: IOPS=3D2824, BW=3D2825MiB/s (2962MB/s) (166GiB/60002msec) >>=20 >>=20 >> Does anyone have a compelling reason to deny our users the 5x = speedup? >=20 > Note: HardenedBSD has had AESNI enabled on amd64 for nearly six years. > Not a single complaint. >=20 > For reference, HardenedBSD commit: > a5aabd1c8dcc2a5097de56c54ec2a1c8d9352896 >=20 > Thanks, >=20 > --=20 > Shawn Webb > Cofounder / Security Engineer > HardenedBSD >=20 > GPG Key ID: 0xFF2E67A277F8E1FA > GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 = 0FB2 > = https://git-01.md.hardenedbsd.org/HardenedBSD/pubkeys/src/branch/master/Sh= awn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7DF6338B-9DDF-4F3C-B217-DADD72D16898>