From owner-freebsd-security@FreeBSD.ORG Sun May 24 22:44:57 2015 Return-Path: Delivered-To: freebsd-security@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1E9A988 for ; Sun, 24 May 2015 22:44:57 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 92B8721B for ; Sun, 24 May 2015 22:44:57 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id t4OMisJS018599 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 24 May 2015 15:44:54 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.14.5/8.14.5/Submit) id t4OMis46018598; Sun, 24 May 2015 15:44:54 -0700 (PDT) (envelope-from jmg) Date: Sun, 24 May 2015 15:44:54 -0700 From: John-Mark Gurney To: Kevin Day Cc: freebsd-security@freebsd.org Subject: Re: Atom C2758 - loading aesni(4) reduces performance Message-ID: <20150524224454.GX37063@funkthat.com> References: <6BA42026-C785-40B5-B9CF-DD4280693C41@dragondata.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6BA42026-C785-40B5-B9CF-DD4280693C41@dragondata.com> X-Operating-System: FreeBSD 9.1-PRERELEASE amd64 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (gold.funkthat.com [127.0.0.1]); Sun, 24 May 2015 15:44:55 -0700 (PDT) X-BeenThere: freebsd-security@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Security issues \[members-only posting\]" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 May 2015 22:44:57 -0000 Kevin Day wrote this message on Sun, May 24, 2015 at 11:22 -0500: > I???ve got an Atom C2758 system: > > CPU: Intel(R) Atom(TM) CPU C2758 @ 2.40GHz (2400.06-MHz K8-class CPU) > Origin = "GenuineIntel" Id = 0x406d8 Family = 0x6 Model = 0x4d Stepping = 8 > Features=0xbfebfbff > Features2=0x43d8e3bf > AMD Features=0x28100800 > AMD Features2=0x101 > Standard Extended Features=0x2282 > > Enabling aesni seems to make performance much worse: > > root@router:~ # openssl speed -evp aes-256-cbc -elapsed > You have chosen to measure elapsed time instead of user CPU time. > Doing aes-256-cbc for 3s on 16 size blocks: 33200486 aes-256-cbc's in 3.01s > Doing aes-256-cbc for 3s on 64 size blocks: 11444626 aes-256-cbc's in 3.01s > Doing aes-256-cbc for 3s on 256 size blocks: 3328753 aes-256-cbc's in 3.02s > Doing aes-256-cbc for 3s on 1024 size blocks: 866523 aes-256-cbc's in 3.02s > Doing aes-256-cbc for 3s on 8192 size blocks: 108891 aes-256-cbc's in 3.00s > OpenSSL 1.0.1e-freebsd 11 Feb 2013 > built on: date not available > options:bn(64,64) rc4(16x,int) des(idx,cisc,16,int) aes(partial) idea(int) blowfish(idx) > compiler: cc > The 'numbers' are in 1000s of bytes per second processed. > type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes > aes-256-cbc 176609.34k 243517.86k 281851.62k 293480.37k 297345.02k > > > root@router:~ # kldload aesni > root@router:~ # openssl speed -evp aes-256-cbc -elapsed > You have chosen to measure elapsed time instead of user CPU time. > Doing aes-256-cbc for 3s on 16 size blocks: 881020 aes-256-cbc's in 3.02s > Doing aes-256-cbc for 3s on 64 size blocks: 842078 aes-256-cbc's in 3.00s > Doing aes-256-cbc for 3s on 256 size blocks: 700368 aes-256-cbc's in 3.03s > Doing aes-256-cbc for 3s on 1024 size blocks: 425602 aes-256-cbc's in 3.00s > Doing aes-256-cbc for 3s on 8192 size blocks: 76495 aes-256-cbc's in 3.00s > OpenSSL 1.0.1e-freebsd 11 Feb 2013 > built on: date not available > options:bn(64,64) rc4(16x,int) des(idx,cisc,16,int) aes(partial) idea(int) blowfish(idx) > compiler: cc > The 'numbers' are in 1000s of bytes per second processed. > type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes > aes-256-cbc 4662.35k 17964.33k 59148.60k 145272.15k 208882.35k > > > Is this expected here, or is something broken? If you have cryptodev loaded, this is to be expected as OpenSSL will use /dev/crypto instead of the AES-NI instructions.. Just don't load cryptodev and you'll be fine.. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."