From owner-freebsd-hackers@freebsd.org Tue Oct 27 12:55:12 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 879C644C780 for ; Tue, 27 Oct 2020 12:55:12 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CLBWN040hz4n2Z; Tue, 27 Oct 2020 12:55:11 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk1-x742.google.com with SMTP id b69so963228qkg.8; Tue, 27 Oct 2020 05:55:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=VnSx1HNnQ6+MmhjdnKEVV3NYtgP8lJ5jqGhe04JjnBk=; b=tPh6b+qwZmNmdgo/y5VserrVozZR4AkUZFD7+Q2n57ouwY1xwvsng/m5Ubgr1LVbu+ 1pF7biAm8dEE96vebmirGn4Zi+EV/WXK6d0r0NdF3VhmEJ/Plt7q9VSmLEFT39ExyFGX sR0oPPI/avRSp/lFELNPILqp7KDNd8jKJUpO6rdEN71yWX9nGkIJo+CR+hy3oN2GQbuM nScEdOhhUQwHlZi8pMTQAsnDo+d1L5z2jVp6reN0QgK20bwMHse0MdACV6QsggjFNo8/ jEkJ+UpkN+eSYj1HwdZF4Yzl8FYiKNNtofEYk8L6h7F+GnnWV8nw9yy3axgIzI5mtYlE PgIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=VnSx1HNnQ6+MmhjdnKEVV3NYtgP8lJ5jqGhe04JjnBk=; b=KvKbO1Eyjmg4oSs23/Sb6jYc4qfOyNvYYf5zsPw55h6rzN6RhMgilm2SwM1ipTb8KC AJNvCzOr5eht+qgaZSERbymgG70QBsV9Q5r88OXuUJSsgrrIVhQ2pkfrmnpvO8FJ1eOM DAe0eTIkcaxrlCQqcUnbIRmbnWNKxZiyYbTTu5oF03szc5u9Zho4euvzDNIsMB5BnT3D Wlse3ClibEMex2x/B4BGlVXKLruypCA64siMMCWh0r4p3RsCJ+GSANZVrBOZ8FkEZdov rW9oOh1IZDcZWkl1/3u1jmCevsWL/csEV99mYOu6f97NsVHZTtBOb6dHi/I2LZtU0bfH hW4g== X-Gm-Message-State: AOAM533CyuUOdS35suN934y69cIwBNF2JyY7azAgYHZqIkXiKN6czh10 YGZP2DR1qPxW8eTjBA2WX5YFbXVLvR8= X-Google-Smtp-Source: ABdhPJxhOLYK71HvGHIENbPka8zvnZTawv+I1WeVSMlwT9rsRhOvrc3G1XUv3vzSFM6Pdvk3MykMow== X-Received: by 2002:a37:ac11:: with SMTP id e17mr2035372qkm.232.1603803311215; Tue, 27 Oct 2020 05:55:11 -0700 (PDT) Received: from raichu (toroon0560w-lp130-01-174-88-77-103.dsl.bell.ca. [174.88.77.103]) by smtp.gmail.com with ESMTPSA id u31sm697192qtu.87.2020.10.27.05.55.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 05:55:10 -0700 (PDT) Sender: Mark Johnston Date: Tue, 27 Oct 2020 08:55:08 -0400 From: Mark Johnston To: Rick Macklem Cc: Neel Chauhan , "freebsd-hackers@freebsd.org" , "jhb@FreeBSD.org" Subject: Re: QAT driver Message-ID: <20201027125508.GD31663@raichu> References: <20201026200059.GA66299@raichu> <723fbd7326df42ce30cd5e361db9c736@neelc.org> <20201027032720.GB31663@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4CLBWN040hz4n2Z X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=tPh6b+qw; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::742 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-1.88 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MIME_GOOD(-0.10)[text/plain]; MID_RHS_NOT_FQDN(0.50)[]; ARC_NA(0.00)[]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-0.999]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-0.17)[-0.165]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::742:from]; NEURAL_HAM_MEDIUM(-1.02)[-1.017]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; MAILMAN_DEST(0.00)[freebsd-hackers] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Oct 2020 12:55:12 -0000 On Tue, Oct 27, 2020 at 04:32:40AM +0000, Rick Macklem wrote: > Mark Johnston wrote: > >On Mon, Oct 26, 2020 at 08:00:08PM -0700, Neel Chauhan wrote: > >> Hi, > >> > >> This is great news for me with my home HPE ML110 G10/Xeon 4108 server. > >> > >> However, I will not be able to test this patch unless it can get > >> backported to 12.1 or 12.2 once it's out, and I don't expect backporting > >> to happen. > > > >Indeed, it wouldn't appear before 12.3. > > > >> I have one question about this: will I be able to use this to accelerate > >> OpenSSL? Is additional code needed? > > > >In principle OpenSSL can make use of cryptodev(4) using the cryptodev > >engine, which would allow requests to be handled by qat(4) (or any other > >hardware crypto driver loaded in the kernel). I don't know that the > >cryptodev engine is really maintained these days though. More > >importantly, using the kernel to perform crypto transforms carries a lot > >of overhead since OpenSSL would have to switch into the kernel and copy > >data between userspace and the kernel for each request. I'd be > >surprised if you get any benefit from this versus using the AES-NI > >extensions in userspace, which OpenSSL should do out of the box. > Can it be made to work with the KERN_TLS in head? > (KERN_TLS works fine for me using the ktls_ocf and aesni modules.) > I think it is only head and requires the patched OpenSSL3 that jhb@ > currently has. I hadn't looked at ktls_ocf.c before but at a glance it looks like it can make use of any hardware or software opencrypto driver that supports the requested algorithms. The qat(4) port implements the algorithms referenced by ktls_ocf_try(). > I know nothing about it, except that it seems to work well, doing > the TLS application data records in the kernel for a TCP socket > enabled by the patched OpenSSL library. > I've cc'd jhb@, so hopefully he can let us know what it needs?