From owner-freebsd-current@freebsd.org Thu Sep 13 03:32:50 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E15E710A3D9B for ; Thu, 13 Sep 2018 03:32:49 +0000 (UTC) (envelope-from kob6558@gmail.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 6AB367D98B for ; Thu, 13 Sep 2018 03:32:49 +0000 (UTC) (envelope-from kob6558@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 2EFD610A3D8D; Thu, 13 Sep 2018 03:32:49 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D11010A3D8C for ; Thu, 13 Sep 2018 03:32:49 +0000 (UTC) (envelope-from kob6558@gmail.com) Received: from mail-oi0-x244.google.com (mail-oi0-x244.google.com [IPv6:2607:f8b0:4003:c06::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 928887D985; Thu, 13 Sep 2018 03:32:48 +0000 (UTC) (envelope-from kob6558@gmail.com) Received: by mail-oi0-x244.google.com with SMTP id l82-v6so7963381oih.11; Wed, 12 Sep 2018 20:32:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=eCu1sHS15gdldwyaJkJ+HTT4dL7qtulwWdJ4ovKy6Js=; b=Ztc6bmxPJPAY80Wq5fD5rLifw7HiO+h0xMXZe+k6F00sNbpqbCDwdFCVowmPdes4ay U7Xb+qGEO9NIjmIHxxv2FmD7zELeMNedBXKq7+THih3ytpNw50qWSfI0W2bmSvrv1sqJ G4rrBkbBiTlpxPkuHDY1gJP8ksct0hukN7QYTvIgTeMSwiL8bxy8bcdC9sKKoJQMG6Xs YCVjTE5Zv1zV236Wu3/LyFkW0wQwQB0qyCwWKGQ5jnWr/eqbi8rHYnmBIkOyfWSGl4yi yQIPrRvT5b3ZJeIbJvkeDM7WmlRiInb61dmiaW/s475bS9VkQmF+mF1QCbnVX/ZiREMm M5kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=eCu1sHS15gdldwyaJkJ+HTT4dL7qtulwWdJ4ovKy6Js=; b=i5rgU70tvlSSeULhKSdN9Ljflsj2vYQEcOB1BmbtV5gMrvh0kcOtTd1LSA/9+26KFK GnIbo09JRyy3E9Qct1bmvjlK/GfutU7rF4rPYBrFHrmHhQw1G90/6zF8AKOsBeQKKDpr h3oauKIAK9GpFtqcVZ2tLHToQbh34p293Zc7wCw0kz8tLL3eok+MWwmDEzjBx2voFZGo t/81oPlW0tJqTMShVl+EOV1fBBNbZhJmA08atXYejuxG5YRuvRksAJpDz0xjiFDA8PCF DmtZ1p7Vrl0NpiqaxJhjAJDskY+6FkSW+PikObLJLDay2U8+VcbDojOsKHiHCaTM+NJf 2hqg== X-Gm-Message-State: APzg51Blf5YhuCC1WH89LIuQvszZaY36UrCN95GO+jAHY7Y10Ymw9O6P NZeZpe13s8VjIJmDZtfVFf+QG/PTU9smKUQ/PJB4Nj8k X-Google-Smtp-Source: ANB0VdYIW6+StbTR3aqV83fL/k/2BVyIi+R6M57PyFJtednf+D1rgybQ43/kk2a3CAjvyjksEkAgedv6stRAglYIou4= X-Received: by 2002:aca:6206:: with SMTP id w6-v6mr5608424oib.201.1536809567370; Wed, 12 Sep 2018 20:32:47 -0700 (PDT) MIME-Version: 1.0 References: <43892083.20180913024646@serebryakov.spb.ru> In-Reply-To: <43892083.20180913024646@serebryakov.spb.ru> From: Kevin Oberman Date: Wed, 12 Sep 2018 20:32:30 -0700 Message-ID: Subject: Re: Speed problems with both system openssl and security/openssl-devel To: Lev Serebryakov Cc: current , brnrd@freebsd.org, Jung-uk Kim Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Sep 2018 03:32:50 -0000 On Wed, Sep 12, 2018 at 4:48 PM Lev Serebryakov wrote: > Hello Brnrd, > > I'm benchmarking new hardware (rather limited one, but still) which > supports AES-NI (Celeron J3160). > > I'm comparing simple "openssl speed aes-256-cbc" and "openssl speed -evp > aes-256-cbc" on FreeBSD 12-ALPHA4 (built by myself with all debug options > turned off) and Debian Linux 9.5.0 booted from install DVD (without > installation). > > Simple "openssl speed aes-256-cbc" shows same numbers both in > single-threaded and multi-threaded mode (for all 4 cores). Linux is > marginally faster, > but it is in the margin of measurement error. > > But "openssl speed -evp aes-256-cbc" gives me very disappointing results. > FreeBSD's openssl is WAY slower than Linux one. It is even slower than > non-evp mode for small blocks. > > Here are results (As reported by openssl, with fractions dropped): > > Lin 18942 20637 21300 57967 58769 58769 > Free 18931 20591 21282 58342 58731 58779 > Lin-evp 97049 151466 183905 194385 197514 197727 > Free-evp 2838 10845 35362 81892 131264 137579 > > Linux have openssl 1.1.0f, and I've tried both system /usr/bin/openssl > (1.0.2p) > and /usr/local/bin/openssl from security/openssl-devel port (1.1.0i), > results are > virtually the same. I have "ASM" and "SSE2" options enabled in port. > > What happens here? Why does FreeBSD's build of openssl use AES-NI so > inefficient? > > -- > Best regards, > Lev mailto:lev@FreeBSD.org This is probably not the issue, but aesni is not in the GENERIC kernel. Are you sure aesni.ko is loaded? % kldstat | grep aesni If not found, "kldload aesni" and add aesni_load="YES" to /boot/loader.conf -- Kevin Oberman, Part time kid herder and retired Network Engineer E-mail: rkoberman@gmail.com PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683